|
-
Apr 26th, 2003, 01:26 PM
#1
Thread Starter
Frenzied Member
datagrid
I need a DataGridTableStyle to format some of the columns in my grid. I'm using the code below, but it's not working...not sure where the code goes for it to function...can someone shed some light....
VB Code:
Dim objTableStyle As DataGridTableStyle
Dim objColumn As DataGridTextBoxColumn
objTableStyle = New DataGridTableStyle()
objColumn = New DataGridTextBoxColumn()
objColumn.MappingName = "Col1"
objColumn.HeaderText = "First"
objTableStyle.GridColumnStyles.Add(objColumn)
intLastColumnWidth -= objColumn.Width
objColumn = New DataGridTextBoxColumn()
objColumn.MappingName = "Col2"
objColumn.HeaderText = "Second"
objTableStyle.GridColumnStyles.Add(objColumn)
intLastColumnWidth -= objColumn.Width
It's tough being an unhandled exception...
___________
VB.NET 2008
VB.NET 2010
ORACLE 11g
CRYSTAL 11
-
Apr 26th, 2003, 03:11 PM
#2
Frenzied Member
Did you define the datagird datasource?
'Heading for the automatic overload'
Marillion, Brave, The Great Escape, 1994
'How will WE stand the FIRE TOMORROW?'
Eloy, Silent Cries and Mighty Echoes, The Vision - Burning, 1979
-
Apr 26th, 2003, 03:41 PM
#3
Thread Starter
Frenzied Member
I got it working...thanks Lun
one of the fields in my grid is a date, but it's coming over with the time...you know how I can format this?
It's tough being an unhandled exception...
___________
VB.NET 2008
VB.NET 2010
ORACLE 11g
CRYSTAL 11
-
Apr 26th, 2003, 03:47 PM
#4
Frenzied Member
Not tested but may be this helps:
VB Code:
Me.DataGridTextBoxColumn1.Format = "d" ' d stands for short date format
Or you may use other custom format strings.
'Heading for the automatic overload'
Marillion, Brave, The Great Escape, 1994
'How will WE stand the FIRE TOMORROW?'
Eloy, Silent Cries and Mighty Echoes, The Vision - Burning, 1979
-
Apr 26th, 2003, 03:51 PM
#5
Thread Starter
Frenzied Member
sweet...it worked!
VB Code:
Dim grdColStyle2 As New DataGridTextBoxColumn()
With grdColStyle2
.HeaderText = "Purchase Date"
.MappingName = "purchase_date"
.Alignment = HorizontalAlignment.Center
.ReadOnly = True
.Format = "d"
End With
It's tough being an unhandled exception...
___________
VB.NET 2008
VB.NET 2010
ORACLE 11g
CRYSTAL 11
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
|