Telerik RadControls - Adding Checkbox Select Column

I don't know what your problem is, but I'll bet it's hard to pronounce.

Telerik RadControls - Adding Checkbox Select Column

Postby ShiftPoint » Sun Jul 05, 2009 9:07 pm

Here is a quick example on how to add a check box column to one of your radgrids server side. Keep in mind the grid is created server side and all data in the grid is binded on the fly.

First make sure in your DefineGridStructure() Method you set the following settings:
Code: Select all
       RadGrid1.AllowMultiRowSelection = true;

       RadGrid1.AllowAutomaticInserts = true;

       RadGrid1.ClientSettings.Selecting.AllowRowSelect = true;

       RadGrid1.ClientSettings.Selecting.EnableDragToSelectRows = true;



Next in your method when your binding data to the columns make sure you create a new GridClientSelectColumn.

Code: Select all
  GridClientSelectColumn checkColumn;


Then when you want to create the check box column use something like this:
Code: Select all
  checkColumn = new GridClientSelectColumn();

  checkColumn.HeaderText = "XYZ Column";

  checkColumn.Visible = true;

  checkColumn.Display = true;

  checkColumn.ItemStyle.HorizontalAlign = HorizontalAlign.Left;

   RadGrid1.MasterTableView.Columns.Add(checkColumn);


Hope this helps!
User avatar
ShiftPoint
 
Posts: 70
Joined: Sun Jul 05, 2009 4:52 pm
Location: Pickerington, OH

Return to ASP.Net

Who is online

Users browsing this forum: No registered users and 0 guests

cron