Click here to Skip to main content
12,885,784 members (38,561 online)
Rate this:
Please Sign up or sign in to vote.
See more: C#
Hi I have a Gridview with c# code behind.
I have the gridview AutoGenerateEditButton="True" property set and it generates the column with an 'Edit' link in which is what i am looking to achieve.

There are a couple of changes i would like to make however:
1. The link/word 'Edit' i would like to change to a small icon and keep the same functionality.
2. in the same cell as the 'Edit' i would like to add another small icon that would allow the use to kick of an event (for example to generate a jquery popup for adding a new comment).

Or would it be easier to make a new column with the 'edit' image and onclick cause that to make the row go into edit mode, if so how could i do that any pointers would be great.

can anyone help advise on this please?
Kind regards
Posted 11-Feb-13 4:30am
Updated 11-Feb-13 4:38am
richcb 11-Feb-13 10:38am
You will need to convert the field that contains your edit button into a templated field. This will allow you to change the looks and controls as you wish.
MoiD101 11-Feb-13 10:42am
Hi Rich there is no field with the edit in until it has rendered as i am using the gridview AutoGenerateEditButton="True" property which creates it. (unless i am missing something, ai am very new to coding btw)
richcb 11-Feb-13 10:49am
Are you creating the Gridview dynamically or is it already on your page? If it is already on your page, go into design mode of visual studio and hover over the gridview. Click the smart tag in the upper right-hand corner and click on edit fields. Then select the edit field and click convert to template. Then you go back to the smart tag and edit templates to change the link button to an icon and add the other.
MoiD101 11-Feb-13 10:56am
I have a bunch of template and edititemtemplate controls all pulling data from a sql stored procedure and the edit column is created only when i run the page, so i dont see it in code either on the aspx page or the code behind. so i cannot see it to convert in your description above.
richcb 11-Feb-13 10:58am
I see, well that is going to make it quite a bit more tricky. I will have to defer to someone who is more knowledgeable than I. Sorry I could not be of more assistance.
MoiD101 11-Feb-13 10:59am
thanks Rich.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

    Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web01 | 2.8.170424.1 | Last Updated 11 Feb 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100