TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
angel 0
NA
1
0
Nested datagrids containing checkbox controls
Oct 18 2004 12:21 PM
Howdy! I am creating a server control that produces a nested datagrid. Each datagrid contains a checkbox column for row selection. Everything populates just fine and sorting works well, but I am having trouble getting a reference to the inner nested datagrid's checkboxes to see what has been selected. The child grids are bound on the ItemDataBound event of the parent grid. I want to get two arrays of datagriditems for both the parent and the child grids of the items that were checked by the user. I can do this with the parent grid, but the child grids are gone at postback. At postback for sorting, the child grids are there and everything is fine. What do I need to do to get a reference to the child grids at postback to see the selected items? Here is my code for the button that posts back to get the selected items: Public Sub OnAddToCart(ByVal sender As Object, ByVal e As EventArgs) Handles Linkbutton1.Click Dim ValArray As New ArrayList Dim dgi As DataGridItem For Each dgi In grid.SelectedItems 'get a reference to the child grid and get it's selected items Dim childgrid As Multigrid = dgi.Cells(1).Controls(1) If Not childgrid Is Nothing Then Dim childDgi As DataGridItem For Each childDgi In childgrid.SelectedItems ValArray.Add(childgrid.DataKeys(childDgi.ItemIndex.ToString())) Next End If Next 'Refresh the datagrid UpdateDataView() End Sub In this code, childgrid is always nothing. When I check the count of controls in cell(1), there's only 1 and it's a label. Any help is greatly appreciated! Barn Chick
Reply
Answers (
0
)
getting value of client side into server side
how to do automatic sms generation???