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.
Unfortunately, activation email could not send to your email. Please try again.

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

Thread ID:

Created:

Updated:

Platform:

Replies:

68343 Sep 18,2007 08:48 PM Sep 21,2007 09:17 PM Windows Forms 2
loading
Tags: GridControl
Pratima
Asked On September 18, 2007 08:48 PM

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


Pratima
Replied On September 21, 2007 06:44 PM

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


Rajagopal [Syncfusion]
Replied On September 21, 2007 09:17 PM

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

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;