and null fields

  • Thread starter Thread starter Tina
  • Start date Start date
T

Tina

in the itemDatabound event of a datagrid, both null fields and blank string
come through as   in the e.items.cells field. Is there anyway to tell
them apart?
Thanks,
T
 
Not really. The "&" character sequence is used in HTML table cells to
ensure that all browsers will display the cell that is empty. Some browsers
will not draw the cell if it has nothing in it.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Ambiguity has a certain quality to it.
 
Kevin Spencer said:
Not really. The "&" character sequence is used in HTML table cells to
ensure that all browsers will display the cell that is empty. Some
browsers will not draw the cell if it has nothing in it.

Kevin,

I think you meant   :)

Mythran
 
Tina said:
in the itemDatabound event of a datagrid, both null fields and blank
string come through as   in the e.items.cells field. Is there anyway
to tell them apart?
Thanks,
T

Yes there is a way to tell...

If e.Item.ItemType <> ListItemType.Footer AndAlso _
e.Item.ItemType <> ListItemType.Header AndAlso _
e.Item.ItemType <> ListItemType.Separator AndAlso _
e.Item.ItemType <> ListItemType.Pager

' If the data item is a data set, use the following :
Dim ds As DataSet = DirectCast(e.Item.DataItem, DataSet)

' If it's a data table, use the following :
Dim dt As DataTable = DirectCast(e.Item.DataItem.Row, DataRow)
End If

HTH :)

Mythran
 
FYI, I received an execellent solution over in the datagrid forum...

simply look in the source dataset to tell the difference! It's always easy
once you know how.

T
 
By golly, you're right! Hey, it was 6 AM, what can I say?

--
;-),

Kevin Spencer
Microsoft MVP
..Net Developer
Ambiguity has a certain quality to it.
 
Kevin Spencer said:
By golly, you're right! Hey, it was 6 AM, what can I say?

--
;-),

Kevin Spencer
Microsoft MVP
.Net Developer
Ambiguity has a certain quality to it.

Your forgiven...and who's this "golly" fella? Do I want to know? :P

Mythran
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top