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.
Unfortunately, activation email could not send to your email. Please try again.

Customise rendering when AutoGenerateColumns is True

Thread ID:

Created:

Updated:

Platform:

Replies:

120514 Sep 22,2015 07:18 AM Sep 23,2015 10:25 AM WPF 2
loading
Tags: SfDataGrid
Stebay
Asked On September 22, 2015 07:18 AM

This is all for the scenario where the sfDataGrid is bound to a list of entities of the same type.

1) We have some columns that use the data type DateTimeOffset - columns are not displayed for these (but I can see that the event AutoGeneratingColumn *is* fired for the column) presumably because no Renderer has been defined for that data type.

Is it possible to somehow customise the renderer that will be used for that column? eg provide our own renderer like the examples http://help.syncfusion.com/wpf/sfdatagrid/columns#how-to-override-existing-cell-types - but this example is for changing the renderer for an existing data type.  I would instead like to be able to specify a custom renderer for specific columns.

2) Similarly, if we have an entity that has a reference to another entity (or perhaps collection of entities) is it possible (again using AutoGenerateColumns="True") to specify a custom renderer for that column?

eg if the main entity in the grid is:
public class MyEntity() {
   public int ID {get; set;}
   public MyOtherEntity Related {get; set;}
}
public class MyOtherEntity {
  public string Description {get; set;}
}
For instance when displaying a list of MyEntity in the grid, I would like my custom renderer - or any other mechanism - to look up the Description property on the related entity.

Again I can see that the AutoGeneratingColumn event is fired for that column so is it possible to hook into this to customise what's shown for the column?

The reason for needing AutoGenerateColumns="True" is that this needs to be a fairly generic solution.






Stebay
Replied On September 22, 2015 10:12 AM

To add to this - if it's possible in XAML using DataTemplates (but again using AutoGenerateColumns="True" and not specifying the columns in the XAML) then that would also be fine.

Jai Ganesh S [Syncfusion]
Replied On September 23, 2015 10:25 AM

Hi Stephen,


Thank you for using Syncfusion products.


We analyzed your query. A support incident to track the status of this query has been created under your account. Please log on to our support website to check for further updates


https://www.syncfusion.com/account/login?ReturnUrl=/support/directtrac/incidents


Please let me know if you have any questions.


Regards,

Jai Ganesh S


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.

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.

;