(null) in Data Grid

  • Thread starter Thread starter Doug Bell
  • Start date Start date
D

Doug Bell

Hi,
I have a data table that has some Nulls in a field.

How do I get the Data Grid to display a zero length, "", string instead of
"(null)"?

Thanks

Doug
 
Hello
I saw you post this question and there are 2 replies. Did they work ( as I
has the same question)
 
My appologies,
I was working on this the other day and had to go out.
I forgot that I had posted it and just came back to working on it today.
Also didn't set a watch on it but I have found the replies and will
investigate it now.

Thanks
 
This should work..

'dsList <-> is your Dataset
Dim dtView As New DataView(dsList.Tables("TableName"), "", "Colum1
DESC", DataViewRowState.CurrentRows)
DataGrid1.SetDataBinding(dtView, "")

Dim ts1 As DataGridTableStyle = New DataGridTableStyle
ts1.MappingName = "TableName"

Dim TextCol0 As DataGridTextBoxColumn = New DataGridTextBoxColumn
TextCol0.MappingName = "Name" 'Column Name in your Dataset
TextCol0.HeaderText = "My Name"
TextCol0.Width = 200
TextCol0.NullText = ""
ts1.GridColumnStyles.Add(TextCol0)

'Add for other columns

'Finally add the Table style to the DataGrid
DataGrid1.TableStyles.Add(ts1)

VJ
 
Bill,

I am not used this from you.

I did not see it, HS saw that more persons have given an answer on this
question in another thread.
HS
Ken Tucker
Cor Ligthert

The OP said on the answer in this thread HS that he was forgotten the answer
and would investigate that.

In the original message did I give a simple link and Ken a complete sample.

I think that it is not well for a newsgroup when somebody promote not
looking to original answers and with that letting them open.

When you had added your message (which can be seen as an additon) to the
original question you would not have seen this message from me of course.

As I said, I am not used this from you, any reason which I did not see that
you did this?

Cor
 
Cor:

I'm not sure I follow you. I definitely don't intentionally answer
questions after others do. I don't always refresh my newsreader so perhaps
that's the problem. Definitely not trying to step on anyone's toes ;-)
 
Bill,

Maybe your newsreader, yes. But you connected it to the message from Doug
where he said that he would look at the origial answers

However it is not interesting why you did it. Before I was writting the
message I had seen that it was very early(late) again for you when you wrote
it and I had really no pain in my toes from you (as I not had yet) because
maybe that was the reason.

My message was just to prevent that people think that this can be the way to
go (not you). Dough said he made a mistake so we cannot blaim him either.

As I wrote in my previous message, with your message I had not any problem,
it could be seen as an addition.

(When HS had not made us attent on it, I should not have seen it).

Cor
 

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