Update other column when editing another column

1 Answer 18 Views
GridView
Lothar Rudat
Top achievements
Rank 1
Lothar Rudat asked on 12 Dec 2024, 04:54 AM
Update other column when editing another column

1 Answer, 1 is accepted

Sort by
0
Martin Ivanov
Telerik team
answered on 13 Dec 2024, 10:25 AM

Hello Lothar,

To achieve your requirement, you can update the associated property in the other column, when you update the first column's property. For example:

  public class RowInfo : ViewModelBase
  {
      private string propertyA;
      private string propertyB;

      public string PropertyA
      {
          get { return propertyA; }
          set 
          { 
              propertyA = value;
              OnPropertyChanged(nameof(PropertyA));

              this.PropertyB = "updated value here";
          }
      }


      public string PropertyB
      {
          get { return propertyB; }
          set
          {
              propertyB = value;
              OnPropertyChanged(nameof(PropertyB));
          }
      }
  }


<telerik:GridViewDataColumn DataMemberBinding="{Binding PropertyA}" />
<telerik:GridViewDataColumn DataMemberBinding="{Binding PropertyB}" />

I hope that helps.

Regards,
Martin Ivanov
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.

Tags
GridView
Asked by
Lothar Rudat
Top achievements
Rank 1
Answers by
Martin Ivanov
Telerik team
Share this question
or