Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Adding check list box inside master detail web grid

Reply
Thread Tools

Adding check list box inside master detail web grid

 
 
Jeffrey Tan[MSFT]
Guest
Posts: n/a
 
      02-21-2004

Hi Patrick,

Sorry for letting you wait so long time.

I have reviewed your VB.net code, I think the problem code snippet should
be:
For Each dgi In dgDefects.Items
Dim tc As TableCell = dgi.Cells(7)
Dim c As Control
For Each c In tc.Controls
Dim Discon As Boolean = CType(e.Item.FindControl("dgDetails"),
CheckBox).Checked
If TypeOf (c) Is System.Web.UI.WebControls.CheckBox Then
Dim cb As CheckBox = CType(c, CheckBox)
If cb.Checked = True Then
Me.Response.Write("The " & dgi.ItemIndex.ToString() & "th
row is selected<br>")
End If
End If
Next c
Next dgi

In the code, I think "dgDetails" is the id of the details datagrid. But in
your code, you find this control and convert it into CheckBox, which is not
correct.

I think you should first find the details datagrid, then loop through all
the rows in the DETAILS datagrid and find the CheckBox. Like this(Note: I
did not compile this code at my side, so there may be some small error in
the code):

For Each dgi In dgDefects.Items
Dim tc As TableCell = dgi.Cells(7)
Dim c As Control
For Each c In tc.Controls
If TypeOf (c) Is System.Web.UI.WebControls.DataGrid Then
Dim dgdetails As DataGrid =
CType(e.Item.FindControl("dgDetails"), DataGrid)
Dim dgi as DataGridItem
For Each dgi in dgdetails Then
If(CType(dgi.FindControl("checkboxid"),
CheckBox).Checked = True)
Me.Response.Write("The " &
dgi.ItemIndex.ToString() & "th row is selected in Details DataGrid<br>")
End If
Next di
End If
Next c
Next dgi

Also, in your program logic in your code snippet, you hook into the MASTER
datagrid's ItemCommand event, then want to loop through the DETAILS
datagrid's each row and collect any selected checkbox items. I think this
is a strange logic, because the DETAILS datagrid may still be invisible,
but you continue loop through the invisible DETAILS datagrid.

Have you received my sample code project ?

In that project, I use an individual button, in which click event, I show
all the checked items in VISIBLE details datagrid.

================================================
Thank you for your patience and cooperation. If you have any questions or
concerns, please feel free to post it in the group. I am standing by to be
of assistance.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

 
Reply With Quote
 
 
 
 
PatLaf
Guest
Posts: n/a
 
      02-24-2004
Jeff
A couple of things. First...I can't follow the link you provided even when I make it one contiguous string in notepad then paste it into explorer. The second issue that I'm having is the event handler. Try as one might I can't get it to work. I saw the limitation you mentioned yesterday when I finally got the check box working because I get the response.write for all of the defects and I'm thinking that is because of the ambiguity in the namespace that you mentioned.

One of the other things that you mentioned is that there is a button in the details datagrid. There isn't one. The button is on the master and it shows and hides the details. I was going to use the buttons caption property in the master grid to determine when the user selected a detail for the report but I never fire the item_command for the details datagrid and I think that's because there isn't a button in that grid there is only the checkbox. Am I right ?

I am going to search google groups to look for your post manually.

Thanks yet again....
Pat
 
Reply With Quote
 
 
 
 
Jeffrey Tan[MSFT]
Guest
Posts: n/a
 
      02-26-2004

Hi Pat,

I have added a reply to another new post of you in this group. Please
follow up there, I will work with you there.

Thanks for your understanding.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ASp.net data binding: Master-detail-detail Frederik Borg ASP .Net Datagrid Control 0 06-09-2006 11:41 AM
how to selecet check box in the data grid ?? only one check box mit ASP .Net 1 01-25-2006 06:47 PM
Edit in Master-Detail Grid Ing. Rajesh Kumar ASP .Net 0 03-27-2005 05:12 PM
Master / Detail Grid ruca ASP .Net 2 04-01-2004 11:36 AM
Master Detail detail Arun Kumar Menon ASP .Net Datagrid Control 0 08-06-2003 08:04 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57