Click here to Skip to main content
15,893,814 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi I have a asp.net 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
MoiD
Posted
Updated 11-Feb-13 4:38am
v2
Comments
Richard C Bishop 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)
Richard C Bishop 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.
Richard C Bishop 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.

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900