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

[Solved] Dynamically, per user selection, set RadGrid paging, sorting, column re-order

2 Answers 99 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Kevin
Top achievements
Rank 1
Kevin asked on 04 Jan 2010, 10:39 PM
Hi guys/gals,

1st time poster, thanks for any help.

Been looking for several days @ the forums & couldnt find a specific solution.

I have a RadGrid configured @ design time as:
    1) Enable Paging (AllowPaging)=false
    2) Enable Sorting (AllowSorting)=false
    3) Enable Client-Side Column Re-order (ClientSettings.AllowColumnsReorder)=false

On a button click, I display a RadDock w/ three check boxes:
    1) Enable paging
    2) Enable sorting
    3) Enable column reorder

For the life of me, I cannot change the RadGrid properties dynamically.

Any ideas?

Thanks, Kevin



    

2 Answers, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 05 Jan 2010, 07:42 AM
Hello Kevin,

Try rebinding your grid after settingenabling the various properties for the grid:
aspx:
   <telerik:RadDock ID="dock" runat="server"
        <ContentTemplate> 
            <asp:CheckBox ID="CheckBox1" AutoPostBack="true" runat="server" OnCheckedChanged="CheckBox1_CheckedChanged" /> 
            <asp:CheckBox ID="CheckBox2" AutoPostBack="true" runat="server" OnCheckedChanged="CheckBox2_CheckedChanged" /> 
            <asp:CheckBox ID="CheckBo3" AutoPostBack="true" runat="server" OnCheckedChanged="CheckBox3_CheckedChanged" /> 
        </ContentTemplate> 
    </telerik:RadDock> 

c#:
protected void CheckBox1_CheckedChanged(object sender, EventArgs e) 
    { 
        RadGrid1.AllowPaging = !RadGrid1.AllowPaging; 
        RadGrid1.Rebind(); 
    } 
    protected void CheckBox2_CheckedChanged(object sender, EventArgs e) 
    { 
        RadGrid1.AllowSorting = !RadGrid1.AllowSorting; 
        RadGrid1.Rebind(); 
    } 
  protected void CheckBox3_CheckedChanged(object sender, EventArgs e) 
    { 
        RadGrid1.ClientSettings.AllowColumnsReorder = !RadGrid1.ClientSettings.AllowColumnsReorder; 
        RadGrid1.Rebind(); 
    } 

Thanks
Princy.
0
Kevin
Top achievements
Rank 1
answered on 05 Jan 2010, 04:16 PM
Princy,

Thanks a million, it worked !!!

After your smack yourself in the head a few times, the answer is easy (once some one tells you).

Thanks again, Kevin
Tags
Grid
Asked by
Kevin
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Kevin
Top achievements
Rank 1
Share this question
or