What do you want to bind it to? A value from a datasource? A command argument? If you want to show text from your database, you do something like this for example:
There is no sub for button14_click. It should just show edititemtemplate. It shows all the values included update and cancel buttons except this editor that should show data from "Post".
Spontan, I think this one here is related to the other problem with GridView edit showing the Editor, am I right? If so, we should join this thread to the other one.
Spontan23
Member
345 Points
314 Posts
Custom edit button
May 02, 2012 08:02 PM|LINK
Hi,
I have a custom edit button in gridview. How should I bind it?
ammasbhatti
Member
124 Points
22 Posts
Re: Custom edit button
May 02, 2012 08:30 PM|LINK
Hi!
Use Item template for this purpose, and catch button click event in Item command event in gridview.
Just go through these links I hope you will find your answer.
http://www.ezzylearning.com/tutorial.aspx?tid=5066444
http://www.codeproject.com/Articles/19942/ASP-NET-GridView-Image-Command-Button-Problem-Mult
bbcompent1
All-Star
33873 Points
8776 Posts
Moderator
Re: Custom edit button
May 02, 2012 08:32 PM|LINK
What do you want to bind it to? A value from a datasource? A command argument? If you want to show text from your database, you do something like this for example:
<asp:Button ID="Button14" runat="server" commandname="Edit" Text='<% Eval("Fieldname") %>' />Spontan23
Member
345 Points
314 Posts
Re: Custom edit button
May 02, 2012 08:36 PM|LINK
I want to show the edititemtemplate after Button14 click. In the edititemtemplate I have an editor, but after I click edit it shows nothing.
bbcompent1
All-Star
33873 Points
8776 Posts
Moderator
Re: Custom edit button
May 02, 2012 08:40 PM|LINK
can you show us code behind for Button14_Click(object sender, EventArgs e) please?
Spontan23
Member
345 Points
314 Posts
Re: Custom edit button
May 02, 2012 08:52 PM|LINK
There is no sub for button14_click. It should just show edititemtemplate. It shows all the values included update and cancel buttons except this editor that should show data from "Post".
bbcompent1
All-Star
33873 Points
8776 Posts
Moderator
Re: Custom edit button
May 02, 2012 08:55 PM|LINK
Spontan, I think this one here is related to the other problem with GridView edit showing the Editor, am I right? If so, we should join this thread to the other one.