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

Dynamically Add/Remove "GridButtonColumn"

1 Answer 65 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Prava kafle
Top achievements
Rank 1
Prava kafle asked on 31 Aug 2010, 09:21 PM
Hi,

I want to dynamically add/Remove  GridButtonColumn in a RadGrid. In a regular ASP.Net Grid I achieved this by setting  Grid1.AutoGenerateSelectButton = false OR Spreadsheet.AutoGenerateSelectButton = True;

I want to let the users select rows in a Grid only on certain occasions. How can I show / hide Select column in RadGrid? Can someone provide me  clues?

Thanks,
Prava

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 01 Sep 2010, 05:36 AM
Hello Prava,

You can try the following code snippet  to hide the Select Column in RadGrid.

ASPX:
<telerik:GridButtonColumn Text="Select" CommandName="Select" UniqueName="SelectButton">
</telerik:GridButtonColumn>

C#:
protected void RadGrid1_PreRender(object sender, EventArgs e)
   {
          if(//check for condition)
             RadGrid1.MasterTableView.GetColumn("SelectButton").Visible = false;
   }

Thanks,
Princy.
Tags
Grid
Asked by
Prava kafle
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or