How can I capture the state of the grid to remain same when the focus is lost and returned back? For example I want to make the active row remain same when the grid has got its focus back.
whenever the grid lost its focus and comes back into focus then the grid is refreshed and first row is selected, instead I want to make it stay on the same row the customer selected before navigating away from the grid.
any ideas appreciated
Thank you
private void grd_LostFocus(object sender, EventArgs e)
{
int i = this.grd.ActiveRow.Index;
UltraGridRow r = grd.Rows[i];
grd.ActiveRow = r;
}
I tried this but not working...where am I doing wrong in preserving the active row.
Hi Swetha,
It is unexpected that the grid's active row is lost when the control loses focus. Normally, that wouldn't happen.
Can you upload a sample that demonstrates this behavior?
that's all I am doing...bind the grid to datasource and when grid lost focus on that event I am trying retain active row...
As we requested here, here, here, and previously on this thread, we will need more information to assist you with this issue. It is not standard behavior for the grid to lose its active row when losing focus.
Our only conclusion so far is that something else in the application must be causing this. However, it is impossible for us to guess what that might be.
If you are able to upload a sample that demonstrates this issue, we will look into it and help you isolate the cause. If you cannot upload a sample to the forum, let me know and I'll open a private channel.
Please let me know how you choose to proceed.
Hello, I cannot upload a sample. The code is just so interrelated.How can I contact privately?
Swetha
I have contacted you in a private case in order to send this sample. Please find CAS-164257-Y7Q0N9 on your Support Activity page and send the sample through that case.