Hi there,
is there any way to set the default year when the radgriddateview is load.??
here my problem: i Have column call "birthday"...i want to set the default year when loaded to 1980..
how i do that..???
I know this is older post. But related to this, is there a way to do it when binding data from a datatable to the grid?
Or is the way to loop thru the columns created and set NullValue
Or is the way to set in cellFormatting if DbNull make value "SOMETHING"
Thanks,
0
Dimitar
Telerik team
answered on 29 Feb 2016, 10:59 AM
Hi Abba,
Thank you for writing.
When the columns are autogenerated you only need to cast the column to the proper type in order to set the NullVallue:
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
foreach (var item in radGridView1.Columns)
{
if (item is GridViewDateTimeColumn)
{
GridViewDateTimeColumn col = item as GridViewDateTimeColumn;
col.NullValue = new DateTime(2000, 1, 1);
}
}
}
I hope this helps.
Regards,
Dimitar
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items