DataGrid

  • Thread starter Thread starter Alberto
  • Start date Start date
A

Alberto

I have a dataGrid control in an ascx module. The code is this:

gridUsers.DataSource = users.GetUsers();
gridUsers.DataBind();

As you can see, the GetUsers() method returns a DataSet object.

What I want is modify the widht of the columns. I have to do it in code
(because it's linked in runtime) but I don't know how to do it.

Thank you.
 
after you call the databind() you need to put some code in the itemdatabound
event handler. this is where you can set the width of the column
 
Back
Top