G
Guest
Hello Folks!
I have a grid that populates from a table on SQL Server. All datetime with
DBNull value show 1/1/1900 12:00AM ... Instead of just blank ("").
I found a document with the following code, but didn't work.
public void setGridColumnStyle()
{
DataGridColumnStyle newColStyle;
newColStyle = oGrid.TableStyles[0].GridColumnStyles[0];
newColStyle.NullText = "";
}
I tried to customize it to my needs as below:
public void setGridColumnStyle(ref System.Windows.Forms.Grid oGrid, string
sTable, string sColumn)
{
DataGridColumnStyle newColStyle;
newColStyle = oGrid.TableStyles[sTable].GridColumnStyles[sColumn];
newColStyle.NullText = "";
}
I always got an error on second line.
I will appreciate any help to do this.
Carlos Lozano
www.caxonline.net
I have a grid that populates from a table on SQL Server. All datetime with
DBNull value show 1/1/1900 12:00AM ... Instead of just blank ("").
I found a document with the following code, but didn't work.
public void setGridColumnStyle()
{
DataGridColumnStyle newColStyle;
newColStyle = oGrid.TableStyles[0].GridColumnStyles[0];
newColStyle.NullText = "";
}
I tried to customize it to my needs as below:
public void setGridColumnStyle(ref System.Windows.Forms.Grid oGrid, string
sTable, string sColumn)
{
DataGridColumnStyle newColStyle;
newColStyle = oGrid.TableStyles[sTable].GridColumnStyles[sColumn];
newColStyle.NullText = "";
}
I always got an error on second line.
I will appreciate any help to do this.
Carlos Lozano
www.caxonline.net