SteveInBeloit
Well-known member
- Joined
- May 22, 2006
- Messages
- 132
- Programming Experience
- 10+
VS 2003 VB .NET
I am currently trying to accomplish two things.
1. In Code, trying to set the column width
2. Trying to change the color of the row based on the value of one cell.
For the width, I thought I could do it like this:
This does not effect the grid at all.
2. I don't know where to start, can't find a walkthrough or article on just this.
I am needing to do both of these at run time, not design time.
Any thoughts?
Thanks
I am currently trying to accomplish two things.
1. In Code, trying to set the column width
2. Trying to change the color of the row based on the value of one cell.
For the width, I thought I could do it like this:
VB.NET:
Dim ts As DataGridTableStyle = New DataGridTableStyle
Dim daGrid1 As New SqlDataAdapter(Me.SqlCommand1)
dsGrid1 = New DataSet
dsGrid1.Clear()
daGrid1.Fill(dsGrid1, "top")
DataGrid1.DataSource = dsGrid1.Tables(0).DefaultView
DataGrid1.TableStyles.Add(ts)
DataGrid1.TableStyles(0).GridColumnStyles(1).Width = 5
2. I don't know where to start, can't find a walkthrough or article on just this.
I am needing to do both of these at run time, not design time.
Any thoughts?
Thanks
Last edited by a moderator: