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
close icon

Cut the text in a row this way TE...XT instead of TEXT...

Hello,

i want to cut a text in a row of an datagrid, which is to long for the column, in the middle of the text.

For example: LONGTEXT

At the moment: LONGTE...

I want: LON...EXT

The width of the column is changeable.


1 Reply

RA Rajasekar Syncfusion Team October 14, 2011 01:01 PM UTC

Hi Peter,

Sorry for the inconvenience, we are able to understand your requirement, you are trying to cut the mid chars of the cell value instead of last chars. But, you cannot achieve this requirement.

But, you can able to show the whole cell value even after the value changes to long text, by using ResizeColumnToFit method like below,

Code Snippet[C#]

this.dataGrid.CurrentCellEditingComplete += new Syncfusion.Windows.ComponentModel.GridRoutedEventHandler(dataGrid_CurrentCellEditingComplete);

void dataGrid_CurrentCellEditingComplete(object sender, Syncfusion.Windows.ComponentModel.SyncfusionRoutedEventArgs args)
{
this.dataGrid.Model.ResizeColumnsToFit(GridRangeInfo.Table(), GridResizeToFitOptions.NoShrinkSize);
}

Please let us know if you have any queries.

Thanks,
Rajasekar



Loader.
Live Chat Icon For mobile
Up arrow icon