Quick background - I have a grid of users that loads some information when a user (row) is selected. If some of that information changes, the page is flagged so that when a new user is picked before saving, a confirmation box appears. Clicking OK discards the changes and selects the new user, Cancel...well, cancels the new user selection. Functionally, this works fine, but even after cancelling the new row is highlighted. How can I stop this?
Relevant code:
It is worth noting that I've tested and checked the data to make sure the select is indeed cancelled.
Edit: Also, I am forced to use Internet Explorer. Could be a factor.
Edit 2: As far as this goes, I have found the problem. I had EnablePostBackOnRowClick="True" in the ClientSettings. This was causing the ItemCommand event to be fired on the server. In ItemCommand, I was doing something with RowClick, and this was the problem. Thanks for your help.
Relevant code:
<
ClientSettings
EnablePostBackOnRowClick
=
"True"
>
<
Selecting
AllowRowSelect
=
"True"
/>
<
Scrolling
UseStaticHeaders
=
"True"
AllowScroll
=
"True"
SaveScrollPosition
=
"True"
/>
<
ClientEvents
OnRowSelecting
=
"rgUsers_RowSelecting"
/>
</
ClientSettings
>
function
rgUsers
_RowSelecting(sender, args)
{
var
changed = $get(
"formChanged"
).value;
if
(changed > 0) {
if
(confirm(
"Your changes will be discarded. Click OK to continue."
))
{
$get(
"hfFormChanged"
).value =
"0"
;
}
else
{
args.set_cancel(
true
);
}
}
}
It is worth noting that I've tested and checked the data to make sure the select is indeed cancelled.
Edit: Also, I am forced to use Internet Explorer. Could be a factor.
Edit 2: As far as this goes, I have found the problem. I had EnablePostBackOnRowClick="True" in the ClientSettings. This was causing the ItemCommand event to be fired on the server. In ItemCommand, I was doing something with RowClick, and this was the problem. Thanks for your help.