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

How to set width of columns

1 Answer 140 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Abhisek Shukla
Top achievements
Rank 1
Abhisek Shukla asked on 17 Sep 2007, 08:12 AM
I generate the radgridview through programmatically using dataset, Now I want to set width of columns through programming which are generated . How to do that?

Abhisek Shukla

1 Answer, 1 is accepted

Sort by
0
Jack
Telerik team
answered on 17 Sep 2007, 03:05 PM
Hi Abhisek Shukla,

This can be done easily  by setting the Width property of your columns. This must be done after your set the DataSource.  See this code:

this.radGridView1.DataSource = table;

this.radGridView1.GridElement.BeginUpdate();

this.radGridView1.Columns[0].Width = 20;
this.radGridView1.Columns[1].Width = 100;
this.radGridView1.Columns[2].Width = 120;

this.radGridView1.GridElement.EndUpdate();

Greetings,
Jack
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
GridView
Asked by
Abhisek Shukla
Top achievements
Rank 1
Answers by
Jack
Telerik team
Share this question
or