This is a migrated thread and some comments may be shown as answers.

Want to sort the grid based on a field

1 Answer 36 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Arun
Top achievements
Rank 1
Arun asked on 31 Mar 2011, 04:34 PM
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" />


1 Answer, 1 is accepted

Sort by
0
Arun
Top achievements
Rank 1
answered on 04 Apr 2011, 05:35 PM
sombody plsss help me... its urgent...
Tags
Grid
Asked by
Arun
Top achievements
Rank 1
Answers by
Arun
Top achievements
Rank 1
Share this question
or