OnRowClick and AllowRowSelect

2 posts, 0 answers
  1. DJ
    DJ avatar
    14 posts
    Member since:
    Jan 2008

    Posted 10 Sep 2008 Link to this post

    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>
  2. DJ
    DJ avatar
    14 posts
    Member since:
    Jan 2008

    Posted 10 Sep 2008 Link to this post

    I found my problem right after I posted this.  the return false in my javascript function was stopping the row from getting highlighted.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top