This is a migrated thread and some comments may be shown as answers.

How to set a column MaxLength?

1 Answer 58 Views
GridView
This is a migrated thread and some comments may be shown as answers.
SchaF
Top achievements
Rank 1
SchaF asked on 30 Jan 2012, 06:35 PM
Ive got this gridview that Im populating with data and being allowed to edit and insert. I want to make it so when the user is inserting or editing a column's cell, the maximum (char) length is set based on a control records max length. So far Ive only been able to set the MaxWidth, but that doesnt help me because the column header is always longer than the atual text allowed, and the MaxWidth sets the column width in pixels, no the columns editing max character length. Can someone point me in the right direction. I can provide some code if need be.

Ive also tried setting it to

column.CellEditTemplate.SetValue(TextBoxEditor.MaxLengthProperty, MYMAXLENGTH);


but it gives me an error.

1 Answer, 1 is accepted

Sort by
0
SchaF
Top achievements
Rank 1
answered on 30 Jan 2012, 10:45 PM
Problem has been solved. Never mind.
Tags
GridView
Asked by
SchaF
Top achievements
Rank 1
Answers by
SchaF
Top achievements
Rank 1
Share this question
or