DEV-aspxgridview EditForm的使用、验证
2015-07-01 16:34
585 查看
相关的连接一:https://search.devexpress.com/?q=aspxgridview%20get%20value%20from%20EditItem&m=SupportCenter
该链接汇总了所有如何从EditForm中获得值的问题的解决方法,但太过于广泛。
相关连接二:https://www.devexpress.com/Support/Center/Example/Details/E1174
通过该程序你可以在后台获得EditForm中aspxcheckbox的值,主要程序为:
相关连接三:https://www.devexpress.com/Support/Center/Example/Details/E1264
该程序讲述了如何对EditForm中的行进行验证,并且错误提示。其中
增加相关行验证的连接:https://www.devexpress.com/Support/Center/Example/Details/E139
以及其演示:http://codecentral.devexpress.com/E139/
该连接演示了行值初始化(不是较为好的方法),对行进行验证,验证失败后显示错误。
添加连接:http://demos.devexpress.com/ASPxGridViewDemos/GridEditing/EditFormTemplate.aspx
该链接演示了EditFormTemplate与EditForm的连用,tab1为自动生成的,tab2为后期添加
相关连接四:https://www.devexpress.com/Support/Center/Example/Details/E25
运行后:http://codecentral.devexpress.com/E25/
改程序是一个很好的EditForm样例,它可以包含许多的其他控件。值得一看。
如何初始化EditForm中各个控件的值
相关连接:https://www.devexpress.com/Support/Center/Question/Details/Q319768
即使用ASPxGridView.CellEditorInitialize 时间,在事件中可使用the e.Editor.Value (e.Column.FieldName == FieldNameHere) 的值获得相应的值
具体方法如下:在ASPxGridView.CellEditorInitialize
方法二:
使用
相关例子:https://www.devexpress.com/Support/Center/Example/Details/E529/
使用FormView的加载为其他的参数进行赋值。
当修改和新建不同时
修改中有不需要修改 ,但需要显示的控件时 应使用
这两事件
相关连接:https://www.devexpress.com/Support/Center/Question/Details/Q281906
连接中有一些连接可以看一下,参考一下
该链接汇总了所有如何从EditForm中获得值的问题的解决方法,但太过于广泛。
相关连接二:https://www.devexpress.com/Support/Center/Example/Details/E1174
通过该程序你可以在后台获得EditForm中aspxcheckbox的值,主要程序为:
private string GetCategoriesFromList() { string categories = string.Empty; //主要是通过改代码获得EditForm中其他控件的属性,第一个参数为控件的列,第二个为所取控件ID, CheckBoxList list = (CheckBoxList)Grid.FindEditRowCellTemplateControl((GridViewDataColumn)Grid.Columns[2], "List"); // workaround if(Grid.IsCallback) LoadListControlPostDataOnCallback(list); foreach(ListItem item in list.Items) { //获取CheckBoxList控件的多个选中值
if(item.Selected) categories += item.Value + CategorySeparator; } if(categories.EndsWith(CategorySeparator)) categories = categories.Substring(0, categories.Length - CategorySeparator.Length); return categories; }
相关连接三:https://www.devexpress.com/Support/Center/Example/Details/E1264
该程序讲述了如何对EditForm中的行进行验证,并且错误提示。其中
ASPxTextBox在行初始化的时候便提示不能为空的验证。
增加相关行验证的连接:https://www.devexpress.com/Support/Center/Example/Details/E139
以及其演示:http://codecentral.devexpress.com/E139/
该连接演示了行值初始化(不是较为好的方法),对行进行验证,验证失败后显示错误。
添加连接:http://demos.devexpress.com/ASPxGridViewDemos/GridEditing/EditFormTemplate.aspx
该链接演示了EditFormTemplate与EditForm的连用,tab1为自动生成的,tab2为后期添加
相关连接四:https://www.devexpress.com/Support/Center/Example/Details/E25
运行后:http://codecentral.devexpress.com/E25/
改程序是一个很好的EditForm样例,它可以包含许多的其他控件。值得一看。
如何初始化EditForm中各个控件的值
相关连接:https://www.devexpress.com/Support/Center/Question/Details/Q319768
即使用ASPxGridView.CellEditorInitialize 时间,在事件中可使用the e.Editor.Value (e.Column.FieldName == FieldNameHere) 的值获得相应的值
具体方法如下:在ASPxGridView.CellEditorInitialize
if (e.Column.FieldName == "DAYS") { ASPxTextBox txt = e.Editor as ASPxTextBox; if (!Grid.IsNewRowEditing) { object val = Grid.GetRowValuesByKeyValue(e.KeyValue, e.Column.FieldName); if (val == null) txt.Value = null; } }
方法二:
使用
<asp:FormView ID="FormView1" runat="server" DataKeyNames="ProductID" OnDataBinding="FormView1_DataBinding">
相关例子:https://www.devexpress.com/Support/Center/Example/Details/E529/
使用FormView的加载为其他的参数进行赋值。
当修改和新建不同时
修改中有不需要修改 ,但需要显示的控件时 应使用
grid_CellEditorInitialize和 ASPxGridView.IsNewRowEditing
这两事件
相关连接:https://www.devexpress.com/Support/Center/Question/Details/Q281906
连接中有一些连接可以看一下,参考一下
相关文章推荐
- asp.net mvc 获取网站的BasePath
- 宏碁Aspire V5-471G笔记本电脑安装MAC OSX Yosemite10.10.3
- .NET跨平台之旅:借助ASP.NET 5 Beta5的新特性显示CLR与操作系统信息
- DEV-aspxgridview行客户端单击双击事件RowClick、RowDblClick 、
- DEV-aspxgridview提示消息!都适用
- 让ASP.NET MVC页面返回不同类型的内容
- 分享 ASP.Net 网站设置 404错误跳转到指定页面的三种方法
- ASP.NET MVC 5 入门摘要
- 检测到在集成的托管管道模式下不适用的 ASP.NET 设置。
- ASP.NET 配置log4net启用写错误日志功能
- 自己不熟悉的ASP.net基础
- C#、asp.net中的一般处理程序.ashx文件重命名问题
- 利用JasperReport+iReport进行Web报表开发
- ASP.Net MVC 数据处理
- 在ASP.NET MVC5应用程序中快速接入QQ和新浪微博OAuth
- ASP.Net MVC Filter验证用户登录
- 在ASP.NET MVC5应用程序中快速接入QQ和新浪微博OAuth
- asp 之 让实体中字段类型为DateTime的字段只显示日期不显示时间
- asp.net中使用Uploadify插件实现多张图片上传,上传后可显示缩略图、删除图片
- 兔子--html,js,php,ASP,ASP.NET,JSP的关系