Column Width in a Gridview

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

How can I change the column width in a gridview filled with a dataset? I
can't get TableStyle to work. Has anyone any sample code, please?

Thanks,
Helen

PS. I am creating a web page in ASP.Net 2.0 using C#.

This is my code so far:

SqlConnection cn; // Connection to the SQL database
SqlDataAdapter da;
DataSet ds;

cn = new SqlConnection();
da=new SqlDataAdapter("Select * From Patient",cn);
ds = new DataSet();

OpenConnection(cn); // Connects to the database
da.Fill(ds,"PatientTable");
dgPatients.DataSource = ds.Tables["PatientTable"];
dgPatients.DataBind();
cn.Close();
 
Helen Trim said:
How can I change the column width in a gridview filled with a dataset? I
can't get TableStyle to work. Has anyone any sample code, please?

Thanks,
Helen

PS. I am creating a web page in ASP.Net 2.0 using C#.

Thus your question belongs in the ASP.NET group, and possibly the C# group,
but this is the Visual C++ group.
This is my code so far:

SqlConnection cn; // Connection to the SQL database
SqlDataAdapter da;
DataSet ds;

cn = new SqlConnection();
da=new SqlDataAdapter("Select * From Patient",cn);
ds = new DataSet();

OpenConnection(cn); // Connects to the database
da.Fill(ds,"PatientTable");
dgPatients.DataSource = ds.Tables["PatientTable"];
dgPatients.DataBind();
cn.Close();
 
Back
Top