Can C1GridView raise the keyboard and mouse events on client side?

Posted by: jetlee on 10 September 2017, 11:39 am EST

  • Posted 10 September 2017, 11:39 am EST

    Can C1GridView raise the mouse DblClick event on client side?
    Can you give me some sample code?
  • Replied 10 September 2017, 11:39 am EST

    Hi JetLee,

    You can add the client-side double click event to the rows of C1GridView in the RowDataBound event, which makes more sense also:

     protected void C1GridView1_RowDataBound(object sender, C1.Web.UI.Controls.C1GridView.C1GridViewRowEventArgs e)
    e.Row.Attributes.Add("ondblclick", "javascript:gridDoubleClick(" + e.Row.RowIndex + ")");

    and the javascript function :

     <script type="text/javascript">
    function gridDoubleClick(index) {
    alert('Row ' + index + ' was double clicked');

    You can even retrieve the values of the particular cells and pass them to the client-side function for eg. e.Row.Cells[2].Text instead of the index.

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels