I have set the column style to dropdowncalender.
By default it shows "//".
I want to set it to blank. I tried setting the default value to Nothing and "" but the result is the same.
Try to set the Nulltext to string.Empty
setting Nulltext to string.empty the result is same.
Shouldn't it be DateTime? I doubt if the grid could handle this alone. If you set the DataType to DateTime then you get the style as dropdown calendar automatically.
I tried changing the type of DataColumn of datasource and set the type of ultragridcolumn to DateTime. But I have to set the style property of the ultragridcolumn to show the dropdown calender. If I do so "//" appears for empty cells.
p_ultraGridCol.Style = Infragistics.Win.UltraWinGrid.ColumnStyle.DropDownCalendar p_ultraGridCol.DefaultCellValue = String.Empty p_ultraGridCol.NullText = String.Empty
After setting all these properties the result is the same.
Is there any other property that has to be set.
Thanks,
Dibya
Hi Dibya,
I'm afraid I am not following you.
Dibya said:I tried changing the type of DataColumn of datasource and set the type of ultragridcolumn to DateTime. But I have to set the style property of the ultragridcolumn to show the dropdown calender. If I do so "//" appears for empty cells.
If your column's DataType is DateTime, then you do not need to set the Style on the column to DropDownCalendar. The grid will automatically show a dropdown calendar in DateTime cells. In such a case, DropDownCalendar is the default style and setting the style to DropDownCalendar will do nothing.
I tested this out and the default display for a DateTime column which contains null (in this case DBNull.Value, since that's what a DataTable/DataSet uses) displays as an empty cell. There are no separator characters displayed by themselves.
So I am unable to reproduce the issue you describe here. If you can post a small sample project demonstrating this, I'd be happy to take a look.
It seems like once the datasource is set I cannot change the column datatype. So the datatype was still string and so it was displayed like that. Yes, you are right if the datatype is date then ultragrid itself handles it.
Dibya said:It seems like once the datasource is set I cannot change the column datatype
That is correct. The DataType of a bound column comes from the data source. The grid cannot change it. If you cannot change the type of your field in the data source, then the thing to do would be to hide the bound field and add an unbound column whose DataType is DateTime and handle events of the grid to translate the value from the bound column to the unbound column and vice versa.