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

Changing the underlying data doesn''t reflect the in the Grid Cell ( in one case ) while row is editing

Hi,
I am using GDBG version 4.4.x.51

Here is my situation and I was wondering if you can suggest an effective workaround so I can avoid brute force implementation to adjust the cell values manually.

Use Case:
I have a grid with Column A and Column B.
When the value of Column A Changes, there will be a default value that will be set for Column B.

For ex. If A is list of Employee names, B is the Address, so when user picks a employee name, I have to go in underlying datarow and set the corresponding address in the DataColumn that is bound to grid column B.

Note that doing this at UI level is not an option for me.

Here are two cases, one works other doesn't:

1) In normal case, any changes to underlying data are getting reflected in UI properly. Meaning if I select a row and change the value in the GridColumn A, GridColumn B will show the value that I set at the data level.

2) However if I manually type something in GridColumn B, Go back to Grid Column A and select something else, GridColumn B is not changing.

Once I get out of row edit mode and repeat step 1) it works as expected.
Step 2) makes it not work again and so on.

I tried calling Refresh and RefreshRange but nothing seems to work.

What I am wondering is if there is another way so I do not have to do the Brute force Cell value setting for column B.

Note that When Grid Column A is changes and tabbed off, next cell might not always be GridColumn B. So refreshes related to CurrentCell won't work in my case.

Please let me know if you can help in anyway ASAP.

Thanks,
Pratima


2 Replies

PR Pratima September 21, 2007 10:44 PM UTC

Waiting for last three days. Please reply!!

>Hi,
I am using GDBG version 4.4.x.51

Here is my situation and I was wondering if you can suggest an effective workaround so I can avoid brute force implementation to adjust the cell values manually.

Use Case:
I have a grid with Column A and Column B.
When the value of Column A Changes, there will be a default value that will be set for Column B.

For ex. If A is list of Employee names, B is the Address, so when user picks a employee name, I have to go in underlying datarow and set the corresponding address in the DataColumn that is bound to grid column B.

Note that doing this at UI level is not an option for me.

Here are two cases, one works other doesn't:

1) In normal case, any changes to underlying data are getting reflected in UI properly. Meaning if I select a row and change the value in the GridColumn A, GridColumn B will show the value that I set at the data level.

2) However if I manually type something in GridColumn B, Go back to Grid Column A and select something else, GridColumn B is not changing.

Once I get out of row edit mode and repeat step 1) it works as expected.
Step 2) makes it not work again and so on.

I tried calling Refresh and RefreshRange but nothing seems to work.

What I am wondering is if there is another way so I do not have to do the Brute force Cell value setting for column B.

Note that When Grid Column A is changes and tabbed off, next cell might not always be GridColumn B. So refreshes related to CurrentCell won't work in my case.

Please let me know if you can help in anyway ASAP.

Thanks,
Pratima



RA Rajagopal Syncfusion Team September 22, 2007 01:17 AM UTC

Hi Pratima,

Please try the below code in the CurrentCellAcceptedChanges event of the GridDataBoundGrid.

void gridDataBoundGrid1_CurrentCellAcceptedChanges(object sender, CancelEventArgs e)
{
this.gridDataBoundGrid1.CurrentCell.EndEdit();
this.gridDataBoundGrid1.Binder.EndEdit();
this.gridDataBoundGrid1.Invalidate();
}

Let me know if this helps.

Regards,
Rajagopal

Loader.
Live Chat Icon For mobile
Up arrow icon