Wrox Home  
Search P2P Archive for: Go

  Return to Index  

ado_dotnet thread: Windows DataGrid Nulls


Message #1 by "Carlos Vega Thomas" <vegathomas@p...> on Fri, 28 Feb 2003 22:08:17
In some cases when I have a null value in the Windows DataGrid I get 
the "(null)" legend, but instead of that, I want the DataGrid to display 
blank, like Access.

What can I do?

Carlos Vega
Message #2 by "Duncan C. Ion" <d.ion@d...> on Fri, 28 Feb 2003 22:57:05 -0000
Carlos,
Add the following line to your Page_Init or Page_Load routine:

AddHandler DGrid.ItemDataBound, AddressOf 'YourRoutine'

And, in 'YourRoutine'
....
If e.Item.ItemType = ListItemType.Item Or e.Item.ItemType 
ListItemType.AlternatingItem Then
   For i = 0 To e.Item.Cells.Count - 1
	If e.Item.Cells(i).Text is nothing then e.Item.Cells(i).Text = "
"
   Next i
....

Hth
Duncan.

-----Original Message-----
From: Carlos Vega Thomas [mailto:vegathomas@p...] 
Sent: 28 February 2003 22:08
To: ADO.NET
Subject: [ado_dotnet] Windows DataGrid Nulls

In some cases when I have a null value in the Windows DataGrid I get 
the "(null)" legend, but instead of that, I want the DataGrid to display

blank, like Access.

What can I do?

Carlos Vega
===
Fast Track ADO.NET with C# is a concise introduction to the concepts,
techniques, and libraries that you will need in order to start using
ADO.NET in your applications. The book covers DataSets and Typed
DataSets, accessing data using DataReaders and DataAdaptors, the close
relationship between ADO.NET and XML, how and where to use ADO.NET in
your enterprise applications, and how to use Web Services and ADO.NET to
easily pass data between applications.
http://www.wrox.com/books/1861007604.htm




  Return to Index