我需要在运行时单击gridview行时显示模式弹出窗口,我设法通过单击gridview行显示弹出警报消息但不知道将值绑定到模式弹出窗口中显示的文本框..所以我需要帮助到
将gridview行(单击时)值绑定到模态弹出文本框 只有在单击编辑按钮(位于模态弹出窗口的底部)时,才能编辑模态弹出文本框 编辑完成后,应该在点击保存按钮时保存编辑后的数据(放在编辑按钮旁边的底部) 作为C#的新手,请尽量帮助我提出我的要求。由于下面的代码我能够显示弹出单击gridview行,但建议我如何将值绑定到文本框:
private void childWindow(InspectionResults selectedInspectionResults, ReportMapper reportMapper)
{
List<string> checklistNameList = new List<string>();
for (int checklistIndex = 0; checklistIndex < reportMapper.m_ChecklistInfoList.Count; checklistIndex++)
{
ReportMapper.ChecklistInfo checklistInfo = reportMapper.m_ChecklistInfoList[checklistIndex];
checklistNameList.Add(checklistInfo.m_ChecklistName);
}
Checklist myForm = QuickSearch.ChecklistFinder.GetChecklistById(checklistId);
DataTable taskTable = new DataTable();
// Create the columns.
taskTable.Columns.Add("Id", typeof(int));
// taskTable.Columns.Add("CheckBox", typeof(bool));
CheckBox checkBoxButton = new CheckBox();
checkBoxButton.ID = "selectCheckBoxButton";
checkBoxButton.Checked = false;
// e.Row.Cells[columnNames[columnsCount].clickableIndex].Controls.Add(checkBoxButton);
taskTable.Columns.Add("Description", typeof(string));
//Add data to the new table.
for (int i = 0; i < checklistNameList.Count; i++)
{
DataRow tableRow = taskTable.NewRow();
tableRow["Id"] = i;
// tableRow["selectCheckBoxButton"].
tableRow["Description"] = checklistNameList[i].ToString();
// tableRow["IsComplete"] = false;
taskTable.Rows.Add(tableRow);
}
////Persist the table in the Session object.
Session["TaskTable"] = taskTable;
GridView popup = new GridView();
popup.ID = "selection";
string message = " Correlated Checklists";
string msg = "<SCRIPT LANGUAGE='JavaScript'>alert('" + message + "','toolbar=no,"
+ "location=yes,status=yes,menubar=no,scrollbars=yes,"
+ "resizable=yes, width=850,height=600,left=230,top=23')</SCRIPT>";
Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "scriptBlockName", msg);
return;
}