Adding check list box inside master detail web grid

Discussion in 'ASP .Net Web Controls' started by PatLaf, Feb 9, 2004.

  1. PatLaf

    PatLaf Guest

    Hello all
    I have nested a datagrid within a datagrid to display detail records. It kinda works but what I need to do is draw out a check list box I think as this is a dataentry application and I may need to trap what is selected and I need to do that by row. As I think when the user presses the submit button I will need to iterate through the grid, determine if the user selected details and if they did collect that information. Does anyone know how to do this? I am copying the code I have so far that seems to work except when the user clicks on the details button I get a datagrid displayed that shows two columns, row error and Has errors. With the latter column all set to false.......please forgive any ignorance as I am new to asp.net and vb.ne

    vb cod
    Private Sub dgDefects_ItemCommand(ByVal source As System.Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs) Handles dgDefects.ItemComman

    Dim iValue As Intege

    iValue = Integer.Parse(CType(e.Item.Controls(5), TableCell).Text
    'handle defects on dgDefects Gri
    If e.CommandName = "Increase" The
    CType(e.Item.Controls(5), TableCell).Text = (iValue + 1).ToString(
    ElseIf e.CommandName = "Decrease" The
    If Not CType(e.Item.Controls(5), TableCell).Text <= "0" The
    CType(e.Item.Controls(5), TableCell).Text = (iValue - 1).ToString(
    End I
    End I

    If CType(e.CommandSource, Button).Text = "Show Details" The
    dgDefects.Columns(7).Visible = Tru
    Dim dgi As DataGridItem = CType(e.Item, DataGridItem
    Dim c As Contro
    For Each c In dgi.Cells(7).Control
    c.Visible = Tru
    Nex
    CType(e.CommandSource, Button).Text = "Hide Details
    ElseIf CType(e.CommandSource, Button).Text = "Hide Details" The
    dgDefects.Columns(7).Visible = Fals
    Dim dgi As DataGridItem = CType(e.Item, DataGridItem
    Dim c As Contro
    For Each c In dgi.Cells(7).Control
    c.Visible = Fals
    Nex
    CType(e.CommandSource, Button).Text = "Show Details
    End I

    End Sub 'dgDefects_ItemCommand

    Private Sub dgDefects_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs) Handles dgDefects.ItemDataBoun
    Dim dgi As DataGridItem = e.Ite
    If dgi.ItemType = ListItemType.Item Or dgi.ItemType = ListItemType.AlternatingItem The
    Dim c As Contro
    For Each c In dgi.Cells(7).Control
    If TypeOf (c) Is System.Web.UI.WebControls.DataGrid The
    Dim id As Int32 = Int32.Parse(dgi.Cells(0).Text
    Dim dg As DataGrid = CType(c, DataGrid
    Dim dr As DataRow(
    dr = m_dsDefects.Tables("Defect_Details").Select("Defect_ID=" & id
    If dr.Length > 0 The
    dg.DataSource = d
    dg.DataBind(
    Els
    Dim dt As DataTable = New DataTabl
    Dim dr2 As DataRo
    Dim dtCol As DataColumn = New DataColum
    With dtCo
    .ColumnName = "Detail Disposition
    .DataType = System.Type.GetType("System.String"
    .DefaultValue = "NO DETAILS
    End Wit
    dt.Columns.Add(dtCol
    ' Add one row. Since it has default values, no need to set values
    dr2 = dt.NewRo
    dt.Rows.Add(dr2
    dg.DataSource = d
    dg.DataBind(
    End I
    End I
    Nex
    End I
    End Su

    htm
    <form id="Form1" method="post" runat="server"><asp:label id="lblError" style="Z-INDEX: 101; LEFT: 24px; POSITION: absolute; TOP: 528px" runat="server
    Visible="False" Width="256px" Height="64px">Label</asp:label><asp:Button id="btnSaveAuditInfo" style="Z-INDEX: 125; LEFT: 632px; POSITION: absolute; TOP: 488px
    runat="server" Width="98px" Text="Complete Audit"></asp:Button><asp:Label id="lblAuditorId" style="Z-INDEX: 124; LEFT: 776px; POSITION: absolute; TOP: 24px"
    runat="server" Visible="False" Enabled="False"></asp:Label><asp:textbox id="txtLotNum" style="Z-INDEX: 123; LEFT: 776px; POSITION: absolute; TOP: 136px"
    runat="server" Width="184px" ForeColor="Black" BackColor="#E0E0E0"></asp:textbox><asp:textbox id="txtAuditType" style="Z-INDEX: 122; LEFT: 776px; POSITION: absolute; TOP: 80px"
    runat="server" Width="184px" ForeColor="Black" BackColor="#E0E0E0"></asp:textbox><asp:textbox id="txtAuditor" style="Z-INDEX: 121; LEFT: 776px; POSITION: absolute; TOP: 192px"
    runat="server" Width="184px" ForeColor="Black" BackColor="#E0E0E0"></asp:textbox><asp:label id="lblLotNumber" style="Z-INDEX: 120; LEFT: 776px; POSITION: absolute; TOP: 112px"
    runat="server" Height="24px" Width="80px" ForeColor="White">Lot Number</asp:label><asp:label id="lblSampleSize" style="Z-INDEX: 119; LEFT: 776px; POSITION: absolute; TOP: 368px"
    runat="server" Height="16px" Width="96px" ForeColor="White">Sample Size</asp:label><asp:textbox id="txtSampleSize" style="Z-INDEX: 116; LEFT: 776px; POSITION: absolute; TOP: 392px"
    runat="server" Width="184px" ForeColor="Black" BackColor="#E0E0E0"></asp:textbox><asp:label id="lblMisPackAql" style="Z-INDEX: 118; LEFT: 776px; POSITION: absolute; TOP: 464px"
    runat="server" Height="16px" Width="96px" ForeColor="White">MisPack AQL</asp:label><asp:textbox id="txtMisPackAQL" style="Z-INDEX: 117; LEFT: 776px; POSITION: absolute; TOP: 488px"
    runat="server" Width="184px" ForeColor="Black" BackColor="#E0E0E0"></asp:textbox><asp:textbox id="txtCosAql" style="Z-INDEX: 115; LEFT: 776px; POSITION: absolute; TOP: 440px"
    runat="server" Width="184px" ForeColor="Black" BackColor="#E0E0E0"></asp:textbox><asp:label id="lblAuditSize" style="Z-INDEX: 114; LEFT: 776px; POSITION: absolute; TOP: 56px"
    runat="server" Height="16px" Width="72px" ForeColor="White">Audit Type</asp:label><asp:label id="lblMfg" style="Z-INDEX: 113; LEFT: 776px; POSITION: absolute; TOP: 320px" runat="server"
    Height="16px" Width="40px" ForeColor="White">Supplier</asp:label><asp:textbox id="txtMfg" style="Z-INDEX: 110; LEFT: 776px; POSITION: absolute; TOP: 344px" runat="server"
    Width="184px" ForeColor="Black" BackColor="#E0E0E0"></asp:textbox><asp:label id="lblPrdType" style="Z-INDEX: 112; LEFT: 776px; POSITION: absolute; TOP: 272px"
    runat="server" Height="16px" Width="96px" ForeColor="White">Product Type</asp:label><asp:textbox id="txtPrdType" style="Z-INDEX: 109; LEFT: 776px; POSITION: absolute; TOP: 296px"
    runat="server" Width="184px" ForeColor="Black" BackColor="#E0E0E0"></asp:textbox><asp:label id="lblLotSize" style="Z-INDEX: 111; LEFT: 776px; POSITION: absolute; TOP: 224px"
    runat="server" Height="16px" Width="64px" ForeColor="White">Lot Size</asp:label><asp:textbox id="txtLotSize" style="Z-INDEX: 108; LEFT: 776px; POSITION: absolute; TOP: 248px"
    runat="server" Width="184px" ForeColor="Black" BackColor="#E0E0E0"></asp:textbox><asp:label id="lblCosmeticAql" style="Z-INDEX: 107; LEFT: 776px; POSITION: absolute; TOP: 416px"
    runat="server" Height="16px" Width="96px" ForeColor="White">Cosmetic AQL</asp:label><asp:label id="lblAuditors" style="Z-INDEX: 106; LEFT: 776px; POSITION: absolute; TOP: 168px"
    runat="server" Height="24px" Width="56px" ForeColor="White">Auditor</asp:label><asp:label id="lblCosDefects" style="Z-INDEX: 104; LEFT: 16px; POSITION: absolute; TOP: 80px"
    runat="server" Width="152px" Height="16px" Font-Size="Larger" ForeColor="White">Cosmetic Defects</asp:label><asp:label id="lblAudit" style="Z-INDEX: 103; LEFT: 392px; POSITION: absolute; TOP: 80px" runat="server"
    Width="152px" Height="16px" Font-Size="Larger" ForeColor="White">TOI Auditors Center</asp:label><asp:image id="Image1" style="Z-INDEX: 102; LEFT: 336px; POSITION: absolute; TOP: 8px" runat="server"
    Width="264px" Height="72px" ImageUrl="file:///C:\Inetpub\wwwroot\TOIAUDIT\Images\transitions-logo.gif"></asp:image>&nbsp;
    <DIV style="OVERFLOW-Y: scroll; Z-INDEX: 105; LEFT: 16px; WIDTH: 525px; POSITION: absolute; TOP: 104px; HEIGHT: 360px"><asp:datagrid id="dgDefects" runat="server" Width="400px" Height="200px" CellPadding="3" BackColor="White"
    BorderWidth="2px" BorderStyle="Ridge" BorderColor="White" AutoGenerateColumns="False" CellSpacing="1" GridLines="None"><SelectedItemStyle Font-Bold="True" ForeColor="White" BackColor="#9471DE"></SelectedItemStyle><ItemStyle ForeColor="Black" BackColor="#DEDFDE"></ItemStyle><HeaderStyle Font-Bold="True" ForeColor="#E7E7FF" BackColor="#4A3C8C"></HeaderStyle><FooterStyle ForeColor="Black" BackColor="#C6C3C6"></FooterStyle><Columns><asp:BoundColumn Visible="False" DataField="Defect_ID" HeaderText="ID"></asp:BoundColumn><asp:ButtonColumn Text="Increase" ButtonType="PushButton" HeaderText="Add One" CommandName="Increase"></asp:ButtonColumn><asp:ButtonColumn Text="Decrease" ButtonType="PushButton" HeaderText="Subtract One" CommandName="Decrease"></asp:ButtonColumn><asp:BoundColumn DataField="Defect" HeaderText="Defect Description"></asp:BoundColumn><asp:BoundColumn DataField="Defect_Acronym" HeaderText="Defect Acronym"></asp:BoundColumn><asp:BoundColumn DataField="Defect_NumDefects" HeaderText="Number Found"></asp:BoundColumn><asp:ButtonColumn Text="Show Details" ButtonType="PushButton" HeaderText="Details">
     
    PatLaf, Feb 9, 2004
    #1
    1. Advertising

  2. Hi Pat,

    Thank you for posting in the community!

    I will continue assist you on your further issue in this post :)

    ================================================
    I have reviewd your post, there are some points I do not fully understand.
    Please clarify them for me.

    In your "what I need to do is draw out a check list box", what does your
    "check list box" mean?

    Based on your description, I see you want to use checkbox control to trap
    the selection state of the row. I think you may add a template column to
    your Master datagrid. Like this:
    <asp:TemplateColumn>
    <ItemTemplate>
    <asp:CheckBox ID="trapselection" Runat="server"></asp:CheckBox>
    </ItemTemplate>
    </asp:TemplateColumn>

    Then, in the "submit" button's click event, you can iterate through the
    grid, and collect the selection information, like this:
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
    System.EventArgs) Handles Button1.Click
    Dim dgi As DataGridItem
    For Each dgi In Master.Items
    Dim tc As TableCell = dgi.Cells(0)

    Dim c As Control
    For Each c In tc.Controls
    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
    Next
    End Sub

    For your second question, I am not fully understand what "With the latter
    column all set to false" means, is this the issue?

    Also, in the html code you pasted, I can not see the 7th column, which is
    the "details" datagrid, without this column's html code, I can not figure
    out the cause.

    Hope my reply makes sense to you.
    I will wait for your further feedback.

    =============================================
    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.
    Have a nice day!!

    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.
     
    Jeffrey Tan[MSFT], Feb 10, 2004
    #2
    1. Advertising

  3. Attn Jeff Tan?

    I'm sorry I posted the wrong HTML code. Here is the correct code...


    <DIV style="OVERFLOW-Y: scroll; Z-INDEX: 105; LEFT: 16px; WIDTH: 525px;
    POSITION: absolute; TOP: 104px; HEIGHT: 360px"><asp:datagrid
    id="dgDefects" runat="server" Width="400px" Height="200px"
    CellPadding="3" BackColor="White"
    BorderWidth="2px" BorderStyle="Ridge" BorderColor="White"
    AutoGenerateColumns="False" CellSpacing="1" GridLines="None">
    <SelectedItemStyle Font-Bold="True" ForeColor="White"
    BackColor="#9471DE"></SelectedItemStyle>
    <ItemStyle ForeColor="Black" BackColor="#DEDFDE"></ItemStyle>
    <HeaderStyle Font-Bold="True" ForeColor="#E7E7FF"
    BackColor="#4A3C8C"></HeaderStyle>
    <FooterStyle ForeColor="Black" BackColor="#C6C3C6"></FooterStyle>
    <Columns>
    <asp:BoundColumn Visible="False" DataField="Defect_ID"
    HeaderText="ID"></asp:BoundColumn>
    <asp:ButtonColumn Text="Increase" ButtonType="PushButton"
    HeaderText="Add One" CommandName="Increase"></asp:ButtonColumn>
    <asp:ButtonColumn Text="Decrease" ButtonType="PushButton"
    HeaderText="Subtract One" CommandName="Decrease"></asp:ButtonColumn>
    <asp:BoundColumn DataField="Defect" HeaderText="Defect
    Description"></asp:BoundColumn>
    <asp:BoundColumn DataField="Defect_Acronym" HeaderText="Defect
    Acronym"></asp:BoundColumn>
    <asp:BoundColumn DataField="Defect_NumDefects" HeaderText="Number
    Found"></asp:BoundColumn>
    <asp:ButtonColumn Text="Show Details" ButtonType="PushButton"
    HeaderText="Details"></asp:ButtonColumn>
    <asp:TemplateColumn visible="false" HeaderText="Defect Details">
    <itemtemplate>
    <asp:DataGrid Runat="server" ID="Details"
    visible="false"></asp:DataGrid>
    </itemtemplate>
    </asp:TemplateColumn>
    </Columns>
    <PagerStyle HorizontalAlign="Right" ForeColor="Black"
    BackColor="#C6C3C6"></PagerStyle>
    </asp:datagrid></DIV>


    Now as for the other problem with the details datagrid. I used the
    example that you gave me for displaying master/details. In your example
    you encapsulate a datagrid within a datagrid and bind the encapsulated
    datagrid to the details records. When I click the button the details
    part of the grid is drawn but instead of one column of records I get
    two. The first column is titled Row Errors and the second column is
    titled Has Errors. The amount of rows that display in the details grid
    match the amount of details that need to be displayed yet the details
    are not displayed. The first column is blank the second column has the
    word false displayed for all the rows. I hope this helps clarify the
    issue.

    I also asked about the checklist as I want to display the details in a
    checklist box so that I can trap the details the users select. I will
    try to implement the code sample that you provided and I will report my
    results. Once again your help has proved to be invaluable to me.



    Thanks in advance,
    PatLaf


    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
     
    Patrick Laferriere, Feb 10, 2004
    #3
  4. Hi Patrick,

    Thanks very much for your feedback.

    ======================================================
    From your further html code, I see you use your "details" datagrid in
    TemplateColumn(Just as I do).
    Also, from your first paragraph's description, I understand your issue:
    When you click the "Show Details" button, your "details" datagrid displays,
    but it does not show well.

    Based on your statement " but instead of one column of records I get two.",
    I think your "details" datagrid should only display 1 column. But it shows
    2 columns:
    The first column with title "Row Errors" and empty cell content, while the
    second's title "Has Errors" with the cell content "false".

    In your code behind, I can not find anything incorrect, and the code
    provides me nothing about the datasouce of the "details" datagrid. Anyway,
    I think the key point is the "dgDefects_ItemDataBound" method, you should
    check if your "details" datagrid is bound well. You may set a breakpoint at:
    dr = m_dsDefects.Tables("Defect_Details").Select("Defect_ID=" & id)
    to determine if the DataRow array "dr" contains what you wanted to show.

    Because your dgDefects_ItemCommand method only enable the visibility of
    your datagrid, if your "details" datagrid is bound correctly, your datagrid
    should show well.

    From your second paragraph, I found that you want to add the checkbox
    column to the "details" datagrid not the "Master" datagrid. My sample code
    in last project shows you how to add the datagrid column to your "Master"
    datagrid, I think you should do the same to you "details" datagrid(The html
    code is the same)

    ======================================================
    Please apply my suggestion to see if it resolved your problem.

    If you still have anything unclear, please feel free to tell me, I will
    help you.

    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.
     
    Jeffrey Tan[MSFT], Feb 11, 2004
    #4
  5. I believe that the problem is that the select statement is returning an
    array of datarows. Not just one record. I read that we can't bind a
    datarow() to a datagrid. Is that because it isn't just one row and it's
    an array?

    Thanks in advance,
    PatLaf


    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
     
    Patrick Laferriere, Feb 11, 2004
    #5
  6. Jeff,
    I just got thru reading that I can't bind a datarow() to the datagrid.
    The datagrid that is encapsulated in the details column displays fine
    and has the correct amount of rows to show the details information but
    it doesn't display the information contained in the dr array. I can
    iterate through the dr array and see the information but can't get it to
    simply bind. Should I copy the dr() array to a datatable and then bind
    it?

    Thanks in advance,
    PatLaf


    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
     
    Patrick Laferriere, Feb 11, 2004
    #6
  7. Jeff, I got the details to display. I couldn't databind to the rows
    array like I stated before but if I clone it to a datatable it displays
    as expected. Now if I could just get the checkboxlist to show next to my
    details......


    Thanks in advance,
    PatLaf


    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
     
    Patrick Laferriere, Feb 11, 2004
    #7
  8. PatLaf

    PatLaf Guest

    Jeff
    Hello again. I have been swamped with our bonus system at work and I haven't had time to go back and finish this till now. I have read the knowledgebase article 323261 on how to read the values of the nested controls inside the datagrid but I can't get it to work correctly. I am posting the code with the hope that you can figure out what might be wrong. Here's the snippet ..
    Private Sub dgDefects_ItemCommand(ByVal source As System.Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs) Handles dgDefects.ItemComman

    Dim iValue As Intege

    iValue = Integer.Parse(CType(e.Item.Controls(5), TableCell).Text
    'handle defects on dgDefects Gri
    If e.CommandName = "Increase" The
    CType(e.Item.Controls(5), TableCell).Text = (iValue + 1).ToString(
    ElseIf e.CommandName = "Decrease" The
    If Not CType(e.Item.Controls(5), TableCell).Text <= "0" The
    CType(e.Item.Controls(5), TableCell).Text = (iValue - 1).ToString(
    End I
    End I

    Dim dgi As DataGridItem = CType(e.Item, DataGridItem
    If CType(e.CommandSource, Button).Text = "Show Details" The
    dgDefects.Columns(7).Visible = Tru
    Dim c As Contro
    For Each c In dgi.Cells(7).Control
    c.Visible = Tru
    Nex
    Me.VisibleDataGrid = Me.VisibleDataGrid +
    CType(e.CommandSource, Button).Text = "Hide Details
    ElseIf CType(e.CommandSource, Button).Text = "Hide Details" The
    If Me.VisibleDataGrid <= 1 The
    dgDefects.Columns(7).Visible = Fals
    End I
    Dim c As Contro
    For Each c In dgi.Cells(7).Control
    c.Visible = Fals
    Nex
    Me.VisibleDataGrid = Me.VisibleDataGrid -
    CType(e.CommandSource, Button).Text = "Show Details
    End I

    'collect any selected checkbox items from the details gri

    For Each dgi In dgDefects.Item
    Dim tc As TableCell = dgi.Cells(7
    Dim c As Contro
    For Each c In tc.Control
    Dim Discon As Boolean = CType(e.Item.FindControl("dgDetails"), CheckBox).Checke
    If TypeOf (c) Is System.Web.UI.WebControls.CheckBox The
    Dim cb As CheckBox = CType(c, CheckBox
    If cb.Checked = True The
    Me.Response.Write("The " & dgi.ItemIndex.ToString() & "th row is selected<br>"
    End I
    End I
    Next
    Next dg

    End Sub 'dgDefects_ItemCommand

    I get the controls collection yet none of them are check boxes. What should I do? I am once again confused.

    Thank again in advance,
    I really appreciate the help

    Regards
    Patrick Laferriere
     
    PatLaf, Feb 19, 2004
    #8
  9. PatLaf

    PatLaf Guest

    Jeff
    One other thing to consider is that I couldn't get the typed dataset to work correctly. What happened is the rowerror haserrors returned. So I guess in essence what I need to do is grab the checkboxes from the nested datagrid in the itemtemplate column of the master datagrid. Did that make sense

    Thanks again
    Pat
     
    PatLaf, Feb 19, 2004
    #9
  10. Hi Pat,

    I have received your positive feedback, thanks very much :)

    For your 2 further concern, I will do some research on it, and I will reply
    to you ASAP.

    Also, as you said, the Typed DataSet does not work for you? Have you
    received my project and tested it at your side? It only needs the default
    database of SqlServer, and it works well on my side.

    Thanks for your cooperation.

    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.
     
    Jeffrey Tan[MSFT], Feb 20, 2004
    #10
  11. 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.
     
    Jeffrey Tan[MSFT], Feb 21, 2004
    #11
  12. PatLaf

    PatLaf Guest

    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
     
    PatLaf, Feb 24, 2004
    #12
  13. 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.
     
    Jeffrey Tan[MSFT], Feb 26, 2004
    #13
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. mit
    Replies:
    1
    Views:
    817
    Ramu Pulipati
    Jan 25, 2006
  2. ruca

    Master / Detail Grid

    ruca, Apr 1, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    3,962
  3. asmj
    Replies:
    0
    Views:
    511
  4. Arun Kumar Menon

    Master Detail detail

    Arun Kumar Menon, Aug 6, 2003, in forum: ASP .Net Datagrid Control
    Replies:
    0
    Views:
    205
    Arun Kumar Menon
    Aug 6, 2003
  5. Frederik Borg

    ASp.net data binding: Master-detail-detail

    Frederik Borg, Jun 9, 2006, in forum: ASP .Net Datagrid Control
    Replies:
    0
    Views:
    365
    Frederik Borg
    Jun 9, 2006
Loading...

Share This Page