|
-
Jun 22nd, 2004, 04:56 PM
#1
Thread Starter
Lively Member
Formatting DataGrid column
I want to format columns in DataGrid while form is loaded and i want the formatting to apply to complete column (all rows) at once.
The Problem: When my form is loaded there is now formatting done to the DataGrid. The formatting comes up only when i click some cell in the column and the formatting is applied to that one cell only.
DataGrid is on winform and following code is in sub Form_load.
Dim MyTableStyle As New DataGridTableStyle()
Dim Col As New DataGridTextBoxColumn()
...
Col = New DataGridTextBoxColumn()
Col.MappingName = "Customer"
Col.HeaderText = "Customer name"
Col.TextBox.BackColor = System.Drawing.Color.Red
...
MyTableStyle.GridColumnStyles.Add(Col)
...
Me.DataGrid1.TableStyles.Add(MyTableStyle)
How can i get the formatting applied automatically to the column when the form is loaded?
Thanks for any help!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|