change the behaviour of edit button in DataGrid

  • Thread starter Thread starter John M
  • Start date Start date
J

John M

Hello,

In Visual Studio .NET 2003,

I want that when clicking on "edit" within the datagrid,
I want to execute another web form,
which I get the input of the data in the other web form.
i.e : manupulating customers :
in each row of datagrid I have only firstname & lastname,
but when I do click on the "edit" within the datagrid,
I see another form,
that has firstname, family name & phone, address, etc...

How can I do that ?

Need sample code, please.

Thanks :)
 
So you don't really want the "Edit" behavior in the grid and instead what
you want is a HyperlinkColumn like this:

<asp:HyperLinkColumn Text="Edit" DataNavigateUrlField="PKColumn" DataNavigateUrlFormatString="EditPage.aspx?ID={0}"
/>

DataNavigateUrlField is the column from your row in the DB to fill into the
URL. DataNavigateUrlFormatString is the URL for the hyperlink with the {0}
as the substituation parameter from your DataNavigateUrlField. EditPage.aspx
would then need to be coded to look for the ID query string.

-Brock
DevelopMentor
http://staff.develop.com/ballen
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top