Rowupdating textbox

The Grid View looks something like this: If you carefully read the HTML code of the Grid View which I have posted above then you will notice one very special thing.

The Required Field Validator for the Text Box control in the Description column is placed in the Edit Item Template of the Grid View control.

I have done the same thing with the Drop Down List.

Since the Drop Down List is in the Item Template of the Grid View control so I placed the Required Field Validator inside the Item Template right beneath the Drop Down List control.

I know how to update with HTML, But I want in C# How To Update protected void Price Ep_Row Updating(object sender, Grid View Update Event Args e) How to Update with The Help Of Csharp. Regards atul singh in gridview property go to Events there doublic click of Row Updating Event which will automaticall redirect into code behind... But when i used it again this code it returns the old value... In the gridview i set the column for example City column into a template and set the name to txt City. EDIT: I made a little mistake in the previous post: the event handler is Row Updating; Row Updated won't trigger for the life of me. in the above code in "Text Box txtcity = (textbox)row.findcontrol("txtcity");" i'm getting the default value which is not updated, but not updated value.

Inside the Row Updating event u can code for updation ex: Protected Sub Grid View1_Row Updating(By Val sender As Object, By Val e As System.

For this you can add the item dynamically inside the Grid View_Row Data Bound event.If the Cell contains Text Box control, then the Text Box is assigned an ID and a dynamic Required Field Validator is added to the Cell. Now you can ask questions directly to me on my new site ASPForums. Microsoft is conducting an online survey to understand your opinion of the Msdn Web site.I've commented out the VB options that haven't worked and included them here as I've spent too long trying to figure it out. Looks like you are binding the grid in the Page Load. Please add the below code in Page Load before binding the grid..If Not Is Post Back Then Bind the grid End If I guess I didn't check the backend to see that the xml file was updating. I have Bind Grid() at the bottom of the code which re-binds the xml file. Should the value be displayed in a label or a textbox in the normal state (during non edit times.) I've accepted my own comment because hdesouky did identify the correct property to use.

Leave a Reply