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

[Solved] cell max lenght

2 Answers 156 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
1897
Top achievements
Rank 1
1897 asked on 03 Jan 2011, 10:24 AM
Hi,
I have a telerik silverlight rad grid and I need to set max character length to each cell
how to do it in xaml?

regards

2 Answers, 1 is accepted

Sort by
0
Vanya Pavlova
Telerik team
answered on 03 Jan 2011, 05:18 PM
Hi 1897,


There are a couple of approaches you may use. You may define CellTemplate for all columns in your RadGridView, where you can place a TextBox and set its MaxLength property, as shown below:

<telerik:GridViewDataColumn DataMemberBinding="{Binding ZipCode,Mode=TwoWay}" Header="ZipCode">
  <telerik:GridViewDataColumn.CellTemplate>
    <DataTemplate>
         <TextBox Text="{Binding ZipCode,Mode=TwoWay}" MaxLength="75"/>
    </DataTemplate>
   </telerik:GridViewDataColumn.CellTemplate>
</telerik:GridViewDataColumn>

As an alternative you can create an implicit style targeted at GridViewCell and within its ControlTemplate use a single TextBox with this property set.

Best wishes,
Vanya Pavlova
the Telerik team
Browse the videos here>> to help you get started with RadControls for Silverlight
0
1897
Top achievements
Rank 1
answered on 06 Jan 2011, 09:38 AM
good answer!

thanks!
Tags
GridView
Asked by
1897
Top achievements
Rank 1
Answers by
Vanya Pavlova
Telerik team
1897
Top achievements
Rank 1
Share this question
or