Hi Everyone,
I am back with a new but a little problem. I have a wingrid in which i click on a row it would show its related attributes in a textbox. If i change the attribute value in the textbox and navigate to another row in the grid it should prompt me for the Save Dialog with Yes No Cancel button. The Yes and No button functions perfect but when i click Cancel it shows me the old attribute values of the current row, but the focus is the new row which i clicked in the grid, which gives a odd look that the attribute values showed are mapped to the new row clicked in. The focus sets the new row selected Back Color as Blue and the active row is simply white i need to change this.
Please help me. Thanks in advance
Ferdin
You didn't provide any details about the code behind the Yes/No/Cancel cases, but it sounds like when the user cancels, you should cancel the BeforeRowDeactivate event.
Brain,
I ll explain it more. If I click Yes in the Save Dialog which comes after i navigate from the current row to another row it Saves the changes and then navigates to the new row which i have clicked. Now the textbox contains the attributes of the new row which is selected. If i click No in the Save dialog which comes after i navigate from the current row to the new row the changes are not saved and the attribute value for the new row are displayed. The Cancel button should behave to close the Save Dialog and then show the attributes the current row and also to set the focus to the current row only.
Now what i get is like if i click the Cancel button after changing the attribute in the current row then the changes should not be saved and the attribute should remain the same and also the current row should be focused not the new row which i have clicked.
Hi Ferdin,
I think Brian's suggestion above still applies. If you want to stop the grid from navigating to the new row, you need to handle the grid's BeforeRowDeativate event. This is the event you should use in order to show your Save dialog. If the user clicks Cancel, you simply set e.Cancel to true in this event.
Hi Mike,
It didnt work for me. So i have hard coded a new logic for that and achieved it.
Thanks for the quick reply Mike & Brain