This is a migrated thread and some comments may be shown as answers.

Edit current Cell in RadGridView not updating

4 Answers 665 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Ricardo
Top achievements
Rank 1
Ricardo asked on 17 Aug 2018, 10:55 AM

Hello,

I have a RadGridVeiw table with some values, i need to update certain cell values when the user clicks a button.

So far i have:

 

var column = TableGridView.CurrentCell.Column;
 
TableGridView.BeginEdit();
TableGridView.CurrentCell.Value = "test";
TableGridView.Rebind();

 

The value is updated in terms of code, but visually my Radgridview displays the old value.

 

can anyone help me?

 

 

4 Answers, 1 is accepted

Sort by
0
Accepted
Stefan
Telerik team
answered on 21 Aug 2018, 02:53 PM
Hi Ricardo,

The recommended approach for updating a given value is to apply it on data level instead. Thus, you would be able to raise a UI notification from the bound property. You can, for example, get the CurrentItem of the control and update it as needed.

Is there any obstacle to using such an approach?

Regards,
Stefan
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Ricardo
Top achievements
Rank 1
answered on 22 Aug 2018, 09:41 AM

Hi Stefan,

 

I managed to solve my problem by using a customstyle selector, by following the example provided on https://www.telerik.com/forums/radgridview---custom-cell-style-selector

 

Regards

0
Accepted
Stefan
Telerik team
answered on 23 Aug 2018, 10:43 AM
Hello Ricardo,

Thank you for the update.

I am happy to hear that you have managed to meet your requirements.

All the best,
Stefan
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Vadim
Top achievements
Rank 1
Veteran
answered on 09 Jun 2020, 11:24 AM
What if there is an obstacle to updating underlying data source? For example, if editing cell content is done from an attachedbehaviour that is supposed to be agnostic to the viewmodel data type.
Tags
GridView
Asked by
Ricardo
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Ricardo
Top achievements
Rank 1
Vadim
Top achievements
Rank 1
Veteran
Share this question
or