I have a simple radgrid (markup below) that is populated with a DataTable, such as the example below;
Flag Rank
J 3
X 8
In the edit mode I want to change the values of the Rank column, and on update I want the grid to reflect the new value. I don't want to post the value back to the original datasource - I just want it to persist in the radgrid. In another operation I will use the values in the radgrid after the user makes their edits.
I imagine this is simple to do but I am not seeing it. Can you point me in the right direction?
Flag Rank
J 3
X 8
In the edit mode I want to change the values of the Rank column, and on update I want the grid to reflect the new value. I don't want to post the value back to the original datasource - I just want it to persist in the radgrid. In another operation I will use the values in the radgrid after the user makes their edits.
I imagine this is simple to do but I am not seeing it. Can you point me in the right direction?
protected void rgFlagsToRerank_UpdateCommand(object sender, GridCommandEventArgs e){ GridEditableItem editedItem = e.Item as GridEditableItem; Hashtable newValues = new Hashtable(); e.Item.OwnerTableView.ExtractValuesFromItem(newValues, editedItem); int valRank = int.Parse(newValues["Rank"].ToString()); //todo - help please - how do I persist this value in the grid}<telerik:RadGrid ID="rgFlagsToRerank" runat="server" CellSpacing="0" GridLines="Both" Font-Names="Arial" Font-Size="8pt" Height="400" Width="310px" AutoGenerateColumns="false" OnCancelCommand="rgTotalVsDissolved_CancelCommand" OnNeedDataSource="rgFlagsToRerank_NeedDataSource" OnUpdateCommand="rgFlagsToRerank_UpdateCommand" > <ClientSettings > <Scrolling AllowScroll="True" UseStaticHeaders="True" /> </ClientSettings> <ExportSettings ExportOnlyData="true" IgnorePaging="true" OpenInNewWindow="true" ></ExportSettings> <MasterTableView Width="310px" Caption="Flags to Re-rank" EditMode="InPlace" CommandItemDisplay="Top" NoMasterRecordsText="No validation flags to re-rank" DataKeyNames="ValidationFlags,Rank" > <Columns> <telerik:GridBoundColumn DataField="ValidationFlags" UniqueName="ValidationFlags" Display="true" HeaderText="Validation Flag" HeaderStyle-Width="100" ItemStyle-Width="95" ReadOnly="true" ></telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="Rank" UniqueName="Rank" Display="true" HeaderText="Rank" HeaderStyle-Width="100" ItemStyle-Width="95" ></telerik:GridBoundColumn> <telerik:GridEditCommandColumn UniqueName="EditCommandColumn" HeaderText="Edit" HeaderStyle-Width="100px" UpdateText="Update" CancelText="Cancel"></telerik:GridEditCommandColumn> </Columns> <CommandItemSettings ShowExportToExcelButton="true" ShowAddNewRecordButton="false" ShowRefreshButton="false" ></CommandItemSettings> <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column" Visible="True"> <HeaderStyle Width="20px" /> </RowIndicatorColumn> <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column" Visible="True"> <HeaderStyle Width="20px" /> </ExpandCollapseColumn> <EditFormSettings> <EditColumn FilterControlAltText="Filter EditCommandColumn column"> </EditColumn> </EditFormSettings> </MasterTableView> <FilterMenu EnableImageSprites="False"></FilterMenu> </telerik:RadGrid>