We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to set MaxLength to the GridColumns?

Platform: UWP |
Control: SfDataGrid |
Published Date: January 20, 2016 |
Last Revised Date: January 20, 2016

You can define MaxLength to the GridColumn in display mode by using DisplayBinding and IValueConverter interface as follows.





Note: You can use Converter in Value Binding also as follows.



You can also restrict the MaxLength in edit mode by writing Style to TextBox since MS TextBox will be loaded while editing GridTextColumn.


Please refer the below code snippet.




The MaxLength can be set for a particular column by deriving a new class from GridCellTextBoxRenderer and override the OnInitializeEditElement method with the help of TextBox.MaxLength property as follows.




Sample Links:




2X faster development

The ultimate UWP UI toolkit to boost your development speed.
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile