使用复选框和文本框的Gride View Control [英] Gride View Control using checkbox and textbox

查看:59
本文介绍了使用复选框和文本框的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

推荐答案

我真的无法获取您的代码.请浏览文章,它一定会对您有所帮助:
带有文本框,复选框,单选按钮和下拉列表的可编辑Gridview [ ^ ]
I am really not able to get your code. Please have a look on article it will surely help you:
Editable Gridview with Textbox, CheckBox, Radio Button and DropDown List[^]


这篇关于使用复选框和文本框的Gride View Control的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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