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.
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.
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.
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.
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
I have no control over what is returned by database. I have some meta data based on it I am setting the column style to dropdowncalender so the datatype cannot be changed from string to datetime.