Asp.net - Group Values In A Nested Repeater?

Nov 29, 2011

I have a table of questions and a table of alternatives corresponding to each question. I'm planning to build a questionnaire system (in ASP.NET) which select a few random questions from that total of questions.

I'm using the following SQL Statement to choose the random questions:

SELECT TOP (@maxQuestions) QuestionID, QuestionName FROM Questions WHERE CourseID = @CourseID ORDER BY NEWID()

Which populates a DataTable in a DataSet and data bind it to a Repeater control (the parent Repeater). What I need now is to get every alternative related only to the current random questions generated from the query above in a separate SQL Statement so that I can populate the DataSet with a new DataTable, add the relation between them two and data bind it to another Repeater control (the child repeater).

I don't know how to get only the alternatives related to the current random questions I generated.Otherwise, I get an error saying that I don't have all child values corresponding to the parent values and I can't group the alternatives inside the same question.

View 1 Replies


ADVERTISEMENT

Asp.net - Nested Repeater Show Data That Matches Parent Repeater

Mar 15, 2011

I am using a repeater to build a custom table. However, I can't figure out how to make the table show subtotal if the next rows tour does not match the previous rows.

Something similar to that.

row1 tour1
row2 tour 1
tour1 subtotal

[Code].....

but this shows all the data in the nested repeater not the ones that match the parentrepeater fields for example tour,theme,dep7 should match in the child repeater

View 1 Replies

Asp.net - Access A Gridview Inside A Repeater Which Is Inside A Repeater (Nested Repeater)?

Apr 11, 2012

How can I access rep_DataSimilarToBacthid ? I need to bind the GridView and call GridView RowDataBound or InitializeRow

[Code]...

I am using VB.Net with Framework Version 2.0.

View 1 Replies

Get Value Of Label When Button Clicked In Nested Repeater Asp.net Vb?

Oct 14, 2011

I have nested repeaters, each item in the nested repeater has a label and a button on it, i want to beable to access the label.text when the button is clicked, I think i'm nearly there as I can return the index of the repeater and nested repeater that is clicked, i'm just having some trouble finding the label itself.

You might be able to help me without me posting the repeater code. Here is my code behind for when the button is clicked.

Protected Sub btnEditUser_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Dim btnEditUser As Button = DirectCast(sender, Button)

[Code]....

I'm currently getting this error 'Object reference not set to an instance of an object.' when trying to write the value of UserId.Text so i think i've got it slightly wrong in this line:

Dim UserId As Label = DirectCast(reClients.Items(selectedClient).FindControl("lUserName"), Label)

View 2 Replies

.Net Repeater Group By?

Aug 10, 2009

I have the following code in my vb.net:

Code:

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 'Start Bind PO Details and Trailers dsRepeater = RetrieveDCDetails(Session.Item("UserID"), Session.Item("DCNo")) dsRepeater.EnforceConstraints = False

[code].....

View 1 Replies

Sql - Group By Having And Count As LINQ Query With Multiply Nested Tables?

Feb 28, 2012

I have the following SQL query to return all Customers who have no OrderLines with no Parts assigned - i.e. I only want the customers within which every order line of every order has no parts assigned - (in the actual problem I am dealing with a different domain but have translated to customers/orders to illustrate the problem)

SELECT c.Customer_PK
FROM Customers c
INNER JOIN Orders o[code].....

This works but generates less than optimal SQL - it is doing a subquery for Count on each row of the customers query rather than using Group By and Having. I tried making the LINQ Group By syntax work but it kept putting the filter as a WHERE not a HAVING clause.Edit in response to Answers below: I am accepting JamieSee's answer as it addresses the stated problem, even though it does not produce the GROUP BY HAVING query I originally had.I am a VB developer so I have had a crack translating your code to VB, this is the closest I got to but it does not quite produce the desired output:

Dim qry = From c In context.Customers
Group Join o In context.Orders On c.Customer_PK Equals o.Customer_FK
Into joinedOrders = Group[cod].....

The problem I had is that I have to push "jl" into the Group By "Key" so I can reference it from the Where clause, otherwise the compiler cannot see that variable or any of the other variables appearing before the Group By clause.With the filter as specified I get all customers where at least one order has lines with no parts rather than only customers with no parts in any order.

View 3 Replies

LINQ Query To Group Data Between Two List Collections, Populating A Nested Object

Oct 26, 2011

I have these objects:[code]Using LINQ I need to take a List(Of MakeInfo) and a List(Of ModelInfo) and aggregate the StockInfo from ModelInfo into the List(Of MakeInfo).So for each MakeInfo I will have a total count of all stock where MakeInfo.Name = ModelInfo.Make, and also a minimum price.I think it's going to be something like this, but I'm having trouble accessing the nested object and not sure if it's going to be possible with a single query.[code]

View 2 Replies

Asp.net - Nested Repeater Error: Object Reference Not Set To An Instance Of An Object?

Jul 28, 2011

I am taking some code that I have used for a nested listview before and trying to make it work with a nested Repeater but I am getting an error.

System.NullReferenceException: Object reference not set to an instance of an object.

.aspx
<asp:Repeater ID="reMainNav" runat="server">
<HeaderTemplate><ul></HeaderTemplate>[code].....

View 1 Replies

Count Values Created By Repeater VB?

Nov 22, 2011

I have a small repeater which loops through up to about 10 items in a database, and does database calls within each repeat to get the values (Numerical) required to enter into a <p> tag in the HTML.

Once the repeater has completed I need to get the sum of all the <p> tag values.[code]...

View 1 Replies

How To Reset Values Inside Repeater

May 25, 2011

I have a repeater which displays products. Users can select a Size - dropdownlist and an Amount - textbox. Then they press Order or Cancel. When they press Cancel I would like the values of Size and Amount to return to their default values.
Protected Sub lbtnCancel_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles lbtnCancel.Click
rpt.ProductList is the repeater name
lblFeedback.Text = ("")
lblFeedback.ForeColor = Drawing.Color.Black
End Sub
I am using VB.NET.

View 2 Replies

Passing Values Within Repeater And Then To Another Form

May 2, 2011

I am trying to pass values within a repeater binding them to a button and pass them from this form to another form. When I compile this it gives me an error indicating.
System.FormatException: Input string was not in a correct format.

Button within Repeater Code in form1.aspx:
<asp:Button ID="Button1" runat="server" Text="" CommandName= "TEST" CommandArgument = '<%# Eval("Parking_ID") + "," + Eval("Parking_Name") %>' />

In form1.aspx.vb Repeater_ItemCommand Function:
Protected Sub repeater1_ItemCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.RepeaterCommandEventArgs) Handles repeater1.ItemCommand
If (e.CommandName = "TEST") Then
Dim commandArgsAccept As String() = e.CommandArgument.ToString().Split(New Char() {","c})
[Code] .....

View 1 Replies

Looping Through A Repeater Control To Get Values Of Textbox In Asp.net?

Aug 12, 2011

I am trying to loop through my repeater control and get the textbox values.However, I am getting an error: {"Object reference not set to an instance of an object."}

my code is:

Dim txtField As TextBox
Dim j As Integer = 0
'Confirm if user has entered atleast one quantity
For Each item In rptRequestForm.Items

[code]....

View 3 Replies

Get Values From HTML Radio Buttons Inside A Repeater?

Dec 2, 2011

I have a simple questionnaire system which shows a random number of questions to the user out of a certain total in my database.I have 2 separate tables: Questions and Alternatives (which are the options to answer) related by QuestionID field in both tables. I rendered such questionnaire using Nested Repeaters (parentRepeater for questions and childRepeater for the options) and it shows correctly on the page.Each option is a radio button which I had to use it as a HTML instead of the Standard Server Control <asp:RadioButton> because of the Dynamic ID problem inside a repeater.[code]What I don't know is how do I get all the questions answered by the user given that I don't know the QuestionIDs and the Alternative IDs since it's randomly generated and using a HTML input tags?

View 1 Replies

Rebind Repeater Using Next / Previous Buttons In The ItemTemplate Of The Same Repeater?

Mar 27, 2009

I have a parent repeater with nested repeaters.My problem is I am trying to use 'Next' and 'Previous' buttons to rebind my repeater (rptTabContent) and thus the inner repeaters also, but when I try to manipulate the state of these links during the ItemCommand event they are overwritten by the bind.

View 1 Replies

VS 2008 : Getting Values Of All Text Boxes Within A Group?

Aug 25, 2011

Im attempting to loop through all the text boxes inside of a group box, and add the text into a list box to later be written to a text file. Here is the code I am using.

Dim cControl As Control
Dim FILE_NAME As String = "Tester.efw"
Dim Group As GroupBox

[code]....

Now instead of locating only the text boxes, apparently it is still trying to identify the labels as text boxes, because I am getting this error:Unable to cast object of type 'System.Windows.Forms.Label' to type 'System.Windows.Forms.GroupBox'.

View 12 Replies

Group, Spilt, Sort And Sum Up Values From A EDI String Into Variables?

Nov 15, 2010

I am new to VB.Net 2008. I have a tricky task to resolve, it is regarding extracting characters (values) from a long string, the extracted values from the text shall be summed up and sorted by keywords, reformatted and saved into a CSV file.

[Code]...

View 2 Replies

VS 2008 Writing Control Values From XML To Controls Within Group Boxes?

Nov 28, 2010

So basically what I'm trying to do is write data from an XML file (a "save file") back into the form. My controls are in all different group boxes (makes it much easier for showing and hiding groups of controls dynamically). I thought about and am putting each control's Parent name into the file, but can't figure out how to get that parent name back into the DirectCast within a For...Next loop so it will actually cast the data into the control.

[Code]...

View 1 Replies

Loop And Enumerate Properties Of Nested Classes In Nested Classes?

Sep 24, 2010

so far i got

code
For Each item As Reflection.FieldInfo In GetType(NameSpace.ClassWithNestedClasses).GetFields
rtfAppend(item.Name & ":" & Tab & item.GetValue(Me))
Next
For Each item As Reflection.PropertyInfo In GetType(NameSpace.ClassWithNestedClasses).GetProperties()

[code]...

which gets me the simple string vars and properties of my top class, but how can i apply this to loop through all sub classes and get there vars and props?

View 1 Replies

See If Current User's Group Name Matches A Specified Group Name Using Active Directory Roles And SID's?

May 3, 2011

I'm trying to match up a specific group name and see if it exists for the currently logged in user using Active Directory roles. If the Group Name exists for the Current User, I want that group name to be displayed in a drop down list. Example: If current user is in BIG Group, display BIG in drop down list.Problem: All I am getting is SIDs and I'm not able to get anything to match up to the group name and nothing will show up in the drop down list.I also get the following Error:Error: Object variable or WIth block variable not set.How do I fix this?? here is the code I am using:

Private Sub GetMarketingCompanies()
' code to populate marketing company drop down list based on the current logged in users active directory group that

[code].....

View 3 Replies

Find A Repeater That Is Within Another Repeater?

Feb 7, 2012

Ok so my issue is I have three repeaters. Within that repeater I have another repeater and a third one in the second. There is more in between but that's not relevant. Below the HTML is my VB code. My issue is that rptCrashPercentageAvg reutrns Nothing. How can rptCrashStatsDisplay access rptCrashPercentageAvg?

<asp:Repeater ID="rptCrashStatsDisplay" runat="server">
<ItemTemplate>
<asp:Repeater ID="rptCrashPercentage" runat="server">

[code].....

View 1 Replies

Enumerate If An Active Directory Group's Member Is User Or Another Group

Jan 31, 2011

Enumerate if an Active Directory group's member is user or another group

View 1 Replies

LINQ Group By Multiple Values Does Not Work Well But Work Well In C#

May 29, 2012

I found that when group by multiple values does not work well with VB.NET, but it works well with C# ,here are my code, is there something wrong with my VB.NET Code? Here is my VB.NET code:

[Code]...

View 1 Replies

Reference A Group Of Controls Inside A Group Box?

Jan 1, 2011

I am writing an application and I do not know how to reference a group of controls inside a group box. I will include the code I have written so far and a picture with a detailed explanation as to what I am trying to do. Feel free to comment on any discrepancies that you may notice in my code.

Code:

Public Class Form1
' The following class-level constants are used
' to calculate the price of the model
Const decCOUPE As Decimal = 18000

[code].....

View 3 Replies

Remove All Items In A Listview Group And The Group Name?

Sep 25, 2011

I want to remove a group (include all items in this group) in ListView, but unsuccessful, the code is below, why?

ListView1.Groups("GroupName").Items.Clear()
ListView1.Groups.Remove(ListView1.Groups("GroupName"))

View 4 Replies

Urgent Add Activedirectory Group To A Local Group?

Apr 6, 2011

anyone have some quick code on how to do this?

wmi is not a option.

View 1 Replies

Divide The Content In My Application To Groups Each Group Has Its Own Rectangle Border With The Group Name Located At The Top Border

Jul 22, 2009

I want to divide the content in my application to groups each group has its own rectangle border with the group name located at the top border, i've seen it before and i'm not sure what is the correct name of this control, anyone knows what I'm talking about ? EDIT: Ok, I found the Groupbox Control but how do i use it? should i just drag other controls inside it or i should add controls directly into it?

View 2 Replies

Remove AD Group From Group?

Jul 25, 2011

I have this code I've used multiple times to add and remove users from AD groups, but when I try to use it to remove an AD group from another AD group it fails with "The server is unwilling" [code]...

View 1 Replies

Asp.net - Getting Value Of Anchor Tag From Repeater?

Aug 4, 2011

I have a regular html anchor link that is bound to an Id column. I want to loop through the repeater and get the value of the Id column, but can't figure out how. I have some code below my repeater markup. I can't figure out how to do it with just a client side anchor tag.

<asp:Repeater ID="repSearchResults" runat="server">
<ItemTemplate>
<tr>

[Code].....

View 2 Replies

Asp.net - Reproduce In .net In An Asp:repeater?

Mar 27, 2011

I need to repeat the following in vb.net/asp.net.

<ul id="prod_nav" class="clearfix">
<li class="top"><a href="05-Pink-02-Category-List.html" class="top_link"><span class="down">Body and Trim</span></a>
<ul class="sub">

[code].....

View 1 Replies

Paging With An ASP.NET Repeater?

Feb 5, 2010

I am making use of an ASP.NET Repeater.My Repeater is called myRepeater and I only want to display 20 items per page.Can this be done with a ASP.NET Repeater and if so what changes must I make to my code below? I want to be able to make use of paging. C# example is also fine!![code]

View 3 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved