5 Answers, 1 is accepted
0
Accepted
Princy
Top achievements
Rank 2
answered on 25 Oct 2010, 12:40 PM
Hello Amit,
The following code snippet shows how to hide grid column (AutoGeneratedColumn and GridBoundColumn).
C#:
Thanks,
Princy.
The following code snippet shows how to hide grid column (AutoGeneratedColumn and GridBoundColumn).
C#:
protected
void
RadGrid2_PreRender(
object
sender, EventArgs e)
{
RadGrid2.MasterTableView.GetColumn(
"status"
).Visible =
false
;
//hiding grid column using ColumnUniqueName
RadGrid2.MasterTableView.AutoGeneratedColumns[0].Visible =
false
;
// hiding AutoGeneratedColumn
}
Thanks,
Princy.
0
Accepted
Hi Amit,
RadGrid columns have a Visible property and a Display property. More information about them is available in the documentation:
http://www.telerik.com/help/aspnet-ajax/grdusingcolumns.html
If you use Display="false", you can toggle the column's visibility client-side using the control's API, in case you need such a functionality.
http://demos.telerik.com/aspnet-ajax/grid/examples/client/clientsideapi/defaultcs.aspx
In case you columns are autogenerated, you can set the properties in ColumnCreated, as demonstrated in the first document linked above.
Regards,
Dimo
the Telerik team
RadGrid columns have a Visible property and a Display property. More information about them is available in the documentation:
http://www.telerik.com/help/aspnet-ajax/grdusingcolumns.html
If you use Display="false", you can toggle the column's visibility client-side using the control's API, in case you need such a functionality.
http://demos.telerik.com/aspnet-ajax/grid/examples/client/clientsideapi/defaultcs.aspx
In case you columns are autogenerated, you can set the properties in ColumnCreated, as demonstrated in the first document linked above.
Regards,
Dimo
the Telerik team
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Public Issue Tracking
system and vote to affect the priority of the items
0
Amit
Top achievements
Rank 1
answered on 28 Oct 2010, 10:36 AM
Hey Princy,
Thanks,thats done,but i was told that column index starts from 2.initial 2 columns are hidden.That does'nt look so?...
Thanks,thats done,but i was told that column index starts from 2.initial 2 columns are hidden.That does'nt look so?...
0
Accepted
Hello Amit,
>> "initial 2 columns are hidden."
This is true (unless the columns become visible), however it does not apply in your case. It applies when addressing row cells by index (which is generally not recommended):
item.Cells[2]
Sincerely yours,
Dimo
the Telerik team
>> "initial 2 columns are hidden."
This is true (unless the columns become visible), however it does not apply in your case. It applies when addressing row cells by index (which is generally not recommended):
item.Cells[2]
Sincerely yours,
Dimo
the Telerik team
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Public Issue Tracking
system and vote to affect the priority of the items
0
Amit
Top achievements
Rank 1
answered on 28 Oct 2010, 11:21 AM
Thanks for clarifying Dimo...