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
625
Trouble Limiting Maximum Input Length For a Column
posted

I have a column in an UltraGrid that I want to limit to 4000 characters.  I've added code to set the maxLength for the column.

myGrid.DisplayLayout.Bands(0).Columns("TEXT1").MaxLength = 4000

But I'm still able to enter more than 4000.

To try and track this down, I've added an event handler for the Grid's CellChange event to make sure the MaxLength wasn't being reset somewhere else.

As I'm typing into the cell that I want to limit to 4000 characters, the event fires and I run the following:

? ugNote.ActiveCell.Column.MaxLength

And confirm that the maxLength is still 4000.  But I can keep typing, long past the 4000th character.  I can add code to manually enforce the MaxLength here in the event - but I was hoping to avoid that.

 

Have I missed something?  Do I need to 'turn on' the max length enforcement?