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
100
Win Grid - limit cell length input
posted

Good afternoon.

Is there a way to limit cell input (length). I would like to limit the length of the cell input based on a drop-down column. For example: if "R" chosen then another cell in the row would be limited to 3 in length. If "T" is chosen then the cell length would become 15. I see you can limit the "column" but I am looking to limit the cell in each row based on the drop-down. In the end, the designated cell in each row might have a different length (3 or 15) dependent upon what was chosen. Thank you for your help.

  • 5520
    Suggested Answer
    posted

      private void ultraGrid1_BeforeCellActivate(object sender, Infragistics.Win.UltraWinGrid.CancelableCellEventArgs e)

            {

                if (e.Cell.Column.Key == "ColumnKey")

                {

                    if (e.Cell.Row.Cells[0].Value.ToString() == "R")

                        e.Cell.Column.MaxLength = 3;

                    else

                        e.Cell.Column.MaxLength = 15;

                }

            }