获取在线模态的值并采用主窗体 [英] take the value of an online modal and take the main form

查看:61
本文介绍了获取在线模态的值并采用主窗体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

晚上好,



我有一种咨询基础,它有一个按钮,你点击打开一个带有小型医疗数据网格的模态。



用户将选择一行,表格应该关闭,采取咨询形式从数据网格视图中选择的数据行,



有人可以帮助我吗?

Good evening,

I have a form of consultation base, and it has a button that you click to open a modal with a small medical data grid.

The user will select a row and with that the form should be closed, taking the form of consultation the selected row of data from datagrid view,

Could someone please help me?

推荐答案

解决方案是使用带有标签的单一表单,向导(google .net向导控件) )或进度面板,在这些面板中,您无需打开/关闭新表格即可逐步引导用户。



如果您打开对话框表单,这就是您的方式传递数据。



The solution is to have single form with tabs, wizard (google .net wizard control) or progressing panels in which you lead the user from step to step without opening/closing new forms.

If you're opening dialog forms, this is the way you pass the data.

Public Class MyDialog {
public property DataRowView DoctorToReturn {get;set;}

    protected void btnOK_Click(object sender, EventArgs e) {
    // you'll need casting here
    DoctorToReturn = dgvYourGrid.SelectedRow.DataBoundItem
    
    }
}
public class myForm

//this is the method for opening the dialog (in your case, button click handler)
void openDialog () {
    using (dlg = new myDialog()) {
        if (dlg.ShowDialog() == DialogResult.OK) {
            // use returned value
            doctorObject.Name = dlg.DoctorToReturn["name"];
            doctorObject.Office = dlg.DoctorToReturn["office"]; 
            // map whatever you need from returned object
        }
    }
}


这篇关于获取在线模态的值并采用主窗体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆