By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,033 Members | 1,285 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,033 IT Pros & Developers. It's quick & easy.

(null) in Data Grid

P: n/a
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
Nov 21 '05 #1
Share this Question
Share on Google+
8 Replies


P: n/a
HS1
Hello
I saw you post this question and there are 2 replies. Did they work ( as I
has the same question)
"Doug Bell" <dug@bigpond> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
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

Nov 21 '05 #2

P: n/a
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

"HS1" <so*@slingshot.co.nz> wrote in message news:1096844030.1628@ftpsrv1...
Hello
I saw you post this question and there are 2 replies. Did they work ( as I
has the same question)
"Doug Bell" <dug@bigpond> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
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


Nov 21 '05 #3

P: n/a
VJ
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
"Doug Bell" <dug@bigpond> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
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

Nov 21 '05 #4

P: n/a
Use a DataGridTableStyle, then a DataGridColumnStyle - set the NullText
Property to string.Empty or "".
http://www.knowdotnet.com/articles/cgrid.html
http://msdn.microsoft.com/library/de...classtopic.asp

--
W.G. Ryan MVP (Windows Embedded)

TiBA Solutions
www.tibasolutions.com | www.devbuzz.com | www.knowdotnet.com
"Doug Bell" <dug@bigpond> wrote in message
news:Oh**************@TK2MSFTNGP10.phx.gbl...
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

"HS1" <so*@slingshot.co.nz> wrote in message news:1096844030.1628@ftpsrv1...
Hello
I saw you post this question and there are 2 replies. Did they work ( as I
has the same question)
"Doug Bell" <dug@bigpond> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
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



Nov 21 '05 #5

P: n/a
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
"W.G. Ryan eMVP" <Wi*********@NoSpam.gmail.com>
Use a DataGridTableStyle, then a DataGridColumnStyle - set the NullText
Property to string.Empty or "".
http://www.knowdotnet.com/articles/cgrid.html
http://msdn.microsoft.com/library/de...classtopic.asp

--
W.G. Ryan MVP (Windows Embedded)

TiBA Solutions
www.tibasolutions.com | www.devbuzz.com | www.knowdotnet.com
"Doug Bell" <dug@bigpond> wrote in message
news:Oh**************@TK2MSFTNGP10.phx.gbl...
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

"HS1" <so*@slingshot.co.nz> wrote in message

news:1096844030.1628@ftpsrv1...
> Hello
> I saw you post this question and there are 2 replies. Did they work (
> as I > has the same question)
>
>
> "Doug Bell" <dug@bigpond> wrote in message
> news:%2****************@tk2msftngp13.phx.gbl...
> > 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
> >
> >
>
>



Nov 21 '05 #6

P: n/a
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 ;-)

--
W.G. Ryan, MVP

www.tibasolutions.com | www.devbuzz.com | www.knowdotnet.com
"Cor Ligthert" <no************@planet.nl> wrote in message
news:%2***************@TK2MSFTNGP14.phx.gbl...
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
"W.G. Ryan eMVP" <Wi*********@NoSpam.gmail.com>
Use a DataGridTableStyle, then a DataGridColumnStyle - set the NullText
Property to string.Empty or "".
http://www.knowdotnet.com/articles/cgrid.html
http://msdn.microsoft.com/library/de...classtopic.asp
--
W.G. Ryan MVP (Windows Embedded)

TiBA Solutions
www.tibasolutions.com | www.devbuzz.com | www.knowdotnet.com
"Doug Bell" <dug@bigpond> wrote in message
news:Oh**************@TK2MSFTNGP10.phx.gbl...
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

"HS1" <so*@slingshot.co.nz> wrote in message

news:1096844030.1628@ftpsrv1...
> Hello
> I saw you post this question and there are 2 replies. Did they work (
> as

I
> has the same question)
>
>
> "Doug Bell" <dug@bigpond> wrote in message
> news:%2****************@tk2msftngp13.phx.gbl...
> > 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
> >
> >
>
>



Nov 21 '05 #7

P: n/a
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

Nov 21 '05 #8

P: n/a
;-)

--
W.G. Ryan, MVP

www.tibasolutions.com | www.devbuzz.com | www.knowdotnet.com
"Cor Ligthert" <no************@planet.nl> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
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

Nov 21 '05 #9

This discussion thread is closed

Replies have been disabled for this discussion.