Dear all,
In the ultragrid1, there is a datetime field named as "EXPIRY_DATE". How to make it show as empty when it is null or it is DateTime.MinDateTime. I am trying to assign null value to it, but it throw exception. Is there any other method without amending the datetime field to be string??
private void ultragrid1_InitializeRow(object sender, Infragistics.Win.UltraWinGrid.InitializeRowEventArgs e) { if (Convert.ToDateTime(e.Row.Cells["EXPIRY_DATE"].Value) == DateTime.MinValue) e.Row.Cells["EXPIRY_DATE"].Value = null; // it throws exception that cannot convert }
If you are getting an exception when setting the cell value to null, it's most likely because the DataSource you are binding to the grid does not allow nulls for that field.
What kind of data source are you using?
I am just using DataSet returning from the function. What can I do then??
this.ugdRMA.DataSource =StaticUtil.GetDataset_RMAItems(this.RMAList, false);
public static DS_RMAItems GetDataset_RMAItems(StoreServer.VO.Item.ItemReturnedInventoryListVO rmaList, bool hist) { DS_RMAItems crDS = new DS_RMAItems(); DS_RMAItems.DT_RMA_ITEMSRow dr;
........................