Hi Community!
I have a ggc where one of the columns data type is Date in the format of
dd-MMM-yyyy. But when i try to filter by this column (Date To) my application crashes because I'm allowing nulls in a date column. Is there a way to get around a nullable date column ? Any help would be much appreciated!
|
this.gridGroupingControl1.Table.Records[3].SetValue("Date", DBNull.Value); |
Hi
Balamurugan,
Thanks for the help. I have tried to do it your way but the field already has a type of System.DateTime? and I cant' use System.DBNull unfortunately. I've included a screen as to how i am doing it. my data source is binded to a list as well
|
//Event Subscription
this.gridGroupingControl1.QueryCellStyleInfo += GridGroupingControl1_QueryCellStyleInfo;
//Event Customization
private void GridGroupingControl1_QueryCellStyleInfo(object sender, GridTableCellStyleInfoEventArgs e)
{
foreach(var record in gridGroupingControl1.Table.Records)
{
if(record.GetValue("Date") == null)
{
this.gridGroupingControl1.Table.Records[record.GetSourceIndex()].SetValue("Date", DBNull.Value);
}
}
} |