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

RAD GRID

1 Answer 15 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Bharat
Top achievements
Rank 1
Bharat asked on 16 Nov 2010, 09:27 AM
Hi All,

    I want to hide a column in RadGrid when Autogenerated column is true.
I am using DataRelation in RadGrid

Thanx in Advance


Bharat Rathore


Hi All,

I got the Solution.

 

 

protected void RadGrid1_ColumnCreated1(object sender, GridColumnCreatedEventArgs e)

 

{

 

 

if (e.Column.UniqueName == "column name")

 

{

e.Column.Visible =

 

false;

 

}

}

1 Answer, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 17 Nov 2010, 03:50 PM
Hello Bharat,

Indeed you can customize the properties of auto-generated columns at runtime by providing a handler for the grid's ColumnCreated event. In the event handler, cast the column to the appropriate type and set its attributes.

Additionally, to change the settings for declarative columns at runtime, write a handler for the PreRender event of the grid, traverse the Columns collection to locate the column of interest, and alter its properties. You must then rebind the grid by calling its Rebind() method to reflect the changes. For further details visit this article.

Kind regards,

Pavlina
the Telerik team

 

Browse the vast support resources we have to jumpstart your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Tags
General Discussions
Asked by
Bharat
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Share this question
or