Gridview Row Selection in ModalPopupExtender [Using VB]

Hello EE!

I need some assistance in implementing the correct script for a gridview control that is displayed using the ModalPopupExtender control. Currently I have a panel that has a gridview control (gv1) and I'm trying to "select" a row and get the datakey for that given row. I've added a RowCommand event to my code behind and using e.CommandArguement.ToString() to get my row value which does work. However, my real concern is a flicker that takes place when I select the row... how can I eliminate this? I want to keep my modal window open without a flicker.

Any guidance or suggestions will be greatly appreciated.
Protected Sub gv1_RowCommand(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewCommandEventArgs) Handles gv1.RowCommand

        If e.CommandName = "Select" Then

            ModalPopupExtender1.Show()

            Dim empID As Integer = e.CommandArgument.ToString()
            Label1.Text = empID.ToString

        End If


    End Sub


=====
.aspx
=====

        <asp:ScriptManager ID="ScriptManager1" runat="server" />
        <asp:Panel ID="PanelOutter" runat="server" CssClass="modalBoxImg" Style="display: none;">
        <div class="modalInner">
        <div class="modalTitle">
        I am ...
        </div>
        <asp:GridView ID="gv1" runat="server" DataKeyNames="EMP_ID" OnRowCommand="gv1_RowCommand">
        <Columns>
        <asp:TemplateField>
            <ItemTemplate>
                <asp:LinkButton ID="selectEmp" runat="server" CommandArgument='<%# Eval("EMP_ID") %>' CommandName="Select">View Details</asp:LinkButton>
            </ItemTemplate>
        </asp:TemplateField>
        </Columns>
        </asp:GridView>
        <asp:Button ID="Process" runat="server" Text="This is me" />
        <asp:Button ID="Cancel" runat="server" Text="Cancel" />
        <asp:Label ID="Label1" runat="server" />
        </div>
        </asp:Panel>
        <asp:Button ID="ShowBtn" runat="server" Text="Button" Style="display: none;" />
        <cc1:ModalPopupExtender ID="ModalPopupExtender1" runat="server" TargetControlID="ShowBtn" CancelControlID="Cancel" PopupControlID="PanelOutter" BackgroundCssClass="bgModal">
        </cc1:ModalPopupExtender>

Open in new window

sk1922Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

masterpassCommented:
Try to wrap the controls with an updatepanel
<asp:UpdatePanel ID="someid" runat="server">
<asp:Panel ID="PanelOutter" runat="server" CssClass="modalBoxImg" Style="display: none;">
        <div class="modalInner">
        <div class="modalTitle">
        I am ...
        </div>
        <asp:GridView ID="gv1" runat="server" DataKeyNames="EMP_ID" OnRowCommand="gv1_RowCommand">
        <Columns>
        <asp:TemplateField>
            <ItemTemplate>
                <asp:LinkButton ID="selectEmp" runat="server" CommandArgument='<%# Eval("EMP_ID") %>' CommandName="Select">View Details</asp:LinkButton>
            </ItemTemplate>
        </asp:TemplateField>
        </Columns>
        </asp:GridView>
        <asp:Button ID="Process" runat="server" Text="This is me" />
        <asp:Button ID="Cancel" runat="server" Text="Cancel" />
        <asp:Label ID="Label1" runat="server" />
        </div>
        </asp:Panel>
        <asp:Button ID="ShowBtn" runat="server" Text="Button" Style="display: none;" />
        <cc1:ModalPopupExtender ID="ModalPopupExtender1" runat="server" TargetControlID="ShowBtn" CancelControlID="Cancel" PopupControlID="PanelOutter" BackgroundCssClass="bgModal">
        </cc1:ModalPopupExtender></asp:UpdatePanel>

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
David RobitailleAnalyst ProgrammerCommented:
masterpass is right but he forgot the "<ContentTemplate>"
<asp:UpdatePanel ID="someid" runat="server"> 
<ContentTemplate>
<asp:Panel ID="PanelOutter" runat="server" CssClass="modalBoxImg" Style="display: none;"> 
        <div class="modalInner"> 
        <div class="modalTitle"> 
        I am ... 
        </div> 
        <asp:GridView ID="gv1" runat="server" DataKeyNames="EMP_ID" OnRowCommand="gv1_RowCommand"> 
        <Columns> 
        <asp:TemplateField> 
            <ItemTemplate> 
                <asp:LinkButton ID="selectEmp" runat="server" CommandArgument='<%# Eval("EMP_ID") %>' CommandName="Select">View Details</asp:LinkButton> 
            </ItemTemplate> 
        </asp:TemplateField> 
        </Columns> 
        </asp:GridView> 
        <asp:Button ID="Process" runat="server" Text="This is me" /> 
        <asp:Button ID="Cancel" runat="server" Text="Cancel" /> 
        <asp:Label ID="Label1" runat="server" /> 
        </div> 
        </asp:Panel> 
        <asp:Button ID="ShowBtn" runat="server" Text="Button" Style="display: none;" /> 
        <cc1:ModalPopupExtender ID="ModalPopupExtender1" runat="server" TargetControlID="ShowBtn" CancelControlID="Cancel" PopupControlID="PanelOutter" BackgroundCssClass="bgModal"> 
        </cc1:ModalPopupExtender>
</ContentTemplate>
</asp:UpdatePanel>

Open in new window

0
sk1922Author Commented:
Awesome! That did it.

I appreciate the insight experts!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.