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

GridDataControl - Column with CellTemplate

Hello,

I am using the WPF GriDataControl.
This grid will be used on a touchscreen and therefore I have to modify the CellTemplate.
I added my special contrl to this template and it is visible and I can use it.
But I am not able to bind the value of the Cell to my Control.

Example:








I want to bind the Value of the cell to my Textbox (in the Template).
Is there a way how it can be solved?

Regards
Michael

3 Replies

MS Mohamed Suhaib Fahad A. Syncfusion Team July 31, 2009 01:58 PM UTC

Hi Micheal,

Thanks for using Syncfusion products. You actually have to change a small value in your binding code,





The CellBoundValue gives you the current cell value. You could check out the samples that we provide in the current install.

Please let me know if you need any more details.

Thanks,
Fahad
Grid.WPF Team
Syncfusion Inc.,


MI Michael July 31, 2009 02:56 PM UTC

Hello,

thank you for you fast answer.
Now it displays the value of the cell.
But it works only in one direction. If I change something in this column (which has the textbox as celltemplate) it doesn't update the cellvalue of the grid.
When I enter this cell the next time it displays the old value (and not the value - I entered).

I already set the Binding Mode to TwoWay but it does not update the CellValue when I change the value in the textbox.
How can I solve this problem?

I have had a look at the WPF Sample Browser but there isn't an example referring to the CellTemplate (Version 7.303.020)

Regards
Michael


MS Mohamed Suhaib Fahad A. Syncfusion Team August 3, 2009 05:19 AM UTC

Hi Michael,

Thanks for your feedbacks. For the DataTemplates values to update immediately, you need to set UpdateMode=PropertyChanged in the Grid level.

Please check the below sample,
BoundTemplate-752333618.zip

We do have a DataBound template sample in our install,

\Documents\syncfusion\essentialstudio\7.3.0.20\WPF\Grid.WPF\Samples\3.5\WindowsSamples\Grid Data Control - Advanced\Data Bound Template Demo\CS

But this sample is in read-only mode, because we use anonymous types in the sample. You could just remove that and try playing around with that sample.

Let me know if you need any more details.

Thanks,
Fahad
Grid.WPF Team
Syncfusion Inc.,

Loader.
Live Chat Icon For mobile
Up arrow icon