本文介绍了使用复选框和文本框的Gride View Control的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我是asp.net的初学者
我添加了带有文本框和复选框的grideview控件
i Am a beginner of asp.net
i have added the grideview control with textbox and checkbox
protected void Button1_Click(object sender, EventArgs e)
{
StringBuilder sb = new StringBuilder();
StringBuilder sb2 = new StringBuilder();
for (int i = 0; i < GridView1.Rows.Count;i++ )
{
GridViewRow row = GridView1.Rows[i];
//bool isChecked = ((CheckBox)row.FindControl("chkSelect")).Checked;
bool isckecked=((CheckBox)row.FindControl("chkSelect")).Checked;
if (isckecked)
{
sb.Append(GridView1.Rows[i].Cells[2].Text);
TextBox ab = ((TextBox)row.FindControl("txtqty"));
if (ab != null)
{
sb2.Append(ab.Text.ToString());
}
}
}
}
如何在数据库中插入sb和sb2值,那里有sb和sb2组值然后如何插入特定值
how to insert sb and sb2 value in database , sb and sb2 there r group of values then how to insert particular value
推荐答案
这篇关于使用复选框和文本框的Gride View Control的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!