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

"Codeless" sorting, etc.

3 Answers 41 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ian
Top achievements
Rank 1
Ian asked on 03 Sep 2009, 03:09 PM
The RadGrid is billed as supporting the following features:
  • Codeless databinding
  • Codeless insert, update, delete datasource operations
  • Codeless paging, sorting, selecting, filtering

My scenario:

I bind a grid to a webservice.  This works fine.

I'm using the following grid markup:

        <telerik:RadGrid ID="GridCustomers" runat="server" 
                AllowPaging="True" 
                AllowSorting="True"
                Skin="Simple"
                AutoGenerateColumns="False">
            <MasterTableView EnableViewState="False">
                <RowIndicatorColumn>
                    <HeaderStyle Width="20px"></HeaderStyle>
                </RowIndicatorColumn>
                <ExpandCollapseColumn>
                    <HeaderStyle Width="20px"></HeaderStyle>
                </ExpandCollapseColumn>
                <Columns>
                    <telerik:GridBoundColumn DataField="CustomerId" SortExpression="CustomerId" UniqueName="CustomerId" DataType="System.String" HeaderText="Customer ID" />
                    <telerik:GridBoundColumn DataField="ContactTitle" SortExpression="ContactTitle" UniqueName="ContactTitle" DataType="System.String" HeaderText="Contact Title" />
                    <telerik:GridBoundColumn DataField="ContactName" SortExpression="ContactName" UniqueName="ContactName" DataType="System.String" HeaderText="ContactName" />
                </Columns>
            </MasterTableView>
            <ClientSettings AllowColumnsReorder="True" AllowDragToGroup="True" 
                ReorderColumnsOnClient="True">
                <Selecting AllowRowSelect="True" />
                <Scrolling AllowScroll="True" UseStaticHeaders="True" />
                <DataBinding Location="RadGrid.aspx" EnableCaching="true" SelectMethod="GetData" />
           </ClientSettings>
        </telerik:RadGrid>
        <telerik:RadAjaxLoadingPanel ID="Panel1" runat="server"/>

My sorts don't happen automatically on the client side.  Of the samples I've seen so far on the Telerik site, all involve server or client side coding to make the sorts work.  Other third party vendors have grids which use codeless sorting.  I.e., you don't write either client or server side code to react to sort events, etc.  The grid emits JavaScript which does all this work automatically.

Can someone point me to a sample which demonstrates the Telerik idea of "codeless" sorting?

Thanks in advance.

3 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 03 Sep 2009, 03:24 PM
Hi,

All these are related when the grid is bound using DataSourceID. For client binding you can check this demo for more info:
http://demos.telerik.com/aspnet-ajax/grid/examples/clientbinding/defaultcs.aspx

Best wishes,
Vlad
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Ian
Top achievements
Rank 1
answered on 03 Sep 2009, 06:45 PM
Thanks Vlad.

It appears to me that there's no out-of-the-box support for automatic filtering and sorting on the client.  The RadGrid always must make a call to a web service to perform the heavy lifting for these operations.  

If I have datasets averaging about 100 records with a few fields, there's no reason for me to always go back to the server to fetch more data, filter and then sort it.  The page gets all the data it needs on one call.  A developer can set a page size of 20 records to keep the UX pleasant, but ideally, the grid should be able to sort itself using the client side data.  

I should be able to load 100 records client-side and the control can then handle the other functionality using JavaScript emitted by the control.  I don't want to have to write boiler plate client side code to do the same basic tasks in every page where a grid is used.  

Since the columns support the declaration of data types, it seems that the grid would be able to do a sort without requiring the developer to write logic in a client event.  

I'd like to be wrong, but that's just my understanding based on the samples I've reviewed.  
0
BaiH
Top achievements
Rank 1
answered on 07 Sep 2009, 06:52 AM

Yes Ian, there is no codeless sorting on the client as I'm aware of, however to me the example given by the telerik guy seems pretty codeless as it involves few line of server-side code. Also in most cases I like handling the sorting and filtering server-side. It is far better approach as such operations will run much faster there then in the browser, also you will not transfer data which user will never see or need such as for example data for page # 101. But maybe it is just me ;)


--BH
Tags
Grid
Asked by
Ian
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Ian
Top achievements
Rank 1
BaiH
Top achievements
Rank 1
Share this question
or