Some cells I need the mask set just for the time and others I need it for the date and the time and others I need it just for the date.
I'm able to set the mask at the column level but not the cell level. I found this other post that seems to be along the same lines, but not sure. Could you provide a code sample?
http://ko.infragistics.com/community/forums/t/17954.aspx
Thanks,
David
Hi David,
What you do is.. for each mask that you need, create a masked editor control. Any of the masked editors would work, but in your case, it makes sense to use a DateTimeEditor since you are dealing with dates.
Then in the InitializeRow event of the grid, set the EditorControl property of the Cell (not the column) to the DateTimeEditor with the appropriate mask.
Since the grid column has properties to control the mask, you also have to tell the column to use the mask from the editor over it's own mask settings. So you need to set UseEditorMaskSettings on the column to true.
Sorry I took so long to get back to you. Had to leave the office for a road trip.
What you supplied is working great, however, I need to get the Wingrid to display what the Editor is. Is there a way to set the mask on the cell as well in this scenario?
How do I set a mask on a cell at the initialize row event?
Hello David,
Thank you for your response.
Please let me know if the sample project Mike provided earlier has the behavior you're looking for. Also, please provide screenshots so we can get a clearer picture of the issue you're facing.
Please let me know if I may be of further assistance.
Please reread what I've written above after reviewing the enclosed screen shot.
To get the behavior you're looking for, you need to set the FormatString property on the various UltraDateTimeEditor instances as I've done in the attached sample. This property uses the standard .NET string formatting code.
I just realized that the reason it was showing just the time is because I had not removed the text mask on the column. All is good. Thanks to both of your for your help.