Link to home
Start Free TrialLog in
Avatar of Sha1395
Sha1395

asked on

Hyper Link Datagrid view

Hello All,

Eventually i filled all the msmq data in to my datagridview and i have one column is a hyper linked column.

Now am trying to do something like ...every time i click the hyper link column then open the new window and populate the value.

Attached my datagridview with values.

For example my message id : 12345 then i click the hyper link  ,it will open the pop up window then display the Queue value that is "Q1"

Thanks in Advance.


Grid.png
Avatar of veenaravind
veenaravind
Flag of India image

Avatar of jawaharroy
jawaharroy

To open the window in server side (C# or VB.net) use the below statement
<asp:ButtonField ButtonType="Link" DataTextField="Messageid" HeaderText="MessgaeID" CommandName="OpenMessageQueue"/>
In RowCommand event of the grid you need to redirect the openqueue webpage
if (e.CommandName == "OpenMessageQueue")
{
Response.Redirect("openmessagequeue.aspx")
}

handle this in client side you need ajax for this
<asp:TemplateField HeaderText="MessageQueue">
                                    <ItemTemplate>
                                        <asp:LinkButton ID="LinkButton1" runat="server" Text='<%# Bind("MessgeID") %>' ToolTip="Messgae"></asp:LinkButton>
                                        <cc1:ModalPopupExtender ID="ModalPopupExtender1" runat="server" PopupControlID="Panel1"
                                            TargetControlID="LinkButton1" BackgroundCssClass="modalBackground" CancelControlID="imgClose"
                                            OnCancelScript="HideModalPopup()">
                                        </cc1:ModalPopupExtender>
                                    </ItemTemplate>
                                </asp:TemplateField>
Avatar of Sha1395

ASKER

thanks for your reply all,

mine is a windows application.
However you can apply the server side option for your code. linkbutton and Response.redirect use the corresponding syntax for window
ASKER CERTIFIED SOLUTION
Avatar of Sha1395
Sha1395

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Sha1395

ASKER

this is the solution helped me to solve the problem