6 Answers, 1 is accepted
0

Princy
Top achievements
Rank 2
answered on 14 Apr 2014, 07:05 AM
Hi Deekshith,
You can use the PreRender event of the RadGrid to set the column width of a RadGrid.
C#:
Thanks,
Princy
You can use the PreRender event of the RadGrid to set the column width of a RadGrid.
C#:
protected
void
RadGrid1_PreRender(
object
sender, EventArgs e)
{
RadGrid1.MasterTableView.GetColumn(
"ColumnUniqueName"
).HeaderStyle.Width = Unit.Pixel(100);
}
Thanks,
Princy
0

Deekshith
Top achievements
Rank 1
answered on 14 Apr 2014, 09:53 AM
Thank You :)
0

Deekshith
Top achievements
Rank 1
answered on 21 Apr 2014, 10:45 AM
Hi Princy is their any way is their to do the same thing in .aspx?
0

Princy
Top achievements
Rank 2
answered on 21 Apr 2014, 12:47 PM
Hi Deekshith,
You can set the Width of the column in aspx as follows:
ASPX:
Thanks,
Princy
You can set the Width of the column in aspx as follows:
ASPX:
<
telerik:GridBoundColumn
UniqueName
=
"ID"
DataField
=
"ID"
HeaderText
=
"ID"
>
<
HeaderStyle
Width
=
"200px"
/>
</
telerik:GridBoundColumn
>
Thanks,
Princy
0

SABITHA
Top achievements
Rank 1
answered on 06 Feb 2015, 07:01 AM
In my case the grid has to populate the columns in the conditional basis . In some cases it will be total of 5 columns and in the other case it will be columns of the total 15columns . Is there any way to set the widhth of all the grid columns to say 100px from the server side code for example say pre-render method.
0
Hello Sabitha,
The PreRender event handler is raised a bit late, therefore, you can use the Load or ColumnCreated events if you are using AutogeneratedColumns. In addition, you can check the following approach:
http://www.telerik.com/help/aspnet-ajax/grid-gridcolumn-resizetofit.html
Hope this helps.
Regards,
Eyup
Telerik
The PreRender event handler is raised a bit late, therefore, you can use the Load or ColumnCreated events if you are using AutogeneratedColumns. In addition, you can check the following approach:
http://www.telerik.com/help/aspnet-ajax/grid-gridcolumn-resizetofit.html
Hope this helps.
Regards,
Eyup
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.