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

Hide GridTemplate Column from code behind

1 Answer 226 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Mike Causi
Top achievements
Rank 1
Mike Causi asked on 05 Aug 2010, 09:38 PM

 

I have a column defined something like this:
<
rada:GridTemplateColumn >

 

 

<HeaderTemplate>headertext</HeaderTemplate>

 

 

<ItemTemplate>
...

 

 

</ItemTemplate>

 

 

 

 

 

</rada:GridTemplateColumn>

 




Is there a way to dynamically hide or show this column in the code behind depending on when I need it?

I know I can hide a

GridBoundColumn

 by calling this:

rg.Columns.FindByDataField(

"Columnname").Visible = false;

but haven't figured out GridTemplateColumn yet.

 

1 Answer, 1 is accepted

Sort by
0
Mike Causi
Top achievements
Rank 1
answered on 05 Aug 2010, 09:44 PM
I answered my own question.
 Posting answer for anyone else that needed it.

Use the "uniquename" property and use the

rg.Columns.FindByUniqueName(

"colname").Visible = false;

 

Tags
Grid
Asked by
Mike Causi
Top achievements
Rank 1
Answers by
Mike Causi
Top achievements
Rank 1
Share this question
or