Hi there,
I am developing a Evaluation Control where Questions are listed and I need to get the following from the Grid to save as a 'Answer' to each of the Questions listed in the Grid:
~ The True/False Reply associated to a Question. [Basically which RadioButton is selected.]
~ Then also the Notes associated to a Question. [The Value from the TextBox.]
I am doing all my binding from the Code-behind. So I basically have to iterate through each bound row in the Grid and then persist the 'Answers' whan the Save Button is pressed.
Here is the Grid Markup:
Any help as to how best to achieve the above functionality will be much appreciated.
Thanks!
I am developing a Evaluation Control where Questions are listed and I need to get the following from the Grid to save as a 'Answer' to each of the Questions listed in the Grid:
~ The True/False Reply associated to a Question. [Basically which RadioButton is selected.]
~ Then also the Notes associated to a Question. [The Value from the TextBox.]
I am doing all my binding from the Code-behind. So I basically have to iterate through each bound row in the Grid and then persist the 'Answers' whan the Save Button is pressed.
Here is the Grid Markup:
| <telerik:RadGrid ID="radgridList" runat="server" AllowSorting="False" AutoGenerateColumns="False" |
| GridLines="none" OnNeedDataSource="radgridList_NeedDataSource"> |
| <MasterTableView Width="100%"> |
| <GroupByExpressions> |
| <telerik:GridGroupByExpression> |
| <SelectFields> |
| <telerik:GridGroupByField FieldAlias="Catergory" FieldName="Title"></telerik:GridGroupByField> |
| </SelectFields> |
| <GroupByFields> |
| <telerik:GridGroupByField FieldName="Title" SortOrder="Descending"></telerik:GridGroupByField> |
| </GroupByFields> |
| </telerik:GridGroupByExpression> |
| </GroupByExpressions> |
| <Columns> |
| <telerik:GridBoundColumn HeaderText="QuestionId" DataField="QuestionId" UniqueName="QuestionId" |
| Visible="False"> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn HeaderText="Body" DataField="Body" UniqueName="Body"> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn HeaderText="Weighting" DataField="Weighting" UniqueName="Weighting"> |
| </telerik:GridBoundColumn> |
| <telerik:GridTemplateColumn HeaderText="True" UniqueName="TrueSelection"> |
| <ItemTemplate> |
| <asp:RadioButton ID="rbTrue" runat="server" GroupName="Selection" /> |
| </ItemTemplate> |
| </telerik:GridTemplateColumn> |
| <telerik:GridTemplateColumn HeaderText="False" UniqueName="FalseSelection"> |
| <ItemTemplate> |
| <asp:RadioButton ID="rbFalse" runat="server" GroupName="Selection" Checked="True" /> |
| </ItemTemplate> |
| </telerik:GridTemplateColumn> |
| <telerik:GridTemplateColumn HeaderText="Notes" UniqueName="Notes"> |
| <ItemTemplate> |
| <telerik:RadTextBox ID="txtNotes" runat="server" Width="250px"> |
| </telerik:RadTextBox> |
| </ItemTemplate> |
| </telerik:GridTemplateColumn> |
| </Columns> |
| </MasterTableView> |
| <ClientSettings> |
| <Selecting></Selecting> |
| <Resizing AllowRowResize="True" AllowColumnResize="True" EnableRealTimeResize="True" |
| ResizeGridOnColumnResize="False"></Resizing> |
| </ClientSettings> |
| <GroupingSettings ShowUnGroupButton="true" /> |
| </telerik:RadGrid> |
| <div id="bottom" style="float:right; padding-top:10px;"> |
| <asp:Button ID="btnSave" Text="Save" runat="server" CausesValidation="True" onclick="btnSave_Click" /></div> |
Any help as to how best to achieve the above functionality will be much appreciated.
Thanks!