gridview 空模版数据显示
我使用了一个gridview空模版,在里面添加了一个dropdownlist,怎么让显示空模版的时候让dropdownlist绑定数据呀,具体用到什么事件...
我使用了一个gridview空模版,在里面添加了一个dropdownlist,怎么让显示空模版的时候让dropdownlist绑定数据呀,具体用到什么事件
展开
5个回答
展开全部
在asp.net 2.0中,在一个gridview里,可以嵌套进一个dropdownlist,这是十分容易的事情,而这里讲的是,
在每个dropdownlist里,都绑定的是不同的内容,比如在northwind数据库中,可以用GRIDVIEW显示出
每个category类别,同时每一行的category类别里可以已dropdonwlist下拉框的形式,列出该分类下的所有
产品.下面介绍实现的方法
首先是页面部分的代码
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" OnRowDataBound="GridView1_RowDataBound" >
<Columns>
<asp:BoundField DataField="CategoryID" HeaderText="CategoryID" />
<asp:BoundField DataField="CategoryName" HeaderText="Category Name" />
<asp:TemplateField HeaderText="Category Name">
<ItemTemplate>
<asp:DropDownList ID="DropDownList2" runat="server"></asp:DropDownList>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Products">
<ItemTemplate>
<asp:DropDownList ID="DropDownList1" runat="server"></asp:DropDownList>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
在codebehind部分,
protected void Page_Load(object sender, EventArgs e)
{
GridView1.DataSource = GetDataSet().Tables[1];//取第二张表Catagories的数据
GridView1.DataBind();
}
//取了二张表,第一张Products 第二张Categories
private DataSet GetDataSet()
{
string query = @"Select p.CategoryID,p.ProductID, p.ProductName FROM Products p
Select c.CategoryID,c.CategoryName FROM Categories c";
string connectionString = ConfigurationManager.ConnectionStrings["northwindconnstr"].ToString();
SqlConnection myConnection = new SqlConnection(connectionString);
SqlDataAdapter ad = new SqlDataAdapter(query, myConnection);
DataSet ds = new DataSet();
ad.Fill(ds);
return ds;
}
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
DataTable myTable = new DataTable();
DataColumn productIDColumn = new DataColumn("ProductID");
DataColumn productNameColumn = new DataColumn("ProductName");
myTable.Columns.Add(productIDColumn);
myTable.Columns.Add(productNameColumn);
DataSet ds = new DataSet();
ds = GetDataSet();
int categoryID = 0;
string expression = String.Empty;
if (e.Row.RowType == DataControlRowType.DataRow)
{
categoryID = Int32.Parse(e.Row.Cells[0].Text);
expression = "CategoryID = " + categoryID;
//找到每一行里的dropdownlist
DropDownList ddl = (DropDownList)e.Row.FindControl("DropDownList1");
//把products表中,对应CategoryID = XX 的记录选出来,并加入MyTable里
DataRow[] rows = ds.Tables[0].Select(expression);
foreach (DataRow row in rows)
{
DataRow newRow = myTable.NewRow();
newRow["ProductID"] = row["ProductID"];
newRow["ProductName"] = row["ProductName"];
myTable.Rows.Add(newRow);
}
ddl.DataSource = myTable;
ddl.DataTextField = "ProductName";
ddl.DataValueField = "ProductID";
ddl.DataBind();
//处理DropDownList2
myTable = ds.Tables[1];//把第二张表提出来
DropDownList dd2 = (DropDownList)e.Row.FindControl("DropDownList2");
dd2.DataSource = myTable;
dd2.DataTextField = "CategoryName";
dd2.DataValueField = "CategoryID";
dd2.DataBind();
for (int i = 0; i < dd2.Items.Count; i++) {
if (Convert.ToInt32(dd2.Items[i].Value) == categoryID)
{
dd2.Items[i].Selected = true;
}
else {
dd2.Items[i].Selected = false;
}
}
}
}
找了篇文章你先看看,这样问题网上有的是,所以......
如果实在不会的话在找我吧.
在每个dropdownlist里,都绑定的是不同的内容,比如在northwind数据库中,可以用GRIDVIEW显示出
每个category类别,同时每一行的category类别里可以已dropdonwlist下拉框的形式,列出该分类下的所有
产品.下面介绍实现的方法
首先是页面部分的代码
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" OnRowDataBound="GridView1_RowDataBound" >
<Columns>
<asp:BoundField DataField="CategoryID" HeaderText="CategoryID" />
<asp:BoundField DataField="CategoryName" HeaderText="Category Name" />
<asp:TemplateField HeaderText="Category Name">
<ItemTemplate>
<asp:DropDownList ID="DropDownList2" runat="server"></asp:DropDownList>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Products">
<ItemTemplate>
<asp:DropDownList ID="DropDownList1" runat="server"></asp:DropDownList>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
在codebehind部分,
protected void Page_Load(object sender, EventArgs e)
{
GridView1.DataSource = GetDataSet().Tables[1];//取第二张表Catagories的数据
GridView1.DataBind();
}
//取了二张表,第一张Products 第二张Categories
private DataSet GetDataSet()
{
string query = @"Select p.CategoryID,p.ProductID, p.ProductName FROM Products p
Select c.CategoryID,c.CategoryName FROM Categories c";
string connectionString = ConfigurationManager.ConnectionStrings["northwindconnstr"].ToString();
SqlConnection myConnection = new SqlConnection(connectionString);
SqlDataAdapter ad = new SqlDataAdapter(query, myConnection);
DataSet ds = new DataSet();
ad.Fill(ds);
return ds;
}
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
DataTable myTable = new DataTable();
DataColumn productIDColumn = new DataColumn("ProductID");
DataColumn productNameColumn = new DataColumn("ProductName");
myTable.Columns.Add(productIDColumn);
myTable.Columns.Add(productNameColumn);
DataSet ds = new DataSet();
ds = GetDataSet();
int categoryID = 0;
string expression = String.Empty;
if (e.Row.RowType == DataControlRowType.DataRow)
{
categoryID = Int32.Parse(e.Row.Cells[0].Text);
expression = "CategoryID = " + categoryID;
//找到每一行里的dropdownlist
DropDownList ddl = (DropDownList)e.Row.FindControl("DropDownList1");
//把products表中,对应CategoryID = XX 的记录选出来,并加入MyTable里
DataRow[] rows = ds.Tables[0].Select(expression);
foreach (DataRow row in rows)
{
DataRow newRow = myTable.NewRow();
newRow["ProductID"] = row["ProductID"];
newRow["ProductName"] = row["ProductName"];
myTable.Rows.Add(newRow);
}
ddl.DataSource = myTable;
ddl.DataTextField = "ProductName";
ddl.DataValueField = "ProductID";
ddl.DataBind();
//处理DropDownList2
myTable = ds.Tables[1];//把第二张表提出来
DropDownList dd2 = (DropDownList)e.Row.FindControl("DropDownList2");
dd2.DataSource = myTable;
dd2.DataTextField = "CategoryName";
dd2.DataValueField = "CategoryID";
dd2.DataBind();
for (int i = 0; i < dd2.Items.Count; i++) {
if (Convert.ToInt32(dd2.Items[i].Value) == categoryID)
{
dd2.Items[i].Selected = true;
}
else {
dd2.Items[i].Selected = false;
}
}
}
}
找了篇文章你先看看,这样问题网上有的是,所以......
如果实在不会的话在找我吧.
参考资料: http://blog.csdn.net/yuehaiyang/archive/2006/07/23/963718.aspx
展开全部
空模版就是没数据时显示,无法绑定数据源数据
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
后台代码:
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
public partial class Default4 : System.Web.UI.Page
{
SqlConnection sqlcon;
string strCon = "Data Source=(local);Database=北风贸易;Uid=sa;Pwd=sa";
protected void Page_Load(object sender, EventArgs e)
{
DropDownList ddl;
if (!IsPostBack)
{
string sqlstr = "select top 5 * from 飞狐工作室";
sqlcon = new SqlConnection(strCon);
SqlDataAdapter myda = new SqlDataAdapter(sqlstr, sqlcon);
DataSet myds = new DataSet();
sqlcon.Open();
myda.Fill(myds, "飞狐工作室");
GridView1.DataSource = myds;
GridView1.DataBind();
for (int i = 0; i <= GridView1.Rows.Count - 1; i++)
{
DataRowView mydrv = myds.Tables["飞狐工作室"].DefaultView[i];
if (Convert.ToString(mydrv["员工性别"]).Trim() == "True")
{
ddl = (DropDownList)GridView1.Rows[i].FindControl("DropDownList1");
ddl.SelectedIndex = 0;
}
if (Convert.ToString(mydrv["员工性别"]).Trim() == "False")
{
ddl = (DropDownList)GridView1.Rows[i].FindControl("DropDownList1");
ddl.SelectedIndex = 1;
}
}
sqlcon.Close();
}
}
public SqlDataReader ddlbind()
{
string sqlstr = "select distinct 员工性别 from 飞狐工作室";
sqlcon = new SqlConnection(strCon);
SqlCommand sqlcom = new SqlCommand(sqlstr, sqlcon);
sqlcon.Open();
return sqlcom.ExecuteReader();
}
前台主要代码:
<asp:GridView ID="GridView1" runat="server" AllowSorting="True" AutoGenerateColumns="False"
CellPadding="3" Font-Size="9pt" BackColor="White" BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px">
<FooterStyle BackColor="White" ForeColor="#000066" />
<Columns>
<asp:BoundField DataField="身份证号码" HeaderText="用户ID" SortExpression="身份证号码" />
<asp:BoundField DataField="姓名" HeaderText="用户姓名" SortExpression="姓名"/>
<asp:TemplateField HeaderText="员工性别">
<ItemTemplate>
<asp:DropDownList ID="DropDownList1" runat="server" DataSource='<%# ddlbind()%>' DataValueField="员工性别" DataTextField="员工性别">
</asp:DropDownList>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="家庭住址" HeaderText="家庭住址" SortExpression="家庭住址"/>
</Columns>
<RowStyle ForeColor="#000066" />
<SelectedRowStyle BackColor="#669999" Font-Bold="True" ForeColor="White" />
<PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Left" />
<HeaderStyle BackColor="#006699" Font-Bold="True" ForeColor="White" />
</asp:GridView>
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
public partial class Default4 : System.Web.UI.Page
{
SqlConnection sqlcon;
string strCon = "Data Source=(local);Database=北风贸易;Uid=sa;Pwd=sa";
protected void Page_Load(object sender, EventArgs e)
{
DropDownList ddl;
if (!IsPostBack)
{
string sqlstr = "select top 5 * from 飞狐工作室";
sqlcon = new SqlConnection(strCon);
SqlDataAdapter myda = new SqlDataAdapter(sqlstr, sqlcon);
DataSet myds = new DataSet();
sqlcon.Open();
myda.Fill(myds, "飞狐工作室");
GridView1.DataSource = myds;
GridView1.DataBind();
for (int i = 0; i <= GridView1.Rows.Count - 1; i++)
{
DataRowView mydrv = myds.Tables["飞狐工作室"].DefaultView[i];
if (Convert.ToString(mydrv["员工性别"]).Trim() == "True")
{
ddl = (DropDownList)GridView1.Rows[i].FindControl("DropDownList1");
ddl.SelectedIndex = 0;
}
if (Convert.ToString(mydrv["员工性别"]).Trim() == "False")
{
ddl = (DropDownList)GridView1.Rows[i].FindControl("DropDownList1");
ddl.SelectedIndex = 1;
}
}
sqlcon.Close();
}
}
public SqlDataReader ddlbind()
{
string sqlstr = "select distinct 员工性别 from 飞狐工作室";
sqlcon = new SqlConnection(strCon);
SqlCommand sqlcom = new SqlCommand(sqlstr, sqlcon);
sqlcon.Open();
return sqlcom.ExecuteReader();
}
前台主要代码:
<asp:GridView ID="GridView1" runat="server" AllowSorting="True" AutoGenerateColumns="False"
CellPadding="3" Font-Size="9pt" BackColor="White" BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px">
<FooterStyle BackColor="White" ForeColor="#000066" />
<Columns>
<asp:BoundField DataField="身份证号码" HeaderText="用户ID" SortExpression="身份证号码" />
<asp:BoundField DataField="姓名" HeaderText="用户姓名" SortExpression="姓名"/>
<asp:TemplateField HeaderText="员工性别">
<ItemTemplate>
<asp:DropDownList ID="DropDownList1" runat="server" DataSource='<%# ddlbind()%>' DataValueField="员工性别" DataTextField="员工性别">
</asp:DropDownList>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="家庭住址" HeaderText="家庭住址" SortExpression="家庭住址"/>
</Columns>
<RowStyle ForeColor="#000066" />
<SelectedRowStyle BackColor="#669999" Font-Bold="True" ForeColor="White" />
<PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Left" />
<HeaderStyle BackColor="#006699" Font-Bold="True" ForeColor="White" />
</asp:GridView>
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
在asp.net 2.0中,在一个gridview里,可以嵌套进一个dropdownlist,这是十分容易的事情,而这里讲的是,
在每个dropdownlist里,都绑定的是不同的内容,比如在northwind数据库中,可以用GRIDVIEW显示出
每个category类别,同时每一行的category类别里可以已dropdonwlist下拉框的形式,列出该分类下的所有
产品.下面介绍实现的方法
首先是页面部分的代码
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" OnRowDataBound="GridView1_RowDataBound"
>
<Columns>
<asp:BoundField DataField="CategoryID" HeaderText="CategoryID" />
<asp:BoundField DataField="CategoryName" HeaderText="Category Name" />
<asp:TemplateField HeaderText="Category Name">
<ItemTemplate>
<asp:DropDownList ID="DropDownList2" runat="server"></asp:DropDownList>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Products">
<ItemTemplate>
<asp:DropDownList ID="DropDownList1" runat="server"></asp:DropDownList>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
在codebehind部分,
protected void Page_Load(object sender, EventArgs e)
{
GridView1.DataSource = GetDataSet().Tables[1];//取第二张表Catagories的数据
GridView1.DataBind();
}
//取了二张表,第一张Products 第二张Categories
private DataSet GetDataSet()
{
string query = @"Select p.CategoryID,p.ProductID, p.ProductName FROM Products p
Select c.CategoryID,c.CategoryName FROM Categories c";
string connectionString = ConfigurationManager.ConnectionStrings["northwindconnstr"].ToString();
SqlConnection myConnection = new SqlConnection(connectionString);
SqlDataAdapter ad = new SqlDataAdapter(query, myConnection);
DataSet ds = new DataSet();
ad.Fill(ds);
return ds;
}
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
DataTable myTable = new DataTable();
DataColumn productIDColumn = new DataColumn("ProductID");
DataColumn productNameColumn = new DataColumn("ProductName");
myTable.Columns.Add(productIDColumn);
myTable.Columns.Add(productNameColumn);
DataSet ds = new DataSet();
ds = GetDataSet();
int categoryID = 0;
string expression = String.Empty;
if (e.Row.RowType == DataControlRowType.DataRow)
{
categoryID = Int32.Parse(e.Row.Cells[0].Text);
expression = "CategoryID = " + categoryID;
//找到每一行里的dropdownlist
DropDownList ddl = (DropDownList)e.Row.FindControl("DropDownList1");
//把products表中,对应CategoryID = XX 的记录选出来,并加入MyTable里
DataRow[] rows = ds.Tables[0].Select(expression);
foreach (DataRow row in rows)
{
DataRow newRow = myTable.NewRow();
newRow["ProductID"] = row["ProductID"];
newRow["ProductName"] = row["ProductName"];
myTable.Rows.Add(newRow);
}
ddl.DataSource = myTable;
ddl.DataTextField = "ProductName";
ddl.DataValueField = "ProductID";
ddl.DataBind();
//处理DropDownList2
myTable = ds.Tables[1];//把第二张表提出来
DropDownList dd2 = (DropDownList)e.Row.FindControl("DropDownList2");
dd2.DataSource = myTable;
dd2.DataTextField = "CategoryName";
dd2.DataValueField = "CategoryID";
dd2.DataBind();
for (int i = 0; i < dd2.Items.Count; i++) {
if (Convert.ToInt32(dd2.Items[i].Value) == categoryID)
{
dd2.Items[i].Selected = true;
}
else {
dd2.Items[i].Selected = false;
}
}
}
}
给你找了篇文章,这问题网上有的是回答的,就不浪费我的脑细胞了.
在每个dropdownlist里,都绑定的是不同的内容,比如在northwind数据库中,可以用GRIDVIEW显示出
每个category类别,同时每一行的category类别里可以已dropdonwlist下拉框的形式,列出该分类下的所有
产品.下面介绍实现的方法
首先是页面部分的代码
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" OnRowDataBound="GridView1_RowDataBound"
>
<Columns>
<asp:BoundField DataField="CategoryID" HeaderText="CategoryID" />
<asp:BoundField DataField="CategoryName" HeaderText="Category Name" />
<asp:TemplateField HeaderText="Category Name">
<ItemTemplate>
<asp:DropDownList ID="DropDownList2" runat="server"></asp:DropDownList>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Products">
<ItemTemplate>
<asp:DropDownList ID="DropDownList1" runat="server"></asp:DropDownList>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
在codebehind部分,
protected void Page_Load(object sender, EventArgs e)
{
GridView1.DataSource = GetDataSet().Tables[1];//取第二张表Catagories的数据
GridView1.DataBind();
}
//取了二张表,第一张Products 第二张Categories
private DataSet GetDataSet()
{
string query = @"Select p.CategoryID,p.ProductID, p.ProductName FROM Products p
Select c.CategoryID,c.CategoryName FROM Categories c";
string connectionString = ConfigurationManager.ConnectionStrings["northwindconnstr"].ToString();
SqlConnection myConnection = new SqlConnection(connectionString);
SqlDataAdapter ad = new SqlDataAdapter(query, myConnection);
DataSet ds = new DataSet();
ad.Fill(ds);
return ds;
}
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
DataTable myTable = new DataTable();
DataColumn productIDColumn = new DataColumn("ProductID");
DataColumn productNameColumn = new DataColumn("ProductName");
myTable.Columns.Add(productIDColumn);
myTable.Columns.Add(productNameColumn);
DataSet ds = new DataSet();
ds = GetDataSet();
int categoryID = 0;
string expression = String.Empty;
if (e.Row.RowType == DataControlRowType.DataRow)
{
categoryID = Int32.Parse(e.Row.Cells[0].Text);
expression = "CategoryID = " + categoryID;
//找到每一行里的dropdownlist
DropDownList ddl = (DropDownList)e.Row.FindControl("DropDownList1");
//把products表中,对应CategoryID = XX 的记录选出来,并加入MyTable里
DataRow[] rows = ds.Tables[0].Select(expression);
foreach (DataRow row in rows)
{
DataRow newRow = myTable.NewRow();
newRow["ProductID"] = row["ProductID"];
newRow["ProductName"] = row["ProductName"];
myTable.Rows.Add(newRow);
}
ddl.DataSource = myTable;
ddl.DataTextField = "ProductName";
ddl.DataValueField = "ProductID";
ddl.DataBind();
//处理DropDownList2
myTable = ds.Tables[1];//把第二张表提出来
DropDownList dd2 = (DropDownList)e.Row.FindControl("DropDownList2");
dd2.DataSource = myTable;
dd2.DataTextField = "CategoryName";
dd2.DataValueField = "CategoryID";
dd2.DataBind();
for (int i = 0; i < dd2.Items.Count; i++) {
if (Convert.ToInt32(dd2.Items[i].Value) == categoryID)
{
dd2.Items[i].Selected = true;
}
else {
dd2.Items[i].Selected = false;
}
}
}
}
给你找了篇文章,这问题网上有的是回答的,就不浪费我的脑细胞了.
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
protected void Page_Load(object sender, EventArgs e)
{
string connstr = System.Configuration.ConfigurationSettings.AppSettings["ConnStr"];
string sqlstr = "SELECT * FROM [workmessage] ";
if (!Page.IsPostBack)
{
SqlConnection connection = new SqlConnection(connstr);
SqlDataAdapter sa = new SqlDataAdapter
(sqlstr, connection);
DataSet ds = new DataSet();
connection.Open();
sa.Fill(ds, "workmessage");
if (ds.Tables[0].Rows.Count == 0)
{
AddDummyData(ds);
}
GridView1.DataSource = ds.Tables["workmessage"];
GridView1.AllowPaging = true;
GridView1.PageSize = 5;
GridView1.DataBind();
connection.Close();
}
}
private void AddDummyData(DataSet ds)
{
// Add a dummy row
DataTable dt = ds.Tables[0];
DataRow newRow = dt.NewRow();
dt.Rows.Add(newRow);
}
protected void CheckBox2_CheckedChanged(object sender, EventArgs e)
{
int i;
if (((CheckBox)sender).Checked)
{
for (i = 0; i < GridView1.Rows.Count; i++)
{
((CheckBox)GridView1.Rows[i].FindControl("CheckBox1")).Checked = true;
}
}
else
{
for (i = 0; i < GridView1.Rows.Count; i++)
{
((CheckBox)GridView1.Rows[i].FindControl("CheckBox1")).Checked = false;
}
}
}
给你段代码参考下吧.
{
string connstr = System.Configuration.ConfigurationSettings.AppSettings["ConnStr"];
string sqlstr = "SELECT * FROM [workmessage] ";
if (!Page.IsPostBack)
{
SqlConnection connection = new SqlConnection(connstr);
SqlDataAdapter sa = new SqlDataAdapter
(sqlstr, connection);
DataSet ds = new DataSet();
connection.Open();
sa.Fill(ds, "workmessage");
if (ds.Tables[0].Rows.Count == 0)
{
AddDummyData(ds);
}
GridView1.DataSource = ds.Tables["workmessage"];
GridView1.AllowPaging = true;
GridView1.PageSize = 5;
GridView1.DataBind();
connection.Close();
}
}
private void AddDummyData(DataSet ds)
{
// Add a dummy row
DataTable dt = ds.Tables[0];
DataRow newRow = dt.NewRow();
dt.Rows.Add(newRow);
}
protected void CheckBox2_CheckedChanged(object sender, EventArgs e)
{
int i;
if (((CheckBox)sender).Checked)
{
for (i = 0; i < GridView1.Rows.Count; i++)
{
((CheckBox)GridView1.Rows[i].FindControl("CheckBox1")).Checked = true;
}
}
else
{
for (i = 0; i < GridView1.Rows.Count; i++)
{
((CheckBox)GridView1.Rows[i].FindControl("CheckBox1")).Checked = false;
}
}
}
给你段代码参考下吧.
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询