Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Convert Nulls to Blank in dataset/datagrid 1

Status
Not open for further replies.

Trancedified

Programmer
Joined
Apr 28, 2004
Messages
6
Location
US
I have this code:
Code:
strSQL = "SELECT Toc.Name AS [Document Name], ISNULL([ID Number], ''), ISNULL([Last Name], '') FROM TD4"

Supposedly that changes the (nulls) in my datagrid to blanks but instead it's showing 1/1/1900.

Any ideas on how to change it to a blank?

Chris
 
You DataGridColumnStyle.NullText[/] Property, which sets the text that is displayed when the column contains a null reference (Nothing in Visual Basic).

Private Sub SetNullText()
Dim myGridColumn As DataGridColumnStyle
myGridColumn = dataGrid1.TableStyles(0).GridColumnStyles(0)
'This will covert NULL to BLANK.
myGridColumn.NullText = ""
End Sub 'SetNullText



Email: pankajmsm@yahoo.com
 
Ignore the typo's

Use DataGridColumnStyle.NullText Property, which...

Email: pankajmsm@yahoo.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top