Popup DetailsView on mouseover in gridview

Last post 10-04-2007 9:27 AM by Jonathan Shen – MSFT. 1 replies.

Sort Posts:

  • Popup DetailsView on mouseover in gridview

    09-30-2007, 3:59 PM
    • Member
      12 point Member
    • beachguy_05
    • Member since 09-29-2007, 11:08 PM
    • Posts 3

    I'm trying to define a gridview in a webpart which has a DetailsView control that will appear when a user mouses over an item in the first column of the gridview.

     Currently, I've defined a templatefield for the first column of the gridview.  In this templatefield, I've put a linkbutton which when moused-over, triggers a hovermenuextender which pops up a panel control containing the detailsview   The linkbutton and other columns of the db are populated via db stored proc.  The problem I'm having is that I need to have the text of the linkbutton be sent in as a value to the stored procedure that will populate the detailsview.  Is there anyway to do all of this?  Thanks in advance for any insight


     

  • Re: Popup DetailsView on mouseover in gridview

    10-04-2007, 9:27 AM
    Answer

    Hi Beachguy,

    Based on my experience, I think you should attach a Javascript to the LinkButton's focus.  (LinkButton will be a <a> element on the client) For Example,It is a onclick sample , you should do some modifications.

     protected void Page_Load(object sender, EventArgs e)
        {
            ImageButton myImageButton;
            Button myButton;
            for (int i = 0; i < _list.Items.Count; i++)
            {
                    myImageButton = (ImageButton)_list.Items[i].FindControl("_image");
                    myButton = (Button)_list.Items[i].FindControl("Button1");
                    myImageButton.Attributes.Add("onClick", "changeClick('"+myButton.ClientID+"');return false;");
            }
        }

    Now when the mouse over the LinkButton, the focus event is fired. Then the Javascript function will set the LinkButton's Text to be value of a control which will be sent as a parameter to the procedure.

    I hope this help.

    Best regards,

    Jonathan

     

    Jonathan Shen
    Microsoft Online Community Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Page 1 of 1 (2 items)