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

Column Maximum Length

1 Answer 35 Views
Grid
This is a migrated thread and some comments may be shown as answers.
pylacroix
Top achievements
Rank 1
pylacroix asked on 01 Apr 2010, 03:35 PM
Hi is there a way to apply a kind of MaxLength on a GridBoundColumn?

Lest assume you have a very long text like this one

Andrew_received_his_BTS_commercial_in_1974_and_a_Ph_D__in_international_marketing_from_the_University_of_Dallas_in_1981___He_is_fluent_in_French_and_Italian_and_reads_German___He_joined_the_company_as_a_sales_representative,_was_promoted_to_sales_manager_in_January_1992_and_to_vice_president_of_sales_in_March_1993___Andrew_is_a_member_of_the_Sales_Management_Roundtable,_the_Seattle_Chamber_of_Commerce,_and_the_Pacific_Rim_Importers_Association_

Go to http://demos.telerik.com/aspnet-ajax/grid/examples/dataediting/usercontroleditform/defaultcs.aspx
Edit any row.
Paste the text above in the text fields and then click update.

How can we avoid displaying such long lines and breaking the grid?
Is there any mechanism that will display the first x characters followed by ...

ie : Andrew_received_his ...

thanks

Pierre

1 Answer, 1 is accepted

Sort by
0
Accepted
Dimo
Telerik team
answered on 02 Apr 2010, 01:22 PM
Hi Pierre,

Tables normally expand horizontally to fint their content, but you can enforce a column width if you set TableLayout="Fixed" to the MasterTableView. In this way the data, which does not fit and cannot be wrapper to multiple lines, will be clipped by the browser. If you want to display it, you can use a RadToolTip:

http://demos.telerik.com/aspnet-ajax/tooltip/examples/targetcontrolsandajax/defaultcs.aspx?product=grid

Note that column widths must be set with HeaderStyle-Width, not ItemStyle-Width.

Also, when you set TableLayout="Fixed", all columns, which do not have an esplicit width, will become equally wide.

Regards,
Dimo
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Grid
Asked by
pylacroix
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Share this question
or