我必须从Checkboxlist中选择多个值并将它们保存在Gridview中.... [英] I have to select more than one value from Checkboxlist and save them in Gridview....
问题描述
我必须从Checkboxlist中选择多个值并将它们保存在Gridview中....
我有复选框列表,其中包含UG,PG,PhD /其中的Mphil值...
我必须从复选框列表中选择多个并在Gridview的单个单元格中显示它们...
怎么做.. 。
I have to select more than one value from Checkboxlist and save them in Gridview....
I have checkboxlist which is having UG,PG,PhD/Mphil values in it...
I have to select more than one from the checkboxlist and display them in single cell of the Gridview...
How to do...
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName == "Edit")
{
int index = Convert.ToInt32(e.CommandArgument);
string Education = GridView1.Rows [index] .Cells [6] .Text.Trim();
if(Education ==Diploma)
{
Edu_ChkBxLst.SelectedItem.Text = GridView1.Rows [index] .Cells [6] .Text.Trim();
}
if(Education) ==UG)
{
Edu_ChkBxLst.SelectedItem.Text = GridView1.Rows [index] .Cells [6] .Text.Trim();
}
if(Education ==PG)
{
Edu_ChkBxLst.SelectedItem.Text = GridView1.Rows [索引] .Cells [6] .Text.Trim();
}
if(Education ==MPhil / PhD)
{
Edu_ChkBxLst.SelectedItem.Text = GridView1.Rows [index] .Cells [6] .Text.Trim();
}
string Education = GridView1.Rows[index].Cells[6].Text.Trim();
if (Education== "Diploma")
{
Edu_ChkBxLst.SelectedItem.Text = GridView1.Rows[index].Cells[6].Text.Trim();
}
if (Education== "UG")
{
Edu_ChkBxLst.SelectedItem.Text = GridView1.Rows[index].Cells[6].Text.Trim();
}
if (Education== "PG")
{
Edu_ChkBxLst.SelectedItem.Text = GridView1.Rows[index].Cells[6].Text.Trim();
}
if (Education== "MPhil/PhD")
{
Edu_ChkBxLst.SelectedItem.Text = GridView1.Rows[index].Cells[6].Text.Trim();
}
推荐答案
使用网格视图的行数据绑定事件。
获取字符串教育后,在复选框列表中搜索它并选择它。
Use row data bind event of grid view.
Get string Education after that search for it in check box list and select it.
这篇关于我必须从Checkboxlist中选择多个值并将它们保存在Gridview中....的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!