I have a grid view and I show data on grid view from a table.
I want to the same data to be shown which i am showing in grid view in a format of form using table when i click on edit button.
How can i do that in asp.net??
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Dnyandeo ShindePosted Mar 18, 2013, 8:39 AM
Vishal GilbilePosted Mar 15, 2013, 8:15 AM
If your gridview contains TemplateFields then kindly make use of Hyperlink field where you want to display Link on whose click it should redirect to next page passing certain values.
You will have to set the following properties of the Hyperlink field, They are as follows.
HeaderText:= The Text To be displayed as a Column Name Of GridView.
DataTextField:= The Text to be displayed as a Data (link) in the hyperlink column.
DataNavigateUrlFields:= The Column Name whose value you need to pass when the hyperlink is clicked.
and lastly
DataNavigateUrlFormatString:=The name of the page on which to redirect
eg: DataNavigateUrlFormatString=pageName.aspx?eid={0}
the place holder value will automatically be taken from the DataNavigateUrlField property which you specified above.
Hope that solves your problem.
With Regards,
Vishal Gilbile.