Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
225
Format and Maskinput for input of an IP-Address in ultraGrid
posted

Hello,

I´m using "Infragistics NetAdvantage for .Net 2008 Volume 3 CLR 2.0". In my application i have an ultraGrid. The DataSource is directly bound to an DB.

Now I must enter an IP-Addresse in one Cell likte this: "192.168.10.155".

The MaskInput-Property I have set to "nnn\\.nnn\\.nnn\\.nnn". It the looks pretty good in edit mode. But the same string doesn´t work for Format-Property. I also have no range limit (the max value for every number should be 255, eg. "255.255.255.255").

How can I program this? Is there an easy solution to enter and show an IP-Address? Something like an control I can add to the cell?

The data-format of the DB of the cell is actually an string, but it can be changed.

I would be greatful of any help. Thanks

Parents
No Data
Reply
  • 469350
    Verified Answer
    Offline posted

    Hi,

    MaskInput only applies when the cell is in edit mode. Hence the word "Input". :)

    Typically, what you would do is use MaskInput for the input mask when the cell is in edit mode and use the Format property of the column to control the display when the cell is not in edit mode.

    Format won't work for you in this case, though, for two reasons. First, the string data type doesn't support any formatting. And second, there are no numeric formats in DotNet, as far as I know, that can handle multiple decimal points like for an IP address.

    So what I recommend is that you set the MaskDisplayMode on the column to MaskMode.IncludeLiteralsWithPadding.

Children