I have a radgrid with all rows in edit mode.
A update button is outside the grid.
How do I get all values from all rows from the grid in an external button "btnUpdate".
I have the following code and can get the datakeyvalues but cannot get the textbox value as the "VAL" textbox is not found.
A update button is outside the grid.
<telerik:RadGrid ID="radgridFeeCalc" runat="server" ShowStatusBar="true" AutoGenerateColumns="False" PageSize="5" AllowPaging="True" AllowSorting="True" AllowMultiRowSelection="False" AllowAutomaticUpdates="false" GridLines="None" AllowAutomaticDeletes="false" AllowAutomaticInserts="false" OnItemDataBound="radgridFeeCalc_ItemDataBound" > <PagerStyle Mode="NextPrevAndNumeric"></PagerStyle> <MasterTableView DataKeyNames="SEQ_NUM, DST_ID" AllowMultiColumnSorting="True" ShowFooter="True" CommandItemDisplay="Top" Name="Address" AllowFilteringByColumn="False" TableLayout="Auto" > <CommandItemSettings ShowAddNewRecordButton="false" ShowRefreshButton="false" /> <Columns> <telerik:GridBoundColumn SortExpression="SEQ_NUM" HeaderText="Sequence" HeaderButtonType="TextButton" DataField="SEQ_NUM" UniqueName="sEQ_NUM" ReadOnly="true"> </telerik:GridBoundColumn> <telerik:GridBoundColumn SortExpression="DESCR" HeaderText="Description" HeaderButtonType="TextButton" DataField="DESCR" UniqueName="dESCR" ReadOnly="true"> </telerik:GridBoundColumn> <telerik:GridTemplateColumn HeaderText="Calc Amount" DataField="VAL" UniqueName="vAL" > <EditItemTemplate> <asp:TextBox ID="VAL" runat="server" Text='<%# Bind("VAL") %>'></asp:TextBox> </EditItemTemplate> <ItemTemplate > <asp:TextBox ID="view_VAL" runat="server" Text='<%# Bind("VAL") %>'></asp:TextBox> </ItemTemplate> </telerik:GridTemplateColumn> <telerik:GridBoundColumn SortExpression="DST_ID" HeaderText="Distribution Id" HeaderButtonType="TextButton" DataField="DST_ID" UniqueName="dST_ID" ReadOnly="true"> </telerik:GridBoundColumn> </Columns> </MasterTableView> </telerik:RadGrid> <telerik:RadButton ID="btnUpdate" runat="server" Text="Update" onclick="btnUpdate_Click"></telerik:RadButton>How do I get all values from all rows from the grid in an external button "btnUpdate".
I have the following code and can get the datakeyvalues but cannot get the textbox value as the "VAL" textbox is not found.
protected void btnUpdate_Click(object sender, EventArgs e) { foreach (GridEditFormItem editedItem in radgridFeeCalc.MasterTableView.GetItems(GridItemType.EditFormItem)) { string keyId1 = editedItem.OwnerTableView.DataKeyValues[editedItem.ItemIndex]["SEQ_NUM"].ToString(); string keyId2 = editedItem.OwnerTableView.DataKeyValues[editedItem.ItemIndex]["DST_ID"].ToString(); TextBox combo = ((GridEditFormItem)editedItem).EditFormCell.FindControl("VAL") as TextBox; string str1 = combo.Text; } }