Gridview rowupdating validation

When displaying a row in edit mode, for any Template Fields their is used instead.(For more background on Grid View Template Fields, see Grid View Examples for ASP."), the database will throw an exception because it cannot cast it to a money value.

gridview rowupdating validation-36

From this control's smart tag click the "Edit Data Bindings" link.

This will bring up a dialog box like the one seen below.

It requires a little more effort, but in most cases these changes can be completed entirely through the Designer or the page's declarative markup.

In this installment we will extend the simplified editing interface from Updating Basics to include validation controls for the As we saw in the Updating Basics article, a Grid View can be made editable when it is bound to a data source control that has updating capabilities enabled.

A Sql Data Source control is configured as such when it has its method is invoked.

From the Visual Studio Designer, the Grid View can be marked as editable by checking the "Enable Editing" checkbox in the Grid View's smart tag or by manually adding a Command Field to the Grid View whose event.

After the event is raised, the Grid View re-renders itself, but with the selected row in edit mode.

The row being edited has each of its columns rendered in their edit mode.

Alternatively, you can enter the binding express by hand in the Custom binding textbox. The Edit Data Bindings dialog box simply injects the appropriate two-way databinding markup into the Web control's declarative syntax.

Tags: , ,