Click here to Skip to main content
15,880,796 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I have a DataGridView whose first column is a DataGridViewLinkColumn. The rows of this datagridview is populated at run-time. Whenever i click on ant of the links of the column i want a new form to be opened. This new forms has controls which are also created at run-time depending on the fields in the xml file, i.e. the new form derives its values from a XML file.
How do i accomplish this?
Can anyone give me a rough idea so that i can start with the coding part of it.
Posted

C#
private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
     {

        //CODE HERE!

     }
 
Share this answer
 
Comments
sovit agarwal 22-May-14 4:20am    
Thanx Pineda!!!
But i know this thing....I want bit of help with the underlying code
Zj Pineda 22-May-14 23:10pm    
can you tell me more. i mean what you really want to do after clicking a data cell?
Hi,
You can create user control in that you can bind it to xml (on page load of usercontrol). and this user control you can give link to gridview column , this way you can achieve it.
 
Share this answer
 
Comments
sovit agarwal 22-May-14 3:14am    
Thanks avinash but could you please elaborate a bit more....
The problem i am facing is that - there are different xml files with the same fields but the number of rowws in it varies. So to create a form depending on the no. of rows in xml file is a difficulty.
Could you help out with that
XML
<asp:ModalPopupExtender ID="modalPopupExtender" runat="server" TargetControlID="btnPupupshow"
                        BackgroundCssClass="modalBackground" ClientIDMode="Inherit" PopupControlID="pnlDispControl"
                        DropShadow="true" CancelControlID="btnCancel">
                    </asp:ModalPopupExtender>


btnPupupshow:Id of the grid viewlinkcolumn
pnlDispControl: A panel containing the new form .
 
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