StrataFrame Forum

VFP InputMask property for DataGridView

http://forum.strataframe.net/Topic8700.aspx

By Brooks Adair - 5/8/2007

Is there anything like the VFP InputMask property for a DataGridView Cell? I need to be able to set some fields to allow only 2 numeric digits and some that are 3.2. I have found the DefaultCellStyle.Format property but it does not seem to do what I need (unless I am not using it properly)



I have also found the BindingFormat property, but I am not sure how to get a StrataFrame textbox working in a DataGridView.
By StrataFrame Team - 5/9/2007

To use a StrataFrame business object with any sort of grid (or any object that needs an IBindingList object), you need to use the BusinessBindingSource.  Drop a BusinessBindingSource on the form, set the BusinessObject property on the BBS, and then set the BBS as the data soruce for the grid.

As for using a mask on the grid, there is not a way to do it by default, so you'll have to create your own custom column type.  MSDN has a sample on how to do this here:

http://msdn2.microsoft.com/en-us/library/ms180996.aspx