社区
C#
帖子详情
DataGrid的OnUpate问题
javanow
2002-03-12 12:39:23
我想在一个DataGrid里点编辑后,能出现一个 ListBox行吗?
另外,我想默认出现的 TextBox的TextMode 是TextBoxMode.MultiLine.
好像也不行。
各位高手能帮帮忙吗?
哎,我越来越没信心了
...全文
31
7
打赏
收藏
DataGrid的OnUpate问题
我想在一个DataGrid里点编辑后,能出现一个 ListBox行吗? 另外,我想默认出现的 TextBox的TextMode 是TextBoxMode.MultiLine. 好像也不行。 各位高手能帮帮忙吗? 哎,我越来越没信心了
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
7 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
javanow
2002-03-12
打赏
举报
回复
谢谢 jerryfangsh(傻瓜) 教给我的简单方法
昨天我看sdk都看昏了,跳来跳去~
新版我连给分都不会了,我再试试
javanow
2002-03-12
打赏
举报
回复
非常谢谢 jerryfangsh(傻瓜)
给我的简单的方法。
大家都有
jerryfangsh
2002-03-12
打赏
举报
回复
在使用Templates时,给放在其中的DropDownList一个ID.<BR>
例如:<BR>
<ItemTemplate><BR>
<ASP:DropDownList runat="Server" ID="ddlDropDownList"></ASP:DropDownList>
<ItemTemplate><BR>
然后使用FindControl.<BR>
DropDownList ddlDropDownList1=(DropDownList)e.Item.FindControl("ddlDropDownList");
jdpopo
2002-03-12
打赏
举报
回复
我给一段我自己写的程序你看看吧,不过我没有用DropDownList,我想也应该差不多!或许对你有帮助!
protected void DataGrid1_Update(object sender,System.Web.UI.WebControls.DataGridCommandEventArgs E)
{
int UserID =(int)DataGrid1.DataKeys[(int)E.Item.ItemIndex];
string UserName = ((TextBox)E.Item.Cells[1].Controls[0]).Text;
string Password=((TextBox)E.Item.Cells[2].Controls[0]).Text;
string UserType = ((TextBox)E.Item.Cells[3].Controls[0]).Text;
string UserRole = ((TextBox)E.Item.Cells[4].Controls[0]).Text;
string UserClass = ((TextBox)E.Item.Cells[5].Controls[0]).Text;
string strSql="UPDATE DevUser set UserName='" + UserName + "',Pwd='" + Password + "',UserType='" + UserType + "',UserRole='" + UserRole + "',UserClass='" + UserClass + "' where UserID=" + UserID;
string connstr=ConfigurationSettings.AppSettings["OleDbString"];
OleDbConnection MyConnection=new OleDbConnection(connstr);
MyConnection.Open();
OleDbCommand myCommand2= new OleDbCommand(strSql, MyConnection);
myCommand2.CommandType=CommandType.Text;
myCommand2.ExecuteNonQuery();
DataGrid1.EditItemIndex = -1;
List();
}
javanow
2002-03-12
打赏
举报
回复
我用Template后,倒是出来了一个 DropDownList
在
private void DataGrid_Update(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e)
{
//DropDownList DropDownList1 = (DropDownList)e.Item.Cells[9].Controls[0]; //status code
错误为:无法造型(Cast).
他几个范例我看不懂呀。
我该如何在 DataGrid_Update事件里得到那个 DropDownList 的值呢?
大家再帮帮我好吗?
我一定给分的
karma
2002-03-12
打赏
举报
回复
read the MSDN magazine article
"Understanding Templates in ASP.NET"
http://msdn.microsoft.com/msdnmag/issues/02/01/cutting/cutting0201.asp
for an example
zhq2000
2002-03-12
打赏
举报
回复
一、使用TemplateColumn:
在Property Builder对话框中,将该列换成Template,关闭对话框。
在DataGrid上右击,选编辑Template中的那一列,然后就可以在里面放入你所要的编辑控件。
二、通过事件ItemCreated完成:
在事件中:
if( e.Item.ItemType == ListItemType.EditItem )
{
TextBox t = new TextBox();
t.TextMode = TextMode.MultiLine;
e.Item.Cells[n].Controls.Clear();
e.Item.Cells[n].Controls.Add(t);
// n 为所要的列
}
WPF分页
DataGrid
最近用到WPF的表格控件,需要使用分页功能,找了很多...有些是模仿SL做的DataPager导航条,使用的时候还要和
DataGrid
组合使用,不是很方便。最好还是继承
DataGrid
的分页表格控件。 于是自己动手封装了一个分页表格。
EasyUI
DataGrid
及Pagination(源码)
介绍EasyUI的
DataGrid
数据表格以及Pagination分页 按照说明可直接运行代码. 博文地址:http://blog.csdn.net/itmyhome1990/article/details/37563551
jquery-easyui-1.3.6.zip
datagrid
:"combogrid"编辑器集成到
datagrid
。
datagrid
:添加"ctrlSelect"属性,允许使用ctrl+click 多选 slider:添加"converter"选项,允许用户决定如何将一个值转换为滑块的位置或滑块位置值。 searchbox:添加...
关于同一页面内加载两个easyui的
datagrid
问题
关于同一页面内加载多个easyui的
datagrid
问题
: 1.多个
datagrid
在页面加载时就显示出来,这时直接加载两个表格时是没
问题
的,都显示出来 $(function(){ $("#grid_1").
datagrid
("load",...
easyui 中
datagrid
排序
问题
1.easyui 中
datagrid
排序
问题
当我们设置按照某列排序时,
datagrid
添加属性:sortName:排序的列,sortOder:'ASC'或'DESC',remoteSort:false, 其中remoteSort属性,默认为true,如果对本地数据排序必须设置为...
C#
110,536
社区成员
642,578
社区内容
发帖
与我相关
我的任务
C#
.NET技术 C#
复制链接
扫一扫
分享
社区描述
.NET技术 C#
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
让您成为最强悍的C#开发者
试试用AI创作助手写篇文章吧
+ 用AI写文章