Devexpress aspxgridview rowvalidating


NET's native validation inside my ASPx Grid View's edit form template.I do not want to use Dev Ex's validation, but instead have standard ASP.So, how to validate controls that are bound inside Edit Form template on server side?you update or actually before you write the values to the database or each control individually as it loses focus before you can initiate the update?New Values[field Name] = copied Values[field Name]; } } Cell Editor Initialize(编辑器初始化) protected void grid_Cell Editor Initialize(object sender, ASPx Grid View Editor Event Args e) }using Dev Express. Image Url = change protected void grid_Custom Callback(object sender, ASPx Grid View Custom Callback Event Args e) Custom Button Callback(定制按钮的ajax回调处理) protected void grid_Custom Button Callback(object sender, ASPx Grid View Custom Button Callback Event Args e) { if(e.= "Copy") return; copied Values = new Hashtable(); foreach(string field Name in copied Fields) copied Values[field Name] = grid.

All it comes back to client is some message like "Input string was not in a correct format".

I've created a test project based on the provided sources and examined it. The ASPx Grid View's Row Validating event is automatically raised when a row is about to be updated, and allows you to specify whether its data is valid.

Therefore, it's unnecessary to call the ASPx Grid View's Do Row Validation method in the ASPx Grid View's Start Row Editing event handler, because the default new ASPx Grid View's Data Row doesn't contain the initial values (except the case when the initial values have been initialized via the ASPx Grid View's Init New Row event handler).

I'm changing the value of the Shale Play field and the Row Validating event is firing as expected. Note that that might be different than, for instance, the name of the column in your database (depending on how your Grid View is populated).

EDIT: Markup: Where "Bind Grid" above is whatever process / method / code you use to bind data to your aspx Grid View. "Shale Play" is not the name of the field in the datasource that's populating your Grid View.

If it is necessary to do server side validation then I would recommend doing it in the Row Updating and Row Inserting server side event handlers as was recommended by Dev Express. You can validate each of the bound controls' values in the e.

You must have an account to comment. Please register or login here!