I feel I'm doing this the hard way, and I'm hoping you can set me straight. I have a grid with EditMode="PopUp" and EditFormType="Template". In this grid's FormTemplate, I have the following save image to click...
<
asp:ImageButton
ID
=
"imgSave"
runat
=
"server"
TabIndex
=
"120"
AlternateText
=
"Save"
ImageUrl
=
"~/images/icons/save-24.jpg"
ToolTip
=
"Save"
CommandName='<%# IIf (TypeOf Container is GridEditFormInsertItem, "PerformInsert", "Update") %>' />
Before it saves, I validate certain data. So in the grid's ItemDataBound event, I assign to the imgSave's "onclick" attribute a javascript function with various control ClientIDs in the popup. If certain conditions fail, javascript gives an alert and does "return false" to keep the popup from closing. If the data is good, I "return true" to let the popup close and refresh the grid's data. It works well.
Now this is where I've goofed up. What I want, is after the grid is rebound/refreshed, I want to highlight the edited row and display certain stats beneath the grid. I've written the code, but don't know how to call it. Is there an event I can tie to my javascript function? (I tried OnActiveRowChanged, but it didn't fire.)
To get around this, just before my "return true" that closes the popup form, I added these two lines of code...
var
f =
function
() { UpdateStatusBar(iKey); };
setTimeout(f, 1000);
return
true
;
Having the 1 second delay gives the grid time to rebind/refresh before calling my UpdateStatusBar function, but that's open to timing issues. What should I do instead?