Re: Interpret empty datagrid cells as empty strings by Thomas
Thomas
Wed Jun 02 04:54:55 CDT 2004
I should have been clearer. When I say "clear a cell", I
mean the user puts the cursor in the cell and deletes all
the text there. Were you thinking I meant I clear it in code?
If you did understand what I intended, then I don't think I
understand your answer. In particular, WHEN do I set the
value to an empty string? As far as I know the datagrid
doesn't raise any events on data modification. I suppose I
could catch each datatable's RowChanged event, scan the
row for nulls I don't want, and set them to empty strings there.
But if that's the best way to do it in VB, I'd rather rewrite my
stored procedures to convert nulls to empty strings.
What I had hoped is for some setting I can make to the
DataColumn (ideally in the DataSet Designer) telling it how to
interpret a blank. Or perhaps a property on the DataGrid's
columnstyle makes more sense. Is there anything like that?
The DataSet designer offers a 'NullValue' property, but I
haven't seen any effect from setting it.
Thomas Berg