Hi
In my wingrid my columns are dropdowns which are bound to datasourse. These are not dropdownlists, so we can type new values if we want.
Display member is a string and the vaule member is an integer.
Now everything works fine, but when we insert a new row..the default value that comes and sits in the cell is 0(zero). But its misleading to the user as he may think that he has to type only intergers, so i want to replace that default value with blank.
And also i know that, we can format the columns to make it look blank, but zero reappears when the cell is selected(when cell goes to edit mode), even this is not acceptable for me and also those columns are not nullable in database.
So can anyone tell me how to replace the default value 0 with blank.
Thanks in advance
Navi
What's the underlying data type of the field? It sounds like it must be a numeric type if it's defaulting to 0. But if that's the case, then how can the user type anything other than a number into it?
Maybe you could use the DefaultCellValue property on the column to change the default (asssuming the row is being added through the grid and not the data source). Another option might be to use the InitializeTemplateAddRow event - if you are using template add rows.
Thanks for your reply Nick, but it didnot work for me :(
Waiting for the solution..
Not sure this will work for you but you might set the defaultcellvalue to null and then set the nulltext property to "(blank)" or some other descriptive string.
Nick