This is a migrated thread and some comments may be shown as answers.

OnRowClick and AllowRowSelect

1 Answer 75 Views
Grid
This is a migrated thread and some comments may be shown as answers.
DJ
Top achievements
Rank 1
DJ asked on 10 Sep 2008, 08:48 PM
Is it not possible to have both AllowRowSelect and OnRowClick in the ClientSettings?

I can get either one to work properly when the other is not present.  With the setup below the OnRowClick functions, but my clicked row is not highlighted anymore.

<ClientSettings EnablePostBackOnRowClick="true">
<Selecting  AllowRowSelect="True" />
<ClientEvents OnRowClick="OnRowClick" />
</ClientSettings>

<script language="javascript"  type="text/javascript">
function OnRowClick(index)
{
    var ContactId = this.GetCellByColumnUniqueName(this.Rows[index], "ContactId").innerHTML;
    var AccountId = this.GetCellByColumnUniqueName(this.Rows[index], "AccountId").innerHTML;
    var FullName = this.GetCellByColumnUniqueName(this.Rows[index], "FullName").innerHTML;
   
    document.getElementById('<%= hdnContactId.ClientID %>').value = ContactId;
    document.getElementById('<%= hdnAccountId.ClientID %>').value = AccountId;
    document.getElementById('<%= hdnContactName.ClientID %>').value = FullName;
   
    return false;
}
</script>

1 Answer, 1 is accepted

Sort by
0
DJ
Top achievements
Rank 1
answered on 10 Sep 2008, 09:00 PM
I found my problem right after I posted this.  the return false in my javascript function was stopping the row from getting highlighted.
Tags
Grid
Asked by
DJ
Top achievements
Rank 1
Answers by
DJ
Top achievements
Rank 1
Share this question
or