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

[Solved] How to show the GridClientSelectColumn's checkbox using client-side programmatic binding?

2 Answers 157 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Gu Paranoia
Top achievements
Rank 1
Gu Paranoia asked on 04 Feb 2010, 04:56 AM
I use client-side programmatic binding, like the demo in Grid\Populating with Data\Client-side binding\Programmatic Binding .

The grid can show the checkbox if the pagesize less then 10.  But if the pagesize greater then 10, the checkbox can not show.

How can i show the checkbox.

another question, can I use the export to excel function if using client-side programmatic binding?

2 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 04 Feb 2010, 09:57 AM
Hi,

You can use the following javascript to hide the column if page size is greater than 10.

JS:
 var pageSize = $find("<%= RadGrid1.ClientID %>").get_masterTableView().get_pageSize(); 
 if (pageSize > 10) { 
      $find("<%= RadGrid1.ClientID %>").get_masterTableView().getColumnByUniqueName("ClientSelectColumnUniqueName").set_visible(false); 
 
 } 


" Exporting with client-side binding is not supported, RadGrid should be bound server-side, otherwise you will receive an empty file. "

You can find this mentioned in the help link below:
http://www.telerik.com/help/aspnet-ajax/grdexport.html

Thanks,
Princy


0
Gu Paranoia
Top achievements
Rank 1
answered on 05 Feb 2010, 01:41 AM
thx

I have got the solution.

I first set the grid's pagesize=50, also set the masterview's pagesize=50.
then in the binding code, add set_pageSize(10) code to set the pagesize=10.

The grid will display 10 rows, and if change the pagesize=50, all the rows will show the checkbox.
 
Tags
Grid
Asked by
Gu Paranoia
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Gu Paranoia
Top achievements
Rank 1
Share this question
or