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

RadGrid Performance Increse

4 Answers 25 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Swapnil
Top achievements
Rank 1
Swapnil asked on 28 Jul 2014, 12:34 PM
I am having one RadGrid and binding one Datatable to it From codebehind.
At each paging or sorting or drag drop column it goes server side (page refreshed) and then displays.
is there any professional way i can achieve this with faster speed.
my code is

<telerik:RadGrid ID="RadGridEmployeeCost" runat="server" AllowSorting="True" AllowPaging="true"
    AllowFilteringByColumn="true" CellSpacing="0" GridLines="None" HeaderStyle-Font-Bold="true"
    Skin="Web20" OnNeedDataSource="RadGridEmployeeCost_NeedDataSource" ShowGroupPanel="true"
    OnColumnCreated="RadGridEmployeeCost_ColumnCreated">
    <ClientSettings AllowDragToGroup="True" />
</telerik:RadGrid>

 AND
  protected void RadGridEmployeeCost_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
       {
               ObjCon.Open();
               SqlCommand ObjCmd = new SqlCommand("SELECT name,address,TelPhone,EmailId,Qualification FROM WorkSummary", ObjCon);
               ObjCmd.ExecuteNonQuery();
               SqlDataAdapter ObjDa = new SqlDataAdapter(ObjCmd);
               DataSet ds = new DataSet();
               ObjDa.Fill(ds);
               RadGridEmployeeCost.DataSource = ds;
           }
       }
 
protected void RadGridEmployeeCost_ColumnCreated(object sender, GridColumnCreatedEventArgs e)
       {
           if ((e.Column is GridBoundColumn && e.Column.UniqueName == "TelPhone" || e.Column.UniqueName == "EmailId" || e.Column.UniqueName == "Qualification"))
           {
               GridBoundColumn column = e.Column as GridBoundColumn;
               column.AllowFiltering = false;
           }
       }

4 Answers, 1 is accepted

Sort by
0
Jayesh Goyani
Top achievements
Rank 2
answered on 28 Jul 2014, 06:40 PM
Hello,

To achieve better performace please use either client side binding or ClinetDataSource.



Thanks,
Jayesh Goyani
0
Swapnil
Top achievements
Rank 1
answered on 30 Jul 2014, 06:13 AM
want to bind grid from design . give code
Thanks
0
Swapnil
Top achievements
Rank 1
answered on 30 Jul 2014, 12:11 PM
please give code
0
Jayesh Goyani
Top achievements
Rank 2
answered on 31 Jul 2014, 07:50 PM
Hello,

Curretly working on that.

Thanks,
Jayesh Goyani
Tags
Grid
Asked by
Swapnil
Top achievements
Rank 1
Answers by
Jayesh Goyani
Top achievements
Rank 2
Swapnil
Top achievements
Rank 1
Share this question
or