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.

Getting the grid to behave correctly with DataTemplates

Thread ID:

Created:

Updated:

Platform:

Replies:

101103 Sep 26,2011 09:25 PM Oct 31,2011 04:39 AM WPF 1
loading
Tags: GridControl
Michael Culley
Asked On September 26, 2011 09:25 PM

When I started using the syncfusion grid I was happy to find that I could use it with DataTemplates but this soon turned to frustration when I realised it didn't really work that well with them. The main problem I found was that they had replaced the standard DataContext with "CellBoundValue" and that I had to use this everywhere. At first I didn't consider this to be much of an issue but it soon became apparent that this would mean I would need to define every template I use twice, once for the grid and once for everything else. I found a way to get around this which I think works fairly well but it is still a workaround that I feel should not be necessary. I've posted my solution below. My question is, is this the best way to do things? Am I missing something? Is there a simpler way?

For syncfusion staff, is there any plans to remove the need for this "CellBoundValue"?

I've attached a project for VS2010 that shows my solutions. The first is for when you need to use the default template for an object (see GridContentTemplate). The second is when you want to specify the template to use. In my example, the first column in the grid uses the default template for a Person object but the second column specifies a template. In both cases we avoid the need to litter our templates with references to CellBoundValue and can re-use the template elsewhere.



SFGridTemplates_e0d25f9d.zip

Ramesh V [Syncfusion]
Replied On October 31, 2011 04:39 AM

Hi Michael,

Thanks for your patience.

We have analyzed your requirements with the given sample. And also we have modified your sample to implement the Data Template in a best way.

Please find the modified sample under the following location.

Sample: http://www.syncfusion.com/downloads/Support/DirectTrac/86651/SFGridTemplatesModified237070035.zip

Please let us know if you have any queries.

Regards,
Ramesh



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.

;