Does anyone have suggestions on how to handle the following?
We have a grid that binds to an class that contains a datetime object. When the datetime is null we set it to System.Data.SqlTypes.SqlDateTime.MinValue.Value. When the datetime is equivalent to this value, we make the cell blank for display. But when we are editing a row, the MinValue displays again for all rows except the one we are editing. Once you hit update, it goes back to a blank field.
What we need some help with is how to iterate through the grid and make this field blank during the edit. If we try and do
foreach( DataGridItem GridItem in ctrlDataGrid.Items )
we get an error on the field that we are editing for the field we are trying to modify.
Or if anyone knows how to make a datetime property of an object null that would be helpful too. We have not been able to find a way to do this by searching online.
Thank you in advance.
We have a grid that binds to an class that contains a datetime object. When the datetime is null we set it to System.Data.SqlTypes.SqlDateTime.MinValue.Value. When the datetime is equivalent to this value, we make the cell blank for display. But when we are editing a row, the MinValue displays again for all rows except the one we are editing. Once you hit update, it goes back to a blank field.
What we need some help with is how to iterate through the grid and make this field blank during the edit. If we try and do
foreach( DataGridItem GridItem in ctrlDataGrid.Items )
we get an error on the field that we are editing for the field we are trying to modify.
Or if anyone knows how to make a datetime property of an object null that would be helpful too. We have not been able to find a way to do this by searching online.
Thank you in advance.