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
1445
How do I set a mask on a column?
posted

If I am displaying a digit that is 12 char long. I want to display it as "aaaa-aaaa-aaaa". How do I set the mask in the column of the grid?

Parents
No Data
Reply
  • 469350
    Offline posted

    Hi,

    Assuming your column is a string field and it's always exactly 12 characters long, you could do something like this:


            private void ultraGrid1_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e)
            {
                UltraGridLayout layout = e.Layout;
                UltraGridBand band = layout.Bands[0];
                UltraGridOverride ov = layout.Override;

                band.Columns["String 1"].MaskInput = "AAAA-AAAA-AAAA";
                band.Columns["String 1"].MaskDisplayMode = Infragistics.Win.UltraWinMaskedEdit.MaskMode.IncludeBoth;
            }

Children
No Data