<telerik:RadGrid ID="RadGrid1" runat="server" onneeddatasource="NeedData" AutoGenerateColumns="False">
<MasterTableView ClientDataKeyNames="NewCol1" Width="100%">
<Columns>
<telerik:GridBoundColumn DataField="rowId" HeaderText="rowId" Visible="false" UniqueName="rowId">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="NewCol1" HeaderText="NewCol1" ReadOnly="False" UniqueName="NewCol1">
</telerik:GridBoundColumn>
</Columns>
</MasterTableView>
<ClientSettings>
<Selecting AllowRowSelect="True"/>
<ClientEvents OnRowDblClick="OnRowSelected" />
<Scrolling AllowScroll="True" UseStaticHeaders="True" ScrollHeight="200px"/>
</ClientSettings>
</telerik:RadGrid>
A DataTable is used as the data source on the server side. In the RadGrid, when you double click a row, a RadWindow is used to popup a window to edit the selected row's data. The popup window in turn calls my local js method to update the row with the new values. All is well and the examples I have followed work as expected. When I finally hit a save button on the page (which posts back to the server), I believe .Net is loading the view state of the RadGrid without the changes I have made to the grid. I kind of expected this given that .Net rebuilds the controls in the Init event. So I have two questions,
1) How do I get the changes I have made to the grid on the client side to the server, and/or
2) The RadWindow used to make the changes calls the js function BrowserWindow.myUpdateMethod which is all client side. If I cannot easily get the client side changes, how can I force the RadWindow to post back instead of calling my js function? In the past, we have used CodeSummit WebModalControls which does precisely that, which allows us to change the data client side and rebind.
Thanks for your help.
Paul
| function Grid1_OnRowSelected(sender, eventArgs) |
| { |
| var MasterTable = sender.get_masterTableView(); |
| var selectedRows = MasterTable.get_selectedItems(); |
| var gridToolbar = GetRegisteredServerElement("Grid1Toolbar"); |
| if (selectedRows.get_Count() > 0) |
| { |
| gridToolbar.findItemByAttribute("CommandName", "Copy").enable(); |
| gridToolbar.findItemByAttribute("CommandName", "Move").enable(); |
| gridToolbar.findItemByAttribute("CommandName", "ToggleStatus").enable(); |
| // Enable copy/move command items |
| } |
| else |
| { |
| gridToolbar.findItemByAttribute("CommandName", "Copy").disable(); |
| gridToolbar.findItemByAttribute("CommandName", "Move").disable(); |
| gridToolbar.findItemByAttribute("CommandName", "ToggleStatus").disable(); |
| // Disable copy/move command items |
| } |

When setting the GroupByExpression property for a template column I would like to declaratively assign the field alias to a resource so that it is localized.
My current expression is:
| <telerik:GridTemplateColumn |
| GroupByExpression="FieldName AliasName Group By FieldName asc" |
How can I replace 'AliasName' so that it uses <%$ Resources:Grid, AliasName%> ?
I don't want an initial grouping state so have not set the GroupByExpressions property for the MasterTableView.
| protected void BuildingItemList_ItemCommand(object source, GridCommandEventArgs e) |
| { |
| if (e.CommandName.ToUpper() == "CHANGESTATUS") |
| { |
| foreach (GridDataItem dataItem in BuildingItemList.SelectedItems) |
| { |
| // Todo - something like below to convert selected items into an object. |
| // MyDTO dto = (MyDTO) dataItem.DataItem; |
| } |
| } |
| } |