GridView - Auto end edit checkbox column after value changed

1 Answer 46 Views
GridView
Querijn
Top achievements
Rank 1
Querijn asked on 13 Sep 2023, 12:47 PM

Hi Telerik support,

I have two questions about the gridview checkbox column for WPF, see the sample application.

Just like in WinForms Telerik gridview with .EndEdit,  I want to end the edit and push the value to the viewmodel and have no more edit mode or editor active in the UI. Is there a way to achieve this behaviour?

The other question, when trying to set the EditTriggers in a style (with the intent to implicitly target every GridViewCheckBoxColumn) it straight up ignores it but it works when setting the EditTriggers in the column (see sample). Is this intended?

 

Kind regards,

Querijn

1 Answer, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 14 Sep 2023, 01:00 PM

Hi Querijn,

1. You can use the second approach from the following article: WPF DataGrid - Clicks in the CheckBox Column.

2. In the project it seems that this is working as expected and the property value is set (see attached). 

I hope this helps. Should you have any other questions do not hesitate to ask.

Regards,
Dimitar
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Querijn
Top achievements
Rank 1
commented on 14 Sep 2023, 01:36 PM

Hi Dimitar,

Thank you for your answer.

However, is there a way to make the second approach generic so it can be used in multiple grids without influencing the cell template other columns as the cell template is set on the GridViewDataColumn which is then used by the other columns? The cell template of the checkbox column couldn't be changed when I tried. If possible I would like to set the template in one place.

Kind regards,

Querijn


Dimitar
Telerik team
commented on 15 Sep 2023, 12:03 PM

Hi Querijn,

What comes to my mind is creating a custom column in code behind: WPF DataGrid - Add a Button Column.

Let me know how this works for you.

Tags
GridView
Asked by
Querijn
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Share this question
or