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

[Solved] columns set up in grid

1 Answer 97 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jols
Top achievements
Rank 2
Jols asked on 07 May 2009, 09:14 AM
good day to all expert ,

                      how can i set the width of my specific column in the grid? please help

sample codes is highly appreciated

thanks to all

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 07 May 2009, 10:20 AM
Hello Jols,

You can set the width of the column using the HeaderStyle of the column:
aspx:
<telerik:GridBoundColumn UniqueName="ContactName" DataField="ContactName"
             <HeaderStyle Width="200px" /> 
              
</telerik:GridBoundColumn> 

c#:
protected void RadGrid2_ColumnCreated(object sender, GridColumnCreatedEventArgs e) 
    { 
        if (e.Column.UniqueName == "ColumnUniqueName"
            e.Column.HeaderStyle.Width = Unit.Pixel(100); 
    } 

Thanks
Princy.
Tags
Grid
Asked by
Jols
Top achievements
Rank 2
Answers by
Princy
Top achievements
Rank 2
Share this question
or