如何通过在C#中单击Datagridviewlinkcolumn的单元格来打开新表单? [英] How Do I Open A New Form By Clicking On The Cell Of A Datagridviewlinkcolumn In C# ?
问题描述
我有一个DataGridView,其第一列是DataGridViewLinkColumn。此数据网格视图的行在运行时填充。每当我点击列的链接的蚂蚁,我想要打开一个新的表格。这个新窗体具有控件,这些控件也是在运行时创建的,具体取决于xml文件中的字段,即新窗体从XML文件派生其值。
如何实现此目的? />
任何人都可以给我一个粗略的想法,以便我可以从它的编码部分开始。
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.
推荐答案
private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
{
//CODE HERE!
}
您好,
您可以创建用户控件,因为您可以将其绑定到xml(on usercontrol的页面加载)。这个用户控件你可以链接到gridview列,这样你就可以实现它。
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.
<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 .
这篇关于如何通过在C#中单击Datagridviewlinkcolumn的单元格来打开新表单?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!