Gridview: Double-click event for cells?

Last post 06-19-2007 5:35 AM by prashanthgajra. 3 replies.

Sort Posts:

  • Gridview: Double-click event for cells?

    11-17-2006, 7:23 PM
    Here is what I want to do. When in edit mode for a row in the gridview control, if the user double-clicks on a cell it will copy the contents of the cell preceeding it into that cell.

    Is this possible?

    Thanks.
  • Re: Gridview: Double-click event for cells?

    11-19-2006, 1:17 PM
    Answer
    • Loading...
    • joteke
    • Joined on 06-16-2002, 11:24 AM
    • Kyro, Finland
    • Posts 6,606
    • ASPInsiders
      Moderator
      TrustedFriends-MVPs

    Hi, 

    I have demonstrated how to develop a row-clickable GridView: http://aspadvice.com/blogs/joteke/archive/2006/01/07/14576.aspx

    By taking that approach and customizing it a little bit, you can get it to tell you what cell (instead of row) was clicked, and after that developing the copy functionality is very very easy.

    Thanks,

    Teemu Keiski
    Finland, EU
  • Re: Gridview: Double-click event for cells?

    04-26-2007, 7:46 AM
    • Loading...
    • anildbest83
    • Joined on 03-01-2007, 6:04 AM
    • Chandigarh
    • Posts 37

    hi

    I want to open a popup window by double cilicking on gridview row

    Is it possible

    Pls roly soon

    Thanks

     

    Anil
  • Re: Gridview: Double-click event for cells?

    06-19-2007, 5:35 AM

    Please write this code in the RowDataBound event of gridview. This will enable a popup to come up when you double click on a gridview row.

     e.Row.Attributes.Add("ondblclick", "javascript:return GetJobID('" + e.Row.Cells[0].Text.Replace("'", "''") + "');this.style.font='Italic 12pt helvetica';this.style.color = 'Gray';");

    The javascript function will look like this

     

    function ShowAuditLog(JobId)

    {

    var sURL = 'DisplayAudit.aspx?JobID=' + JobId;

    myWindow = window.open(sURL, 'Current_Audit_Log','toolbar=no,menubar=no,resizable=no,scrollbars=yes,status=no,location=no,width=800,height=600');

    myWindow.moveTo(75,50);

    return false;

    }

     

    function GetJobID(RowIndex)

    {

    ShowAuditLog(RowIndex);

    }

     

    I hope this will resolve your query.

Page 1 of 1 (4 items)
Microsoft Communities
Page view counter