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

Text wrapping in edit mode

3 Answers 241 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Datafyer
Top achievements
Rank 1
Veteran
Datafyer asked on 24 Jul 2015, 01:55 AM

I have a grid which displays a text field which can be large. This is set to wrap and does visualize correctly which means that the row height increases to allow the cell text to wrap. However when the cell is edited then the height returns to default, which is essentially one row of text high.

I would like the cell to be able to be edited in wrap mode as well. Is this possible?

3 Answers, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 27 Jul 2015, 03:55 PM
Hello Patrick,

You can achieve this by defining a Style targeting the editor(the default one is a TextBox element) of GridViewDataColumn and set it through EditorStyle property. Please check the code snippet below:
<Style TargetType="TextBox"
       x:Key="TextBoxEditorStyle">
    <Setter Property="TextWrapping" Value="Wrap"/>
</Style>
<telerik:GridViewDataColumn EditorStyle="{StaticResource TextBoxEditorStyle}"/>

Can you please give it a try and let me know should you need further assistance?

Best Regards,
Stefan
Telerik
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 Feedback Portal and vote to affect the priority of the items
0
Datafyer
Top achievements
Rank 1
Veteran
answered on 27 Jul 2015, 11:00 PM

Yes this does work. Thank you very much.

In a future version can this be incorporated automatically or at least through a setting? I would imagine if people visualize in wrapped mode then they would expect to edit in wrapped mode as well.

0
Stefan
Telerik team
answered on 29 Jul 2015, 12:15 PM
Hi Patrick,

I am glad that the proposed solution worked for you.

As to your request, please note, that various editors can be defined for GridViewDataColumn, so handling the TextWrapping property is too specific.

Moreover, even if such logic is added for the default editor of GridViewDataColumn, this may turn into a breaking change for a lot of our clients, so we cannot commit to implementing it.

I suggest you using the approach suggested in my previous post, as using the EditorStyle property of GridViewDataColumn is applicable for any editor defined.

Best Regards,
Stefan
Telerik
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 Feedback Portal and vote to affect the priority of the items
Tags
GridView
Asked by
Datafyer
Top achievements
Rank 1
Veteran
Answers by
Stefan
Telerik team
Datafyer
Top achievements
Rank 1
Veteran
Share this question
or