还未解决如何在网页中需要的地方调用GridView自带的方法(事件) 我的问题是:我不想在GridView内启用编辑按钮。而是想实现在单击或双击Gridview的某一行时就让被点击的行进入编辑状态。请问各位高手怎样解决?谢谢! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 protected void gvHrtugtim_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType != DataControlRowType.Pager) { e.Row.Cells[0].Attributes.Add("style", "display:none"); } if (e.Row.RowType == DataControlRowType.DataRow) { // e.Row.Attributes.Add("onclick", "this.cells[0].childNodes[0].click()"); for (int i = 0; i < gvHrtugtim.Columns.Count; i++) { if ((gvHrtugtim.Columns[i] is CommandField) || (gvHrtugtim.Columns[i] is ButtonField)) { continue; } e.Row.Cells[i].Attributes.Add("onclick", "this.parentElement.cells[0].childNodes[0].click()"); } // e.Row.Cells[0].Attributes.Add("style", "display:none"); } }需要第1列扔一个编辑按钮。 感谢fdlm_dark() 帮我觖答!我再试试看. 新手第五问:关于主键字段如何自动生成? 100分,请大家帮忙解决Visual Studio 2008中为什么只得5个AJAX控件?已经添加了ToolKit.DLL了。 懵了高手帮帮菜鸟 高手进来帮忙~想了很久不晓得怎么办 求一通用分页SQL(不要存储过程)(C#实现)(已解决,公布结果) 关于ComponentArt3.0的中文文挡 急求目录树导航源代码:就像csdn的导航栏, 求javascript高手!谢谢! 动态加载的用户控件中如何设置按钮事件? SQl语句的问题(检索)急急!!在线等!选择出月的记录! 如何时间用户自定义WEB界面 这两天要去复试 ,大家看看有什么要注意的吗
{
if (e.Row.RowType != DataControlRowType.Pager)
{
e.Row.Cells[0].Attributes.Add("style", "display:none");
}
if (e.Row.RowType == DataControlRowType.DataRow)
{
// e.Row.Attributes.Add("onclick", "this.cells[0].childNodes[0].click()");
for (int i = 0; i < gvHrtugtim.Columns.Count; i++)
{
if ((gvHrtugtim.Columns[i] is CommandField) || (gvHrtugtim.Columns[i] is ButtonField))
{
continue;
}
e.Row.Cells[i].Attributes.Add("onclick", "this.parentElement.cells[0].childNodes[0].click()");
}
// e.Row.Cells[0].Attributes.Add("style", "display:none"); } }需要第1列扔一个编辑按钮。