List Of Grouped (nested) Checkboxes?

Mar 11, 2011

I want to create List of Grouped Checkboxes as follows:

[]Group1
[] Item1
[] Item2
[]Group2
[]Item1
[]Item2
[]Item3

Here Group# and item# are checkboxes. Does anyone know how to do this in asp.net. I am getting data from DataSet. One limitation is that I am not allowed to use third party tool/controls or jQuery.

View 1 Replies


Similar Messages:

Forms Data Controls :: Checkboxes Within Nested Repeaters?

Feb 14, 2010

[Code]....

I use if(! Page.postback) to fill those two repeaters I want to get the data related to checked checkboxes when using the below code it get only the data of the first checked box how to make it brign all the data

private void Btn_Confirm_Click(object sender, System.EventArgs e)
{
//CheckBox checkedButton = null;
foreach (RepeaterItem item in ParentRepeater.Items)
{
CheckBox control=(CheckBox)item.FindControl("CheckBox1");
if (control.Checked)
{
//checkedButton = control;
foreach(DataRow r in GetInnerData(control.Text).Rows ) // GetInnerData is used to pring datarelated to the selected check box
{
if(r["DESCRIPTION"].ToString() == control.Text)
{
Response.Write(r["DESCRIPTION"].ToString() + r["Date" ].ToString() + r[ "Trx" ].ToString() + r[ "GL" ].ToString() + r["Amount" ].ToString() +"
");
}
}
control.Dispose();
//checkedButton.Dispose();
break;
}
}
}
}

View 2 Replies

Forms Data Controls :: Get Access Of Checkboxes Inside Of Nested Gridview

Aug 3, 2010

In datalist, I hve populated Grdiview according the Category Id. Inside Gridview , I hve checkboxes. Now i want to get the selected checkboxes names to be insrted into the database. how to get access of those checkboxes inside of Gridview.

View 9 Replies

Web Forms :: Delete Multiple Rows In Nested Gridview Control Using CheckBoxes

Jun 25, 2012

I have trying your solution [URL] .... in nested grid view. But it is not working with nested grid view. How to solve it.

Error "object reference not set to an instance of an object" ....

View 1 Replies

List Of Checkboxes Each With Associated Textbox?

Mar 4, 2011

I'm trying to build a list of checkboxes, each one with a textbox/textarea associated to it. The plan is for it to look something like this

[checkbox]
[textbox]

[checkbox]
[textbox]

[checkbox]
[textbox]

The title of each checkbox & textbox will be populated from the database. I'm not really sure how to go about doing this.

View 2 Replies

MVC :: Update Database From Dynamic List Of Checkboxes?

Mar 8, 2011

I'm fairly new to MVC and have an issue converting something I created using normal ASP.NET to MVC framework.I have a database with one to many relationship between 2 tables. I need to be able to make amendments to the single parent row in the same page as that which will edit the many records. The values to be edited in the table with many rows to be edited are either true or false and will be edited using a checkbox.

To make it a little more complicated the list of checkboxes is actually dynamic and is built from another table.In the normal ASP.NET page, all the controls are placed in a details view and the dynamic list of checkboxes is added to a placeholder on Page_Load. Then I get the list of values that are true and, for each row in the list, use FindControl to find the checkbox with the appropriate ID and set it to flagged.

I've got the MVC page working so far as follows:

I can build the checkboxes I need by passing the list of ID's using the ViewData.

I can also add, and edit the fields that are in the table with the single row that needs to be edited.

What I'm stuck on is:

Populating the appropriate checkboxes with "true" as appropriate

Subsequently saving any updates to the checkboxes when the save button is clicked.

View 1 Replies

Add Only Checked Checkboxes Added In Array List?

Nov 19, 2010

i want to insert checkbox text only if they are checked. .. how to do that ..

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
TextBox1.Text = Request.QueryString("txt")
Dim splitted As String() = TextBox1.Text.Split(",")
For Each id As String In splitted
Dim ctrl As Control = Page.FindControl("checkbox" & id)
If Not ctrl Is Nothing Then
Dim chkbox As CheckBox = DirectCast(ctrl, CheckBox)
chkbox.Enabled = False
Dim arrList As New ArrayList()
'populate the list with some temp values
arrList.Add(CheckBox1.Text)
arrList.Add(CheckBox2.Text)
'databind the list to our repeater
Repeater1.DataSource = arrList
Repeater1.DataBind()
End If
Next
End Sub

This code will add all checkboxes whether it is checked or not !

so that only checked checkboxes would be added in array list

View 1 Replies

C# - Creating A List Of Checkboxes Using MVC For A Table Without A Primary Key?

Mar 14, 2011

I have a table that get populated via an external text file. I am not sure of the exact process as I'm relatively new to the company.

The table does not have a primary key as the entire table is dumped and re-loaded every quarter when there is a new text file.

Enter ASP.NET MVC. I need to display that table with checkboxes in a grid so the user can select some rows and send it back to the server. It sounds relatively easy, but I am really not sure what to put as the value for the checkboxes as I am pretty sure I'll need to use multiple columns to create a unique. Yep, I know, I know :).

OldTable
- Field1
- Field2
- Field3
...
- FieldN

The View

...
<input type="checkbox"
name="bunchOfStuff"
value"Field1Value,Field2Value,Field3Value"/>
...

Would something like this work? If I can create a key with a few fields, can I use those fields as the value in the checkbox? I realize my action will be a bit ugly as I'll have to split and parse each value in the array of values.

View 3 Replies

C# - Paged List With Checkboxes, Keep The Checkbox Value Browsing Through The Paging?

Mar 29, 2010

I got a list of customers I thought I would list in a gridview or a repeater with customer html, it gone have paging. I'm gone have a checkbox for each customer in the list. Do you guys have any suggestions on how I should do to keep the checkbox value when I go to page 2-3-4 ect in the paging. I'm thinking a session to store the id of the checked customers. After I'm done setting the values they go to the database.

Do you got any other ideas then the session I'm thinking of?

View 2 Replies

Looping Through A List Of Checkboxes And Saving The Values Not Working Properly?

May 15, 2010

I'm having a bit of a problem with this code.

The program gives me a list of checkboxes but a user ID. then u user can change his selection and push the save button (id="btnSaveUserIntersts") and i am trying to save in the hidden textbox all the values of the checkboxes that was choosen.

The problem is that i am getting all the time the same selections that came form the database and not getting the new selection that the user made.

what am i doing wrong here?

[code]...

View 3 Replies

List Nested Gridview - Filled And Displayed

Jun 28, 2010

I have a listview with a nested gridview. I'm having trouble accessing the gridview. I want the gridview to be filled and displayed when a linkbutton is clicked on the listview. I use FindControl to get linkbutton - but cannot get it to work for the nested gridview. I have gridview working outside the listview, but it fails when nested.
Snippet:

asp.net Code:
<asp:ListView> ...............
<SelectedItemTemplate>
<tr >
<td>
<asp:Label ID="BuildingLabel" runat="server" Text='<%# Eval("Building") %>' CommandName="Select"/>
</td>
<td>
<asp:Label ID="AreaOccupied_m2Label" runat="server"
Text='<%# Eval("[AreaOccupied m2]") %>' />
</td>
</tr>
<tr><td colspan = "2">
</td> </tr>
<tr><td colspan = "2"> <asp:Panel ID="pnlInnerGrid" runat="server">
<asp:GridView ID="GridViewBlocksInner" runat="server">
</asp:GridView>
</asp:Panel></td></tr>
</SelectedItemTemplate>
</asp:ListView>
'Code Behind:
Protected Sub ListViewBuildings_SelectedIndexChanging(ByVal sender As Object, ByVal e As ListViewSelectEventArgs)
'FindControl for linkbutton Works
Dim item As ListViewItem = CType(ListViewBuildings.Items(e.NewSelectedIndex), ListViewItem)
Dim l As LinkButton = CType(item.FindControl("BuildingLabel"), LinkButton)
'FindControl for gridview Does Not Work
Dim gitem As ListViewItem = CType(ListViewBuildings.Items(e.NewSelectedIndex), ListViewItem)
Dim gv As GridView = CType(item.FindControl("GridViewBlocksInner"), GridView)
Try
dsBlocks = SqlHelper.ExecuteDataset( _
DBConnectionString, CommandType.StoredProcedure, _
"procName", New SqlParameter("@Site", strSite))
'Next line gives Error:
gv.DataSource = dsBlocks
gv.DataBind()
Catch ex As Exception
lblMessage.Text = lblMessage.Text & " Error: " + ex.ToString
End Try

View 6 Replies

C# - List View And Inside Listview Like Nested

Feb 24, 2011

i have list view and inside lisetview i have another list vie like nested listview
lv1 --> lv2 and inside lv2 i have button when i'll click buttion than insert template show but how can fine control lv2 ....? there is my code Lv1 is working but lv2 is creating problem..?

protected void lv1_ItemCommand(object sender, ListViewCommandEventArgs e)
{
if (e.CommandName == "NewRecord")
{
lv1.InsertItemPosition = InsertItemPosition.FirstItem;
}
}
protected void lv2_ItemCommand(object sender, ListViewCommandEventArgs e)
{
if (e.CommandName == "NewRecord")
{
//ListView lv2 = (ListView)e.Item.FindControl("lv2");
//lv2.InsertItemPosition = InsertItemPosition.FirstItem;
}
}

View 2 Replies

Using Nested Query To Display Document List?

Apr 28, 2010

I using the two tables below to create a list of category titles containing document links so it looks like this:

documentCategoryName
documenttitle
documenttitle
documentCategoryName
documenttitle
documenttitle

Here are my tables:

documents table
documentID int Unchecked
documentName nvarchar(MAX) Checked
documentCat int Checked
documentDescription ntext Checked
documentType nvarchar(MAX) Checked
documentSiteID int Checked
Document category
documentCategoryId int Unchecked
documentCategoryName nvarchar(MAX) Checked

To do this I'm using a nested query which involves alot of code.

all my page code is below:

[Code]....

View 2 Replies

Forms Data Controls :: Nested Listview Inner List Not Displaying?

Jan 10, 2011

I have two listviews. The inner listview (InnerListView1) is in the SelecttItemTemplate of the outer listview (OuterListView1). Both listviews are bind in the code behind. The outer listview displays correctly in the ItemTemplate. Neither Listview Listview displays in the SelectItemTemplate. Both should display when I click the Select button. I just get a postback (flicker). The display should include the selected record of the outer listview and the inner listview.

Shown be low are code snipets of the.

Markup:
<asp:ListView ID="OuterListView1" DataKeyNames="entryid" runat="server" EnableViewState="False" EnableModelValidation="True" InsertItemPosition="LastItem" OnItemDataBound="OuterListView1_ItemDataBound" OnSelectedIndexChanging="OuterListView1_OnSelectedIndexChanging"
>

[Code]....

View 5 Replies

Forms Data Controls :: List Box Nested In Listview Control Selection

Jul 5, 2010

I have a list box in a list view control. I want to access the value of the listbox. I have fixed the height of the list box and the box has scroll bars. If i change the number using the scrollbar and then click on the number (turning it blue) everthing works fine. If I simply change the number using the scrollbar the system throws the error below. Can anyone tell me how to get this to work simply by using the scrollbar to select the number (without having to also click on the number itself) This is the error that is thrown

[FormatException: ??????????????????]
Microsoft.VisualBasic.CompilerServices.Conversions.ParseDouble(String Value, NumberFormatInfo NumberFormat)
+201
Microsoft.VisualBasic.CompilerServices.Conversions.ToInteger(String Value) +66
[InvalidCastException: String "" ??? 'Integer' ??????????]
This is the aspx listbox
<td><asp:label id="Label1" runat="server" text='<%# eval("CustomerID") %>'></asp:label></td>
<td><asp:label id="label2" runat="server" text='<%# eval("ProductID") %>'></asp:label></td>
<td>
<asp:ListBox ID="ListBox1" runat="server" Height="30px">
<asp:ListItem Value="0">0</asp:ListItem>
<asp:ListItem Value="1">1</asp:ListItem>
<asp:ListItem Value="2">2</asp:ListItem>
<asp:ListItem Value="3">3</asp:ListItem>
</asp:ListBox>
</td>
<td>$<asp:label id="label4" runat="server" text='<%# eval("OrderDate") %>'></asp:label></td>
<td>
<asp:Button ID="Button1" runat="server" Text="order" CommandName="cart"
CommandArgument='<%# eval("CustomerID")%>'/></td>
This is the vb page
Partial Class Droplist
Inherits System.Web.UI.Page
Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
Dim db As New DataClassesDataContext
ListView1.DataSource = db.Droplist1
ListView1.DataBind()
End If
End Sub
Sub upload(ByVal sender As Object, ByVal e As ListViewCommandEventArgs)
If e.CommandName = "cart" Then
Dim q As ListBox = e.Item.FindControl("Listbox1")
Dim ProductNumber As Integer = CType(q.SelectedValue, Integer)
Label3.Text = ProductNumber
End If
End Sub
End Class

View 4 Replies

Data Controls :: Filter Data Using Multiple CheckBoxes From CheckBox List In GridView

Nov 11, 2013

How to Filter Data/row from Repeater control in C.#Repeater control :---------------------All (15)shoes (3)shirts (12).Actually  on click i want to filter data/row (posts)  from Repeater control. Example: if i click on shoes 3 posts should display only but by default all 15 posts should display. 

<asp:HyperLink ID="HyperLink2" runat="server" NavigateUrl='<%#DataBinder.Eval(Container,"DataItem.id", "./Default.aspx?id={0}")%>'> <%#DataBinder.Eval(Container,"DataItem.Category")%></asp:HyperLink>

View 1 Replies

Forms Data Controls :: Binding A Gridview Nested List Control Based On Field Value?

Dec 10, 2010

I need to bind a List control based on the Gridview Row's datakeyName value while the Gridview control is being loaded into the page. I tried the following but it does not work.The BulletedList control is nested inside a Gridview Control and they both bound to an ObjectDataSource control. In my code, I passed teh UserID into the UserID parameter and call the Select() method but still does not work. Basically, I want to list of a user's hobbies, therefore the hobbies control are driven by the userID. tell me how can I get it to work?

protected void UserGridView_RowDataBound(object sender, GridViewRowEventArgs e)
{
int UserID;

[code]...

View 1 Replies

Forms Data Controls :: Nested Repeater: Rewrites Ending Category List To All Categories

Feb 11, 2011

Nested Repeater Issue: Each category list gets populated with the same set of date values rather then being populated with the data associated with that category. Trying to Do: Trying to group FAQ's by category and then list them using the repeaters.

The data is queryed though a business logic layer object that makes a call to the data access layer object. The data access layer object uses linq to sql to return data. There are 3 parameters that are passed into the innerDataSource's ObjectDataSource control to populate the nested repeater control (propID, CatID, isVisible).

With the debugger, the correct data is being returned and written to the nested repeater firing from the nested repeater's ItemDataBound event. Once this event is finished, another event fires and runs the FAQRule object again on the business logic layer which re-populates the nested repeater with the same data for each category. I have 2 repeaters, outerRepater (parent) and innerRepeater(child) with 2 ObjectDataSource controls innerDataSource and outerDataSource. See code below : ASP Page:

<asp:Repeater DataSourceID="outterDataSource" EnableViewState="false" runat="server">
<ItemTemplate>
<%# Eval("Description") &#43; " " &#43; this.Property.PropertyName %>
<asp:Repeater EnableViewState="false" runat="server" DataSourceID="innerDataSource">
<HeaderTemplate>
<ul style="width: 500px">
</HeaderTemplate>
<ItemTemplate>
<div><%# Eval("Question") %></div>
<div><p><%# Eval("Answer") %></p></div>
</ItemTemplate>
<FooterTemplate>
</ul>
</FooterTemplate>
</asp:Repeater>
<asp:ObjectDataSource ID="innerDataSource"
runat="server"
SelectMethod="FetchFAQSByPrpAndCatID"
TypeName="PropertySite.BusinessRules.FAQRules">
<SelectParameters>......................................

View 3 Replies

C# - Getting The Values From A Grouped Row Using LINQ?

Dec 17, 2010

I have the following class:

public class MySeat
{
public string Section { get; set; }
public string Row { get; set; }
public string Seat {get; set; }
}

I want to group a list of seats by the Section and Row so that I can make a comma seperated list of the seats.

var groupedSeats = seats.GroupBy(x => new { x.Section, x.Row });
foreach (var group in groupedSeats)
{
htmlWriter.Write(group.Key.Section);
List<string> seatNumbers = new List<string>();
foreach (var seat in group)
seatNumbers.Add(seat.Seat);
htmlWriter.Write(string.Join(@", ", seatNumbers.ToArray()));
}

Is there a better way to do this with LINQ? This is just a small portion of the code I'm trying to clean up, I'm curious if there is a better way to grab the seat numbers for display rather than creating a list, looping through the groups and then doing a string.Join on it.

View 2 Replies

MVC - Passing Grouped Data Into A View?

Jan 7, 2010

I've got a LINQ to SQL object, and I want to group the selected data and then pass it into a view. What's the correct way of doing this? I'm sure I need to group the data when I select it rather than grouping it in the view, as this will result in about 200 rather 50000 rows I need to pass into my view. Are there any good examples of this online that anyone has seen?

View 1 Replies

Web Forms :: How To Get Values From Radio Button Which Are Grouped Together

Feb 8, 2010

I Have few radio buttons which are grouped together, and i want to reterive their values.But i am not sure how can i do that.

View 2 Replies

Forms Data Controls :: How To Create Grouped Checkedlistbox

Oct 3, 2010

I need to create a grouped checklistbox dynamically from the database, I was able to do it using an TreeView Control, But I need to move it to a Checklistbox. Below is the logic in VB.NET for the TreeView

#Region "Generate Tree View"

View 2 Replies

C# - Show Items From Db Grouped By Manufacturer With Group Heading?

Feb 16, 2011

I have a number of products in a SQL2005 DB. I have the Stored Procedure set-up to return the info as grouped rows containing 'manufacturer, model, quantitiy'.

I need to then display this content on a c# Asp.Net 4 web form grouped by manufacturer with the manufacturer as the group header. The whole data should be displayed over a 3 column layout.

So, Ive used a Datalist as this allows for the number of columns to be stipulated.

However, I can't work out an effective way to show the various products groupd by manufacturer, eg as shown below;

Toshiba
3401
3685
3699

[Code]....

View 1 Replies

Telerik RadGrid Doesn't Seem To Export Grouped Data?

Jan 5, 2011

I've got a DNN application using Telerik RadGrid. We're exporting some data from the Grid but when we drill down on the grid control and export the data we only see the initial top level data, never the updated Grid. Here's my table tag and supporting code. I'm not an expert in ASPX/C#so please forgive my newbie-ness.

<mastertableview autogeneratecolumns="False" datakeynames="AccountId" datasourceid="SqlDataSource1"
groupsdefaultexpanded="False">
<DetailTables>

[code]...

View 1 Replies

Data Controls :: Make Use Of Grouped RadioButtons In GridView

Apr 13, 2013

I want to add 2 radio buttons in a gridview for 2 columns. In that I have to select any row in each column... How to implement this... Actually I ve added gridview and radiobuttons but the thing is I couldn't select 2 columns in a single row ,it wont allow to select 2 radiobuttons at a time... 

View 1 Replies







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