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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Using Converter with Columns

Thread ID:

Created:

Updated:

Platform:

Replies:

123438 Mar 17,2016 11:53 AM UTC Mar 18,2016 05:44 PM UTC Xamarin.Forms 2
loading
Tags: SfDataGrid
Jens Bohrmann
Asked On March 17, 2016 11:53 AM UTC

Hi,

I have a DataGrid populated by a sylite database. The data is displayed correctly.
I have the proble, that one of my columns contains GUIDs that are very long.
In other parts of my app I use a converter to shorten the GUID-string.
Is it possible to use Converters for grid-columns?
I checked auto generated columns and I tried GridTextColumns.
But I did not find a way to use a Converter.

Thanks

Jens

Sathya Lakshmanan [Syncfusion]
Replied On March 18, 2016 05:42 PM UTC

Hi Jens,

Thank you for contacting Syncfusion support.

We have analyzed your requirement. Yes, is it possible to use converters for a GridColumn. Your requirement can be achieved by using the DisplayBinding property of a GridColumn and writing a converter for the Binding of the column. You will get the cell value as an argument in the converter and you can return the value to be displayed in the cell as per your requirement.

For your reference, we have prepared a sample based on your requirement in which we have returned only the first name of the UserName column it the cell value exceeds 12 characters. You can download the sample from the below link and modify it based on your requirements.

Sample link: http://www.syncfusion.com/downloads/support/directtrac/123438/ze/SampleDemo680279867

Regards,
Sathya.


Sathya Lakshmanan [Syncfusion]
Replied On March 18, 2016 05:44 PM UTC

Hi Jens,

Thank you for contacting Syncfusion support.

We have analyzed your requirement. Yes, is it possible to use converters for a GridColumn.Your requirement can be achieved by using the DisplayBinding property of a GridColumn and writing a converter for the Binding of the column. You will get the cell value as an argument in the converter and you can return the value to be displayed in the cell as per your requirement.

For your reference, we have prepared a sample based on your requirement in which we have returned only the first name of the UserName column it the cell value exceeds 12 characters. You can download the sample from the below link and modify it based on your requirements.

Sample link: http://www.syncfusion.com/downloads/support/directtrac/123438/ze/SampleDemo680279867

Regards,
Sathya.


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

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

;