Click here to Skip to main content
15,892,072 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
I want to bind gridview row detail in jquery popup box linkbutton click inside gridview.
Now, popup box show without binding data.My code is the following.Please help me.Thanks in advance.Please quickly answer.
JavaScript
<script type='text/javascript>
        $(function () {
            var overlay = $('<div id="overlay"></div>');
            $('.close').click(function () {
                $('.popup').hide();
                overlay.appendTo(document.body).remove();
                return false;
            });

            $('.x').click(function () {
                $('.popup').hide();
                overlay.appendTo(document.body).remove();
                return false;
            });

            $('.click').click(function () {
                overlay.show();
                overlay.appendTo(document.body);
                $('.popup').show();
                return false;
            });
        });

    </script>

-------In gridview
C#
<asp:TemplateField ItemStyle-BorderColor="#6699ff">
                        <itemtemplate>
                            <asp:LinkButton ID="lbEdit" runat="server" Font-Underline="false" OnClick="lbEdit_Click" CssClass="click">Edit<%--OnClick="lbEdit_Click" --%>
                            <span>|</span>
                            <asp:LinkButton ID="lbDelete" runat="server" Font-Underline="false">Delete
                        </itemtemplate>



------------In linkbutton click event
C#
Protected Sub lbEdit_Click(sender As Object, e As EventArgs)

        Dim gvRow As GridViewRow = CType(CType(sender, Control).Parent.Parent, GridViewRow)
        Dim index As Integer = gvRow.RowIndex
        Dim checkvalue As String

        getvalue = gvFinanceCat.Rows(index).Cells(0).Text
        dt = BusinessLogic.blFinanceTranCategory.FillFinanceCategorybyID(getvalue)

        txtCatName.Text = dt.Rows(0).Item(1).ToString()
        txtDescription.Text = dt.Rows(0).Item(2).ToString()
        checkvalue = dt.Rows(0).Item(3).ToString()
        If checkvalue = "1" Then
            chkIncome.Checked = True
        Else
            chkIncome.Checked = False
        End If     
    End Sub
Posted
Updated 2-Feb-14 23:54pm
v2

1 solution

This example will help you and you can download the code

Display GridView Row details inside jQuery Dialog Modal Popup in ASP.Net

http://www.aspsnippets.com/Articles/Display-GridView-Row-details-inside-jQuery-Dialog-Modal-Popup-in-ASPNet.aspx[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900