Hi All;
I'm working in VS2005, and have a DataGridView that is bound to a
datasource. Is there a way to change a column to be a link style column after
the DataGridView populates? Here's how I populate it:
DataSet ds = new DataSet();
dgvShipmentHistory.DataSource = null;
SqlDataAdapter da = new SqlDataAdapter(mySQLClass.Query, mySQLClass.SqlCon);
da.MissingSchemaAction = MissingSchemaAction.AddWithKey;
da.Fill(ds, "ShipmentHistory");
dgvShipmentHistory.DataSource = ds.Tables[0];
dgvShipmentHistory.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.AllCells);
I want to be able to change one of the columns to be a link type column so
that users can click the hyperlink and I can throw up a page. I bind the
grid at runtime, so cannot do this at design time.
Thanks
Nicholas Paldino [.NET/C# MVP] - 11 Jul 2007 16:40 GMT
Rahvyn,
You are going to have to set all the columns to the appropriate types
then at runtime. Basically, you are going to have to call the Add method on
the Columns collection returned from the DataGridView for each column in
your grid, setting the link column appropriately based on your data.

Signature
- Nicholas Paldino [.NET/C# MVP]
- mvp@spam.guard.caspershouse.com
> Hi All;
>
[quoted text clipped - 17 lines]
>
> Thanks