update radgrid with radiobuttons

2 posts, 0 answers
  1. David Gunderson
    David Gunderson avatar
    13 posts
    Member since:
    Apr 2010

    Posted 01 Apr 2011 Link to this post

    What I have is a grid that I am loading questions with a asp radiobutton with a go or a no\go.  I have a set of questions and then some question might have sub questions that i load into the grid.  a nested radgrid with the main question and sub questions.  What I need to happen if a sub question radio button is picked as a no\go I need the main question button to automatically be changed to a no\go as well.  Is this possible with a nested grid.  Here is an example of my radgrid.  I also need to save all of them to a table with the question answer on a asp submit button, how do you itterate through the main and then sub tables to save the information.


    <table width="100%">
                    <tr>
                        <td align="center"><telerik:RadGrid ID="RadGrid2" runat="server" CellSpacing="0" GridLines="both" Skin="WebBlue" Width="90%" GroupingSettings-ShowUnGroupButton="false"  >
                            <MasterTableView AutoGenerateColumns="false" DataKeyNames="intQuestionID">
                                <Columns>
                                    <telerik:GridBoundColumn DataField="strQuestion" HeaderText="Question" UniqueName="strQuestion" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Left" />
                                    <telerik:GridTemplateColumn HeaderText="GO\NOGO" HeaderStyle-HorizontalAlign="Center" ShowSortIcon="True" Visible="True">
                                        <ItemTemplate>
                                            <asp:RadioButtonList ID="rblAnswer" runat="server" RepeatDirection="Horizontal" TextAlign="Right" CellPadding="5" >
                                                <asp:ListItem Value="0">GO</asp:ListItem>
                                                <asp:ListItem Value="1">NO\GO</asp:ListItem>
                                            </asp:RadioButtonList>
                                        </ItemTemplate>
                                    </telerik:GridTemplateColumn>
                                    <telerik:GridTemplateColumn HeaderText="Data" HeaderStyle-HorizontalAlign="Center">
                                        <ItemTemplate>
                                            <telerik:RadTextBox runat="server" Width="100"></telerik:RadTextBox>
                                        </ItemTemplate>
                                    </telerik:GridTemplateColumn>
                                     <telerik:GridTemplateColumn HeaderText="Remarks" HeaderStyle-HorizontalAlign="Center">
                                        <ItemTemplate>
                                            <telerik:RadTextBox ID="txtRemarks" runat="server" Width="100"></telerik:RadTextBox>
                                        </ItemTemplate>
                                    </telerik:GridTemplateColumn>
                                    <telerik:GridTemplateColumn HeaderText="Date" HeaderStyle-HorizontalAlign="Center">
                                          <ItemTemplate>
                                            <telerik:RadDatePicker ID="radDate" runat="server"></telerik:RadDatePicker>
                                          </ItemTemplate>
                                    </telerik:GridTemplateColumn>
                                </Columns>
                                <DetailTables>
                                    <telerik:GridTableView Name="RadGrid2Sub" runat="server" DataKeyNames="intsubQID" TableLayout="Fixed" AutoGenerateColumns="false">
                                        <ParentTableRelation>
                                            <telerik:GridRelationFields DetailKeyField="intQuestionID" MasterKeyField="intQuestionID" />
                                        </ParentTableRelation>
                                        <Columns>
                                            <telerik:GridBoundColumn DataField="strSubQ" HeaderText="Sub-Question" UniqueName="strSubQ" HeaderStyle-HorizontalAlign="Center" />
                                             <telerik:GridTemplateColumn HeaderText="GO\NOGO" HeaderStyle-HorizontalAlign="Center" ShowSortIcon="True" Visible="True">
                                                <ItemTemplate>
                                                    <asp:RadioButtonList ID="rblAnswer2" runat="server" RepeatDirection="Horizontal" TextAlign="Right" CellPadding="5" >
                                                        <asp:ListItem Value="0">GO</asp:ListItem>
                                                        <asp:ListItem Value="1">NO\GO</asp:ListItem>
                                                    </asp:RadioButtonList>
                                                </ItemTemplate>
                                            </telerik:GridTemplateColumn>
                                        </Columns>
                                        </telerik:GridTableView>
                                </DetailTables>
                            </MasterTableView>
                        </telerik:RadGrid></td>
                    </tr>
                </table>
  2. Marin
    Admin
    Marin avatar
    1043 posts

    Posted 07 Apr 2011 Link to this post

    Hello David,

    Please refer to the following help article explaining how to iterate items in hierarchy. You can also access the parent row from the child item like that: item.OwnerTableView.ParentItem. Then you access the radiobutton in the cell as described here.

    Best wishes,
    Marin
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top