any specific validations for ipaddress cell in a grid

Hi,

I am using syncfusion gridcontrol for our project.

In the gridcontrol, I have 4 columns and a row.In a cell of the grid, I will enter the IPAddress.I want to know wheather there is any specific validations are available for IPaddress.

Kindly provide a solution for the above issue.

Thanks,
Deepa

3 Replies

RC Rajadurai C Syncfusion Team May 19, 2009 01:04 PM UTC

Hi Deepa,

Thanks for your interest in Syncfusion products.

In our Syncfusion Grid, there is support for holding masked(limited values in specified format) values in cell through celltype "MaskEdit". Please refer to the following code that sets cell(1,1) as "MaskEdit" celltype.

this.gridControl1[1, 1].CellType = "MaskEdit";
GridStyleInfo style = this.gridControl1[1, 1];
GridMaskEditInfo maskstyle = style.MaskEdit;
maskstyle.Mask = "999.999.999.999";

Mask is the property to which the masking format must be set. Here, the number '9' accepts only numbers from 0 to 9 in its place and only 12 numbers can be added.

Regards,
Rajadurai


DE Deepasri May 19, 2009 01:29 PM UTC

Hi Rajadurai,

Thanks for your reply.I have done one test application, As you have mentioned, I have created a cell with celltype as "MaskEdit" and assigned the Mask as "999.999.999.999".It works well, If I give all 12 numbers in the cell.But, if I enter value as "11.1.1.1" and click a button then, my value is becoming as "111.11.."

I have attached the screenshots, before button is clicked and after the button is clicked with the source files for your reference.Please provide solution.

Thanks,
Deepa



MaskEdit_89703315.zip


RC Rajadurai C Syncfusion Team May 20, 2009 03:40 PM UTC

Hi Deepa,

Thanks for your update.

The Mask reserves spaces for characters. If the cell is left without entering the space in-between, the characters are ordered in such a way that blank remains only at the right.

If you don't want this to happen, you can make use of PaddingCharacter property. Please refer to the following code.

this.gridControl1[1, 1].CellType = "MaskEdit";
GridStyleInfo style = this.gridControl1[1, 1];
GridMaskEditInfo maskstyle = style.MaskEdit;
maskstyle.Mask = "999.999.999.999";
maskstyle.PaddingCharacter = '0';


Regards,
Rajadurai

Loader.
Up arrow icon