When i double click a row, it turns to edit mode. After editing the row and click out side any other row, the grid is automatically updating.
i want to sort the grid based on the field "unit price". how can i do this ?
here is the code i used
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="RadGrid1">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="RadGrid1" />
<telerik:AjaxUpdatedControl ControlID="Label1" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManager>
<telerik:RadGrid ID="RadGrid1" DataSourceID="SessionDataSource1" Width="97%"
ShowStatusBar="True" AllowSorting="True" PageSize="7" GridLines="None" AllowPaging="True"
runat="server" AllowAutomaticUpdates="True" OnItemUpdated="RadGrid1_ItemUpdated" AutoGenerateColumns="False" OnDataBound="RadGrid1_DataBound">
<MasterTableView TableLayout="Fixed" DataKeyNames="ProductID" EditMode="InPlace">
<Columns>
<telerik:GridBoundColumn UniqueName="ProductID" DataField="ProductID" HeaderText="ProductID" ReadOnly="True" HeaderStyle-Width="10%" />
<telerik:GridBoundColumn UniqueName="ProductName" DataField="ProductName" HeaderText="Product name"
HeaderStyle-Width="25%" ColumnEditorID="GridTextBoxColumnEditor1" />
<telerik:GridBoundColumn UniqueName="QuantityPerUnit" DataField="QuantityPerUnit" HeaderText="Quantity"
HeaderStyle-Width="20%" />
<telerik:GridNumericColumn UniqueName="UnitPrice" DataField="UnitPrice" HeaderText="UnitPrice" HeaderStyle-Width="10%" ColumnEditorID="GridNumericColumnEditor1" />
</Columns>
</MasterTableView>
<ClientSettings>
<ClientEvents OnRowClick="RowClick" OnRowDblClick="RowDblClick"
OnGridCreated="GridCreated" OnCommand="GridCommand" />
</ClientSettings>
</telerik:RadGrid>
<telerik:GridTextBoxColumnEditor ID="GridTextBoxColumnEditor1" runat="server" TextBoxStyle-Width="180px" />
i want to sort the grid based on the field "unit price". how can i do this ?
here is the code i used
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="RadGrid1">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="RadGrid1" />
<telerik:AjaxUpdatedControl ControlID="Label1" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManager>
<telerik:RadGrid ID="RadGrid1" DataSourceID="SessionDataSource1" Width="97%"
ShowStatusBar="True" AllowSorting="True" PageSize="7" GridLines="None" AllowPaging="True"
runat="server" AllowAutomaticUpdates="True" OnItemUpdated="RadGrid1_ItemUpdated" AutoGenerateColumns="False" OnDataBound="RadGrid1_DataBound">
<MasterTableView TableLayout="Fixed" DataKeyNames="ProductID" EditMode="InPlace">
<Columns>
<telerik:GridBoundColumn UniqueName="ProductID" DataField="ProductID" HeaderText="ProductID" ReadOnly="True" HeaderStyle-Width="10%" />
<telerik:GridBoundColumn UniqueName="ProductName" DataField="ProductName" HeaderText="Product name"
HeaderStyle-Width="25%" ColumnEditorID="GridTextBoxColumnEditor1" />
<telerik:GridBoundColumn UniqueName="QuantityPerUnit" DataField="QuantityPerUnit" HeaderText="Quantity"
HeaderStyle-Width="20%" />
<telerik:GridNumericColumn UniqueName="UnitPrice" DataField="UnitPrice" HeaderText="UnitPrice" HeaderStyle-Width="10%" ColumnEditorID="GridNumericColumnEditor1" />
</Columns>
</MasterTableView>
<ClientSettings>
<ClientEvents OnRowClick="RowClick" OnRowDblClick="RowDblClick"
OnGridCreated="GridCreated" OnCommand="GridCommand" />
</ClientSettings>
</telerik:RadGrid>
<telerik:GridTextBoxColumnEditor ID="GridTextBoxColumnEditor1" runat="server" TextBoxStyle-Width="180px" />