Solved

gridview changing style of edit button

Posted on 2011-02-17
5
496 Views
Last Modified: 2012-05-11
I want to change the style of the edit button that the gridview supplies.  I can not figure out how to do that.
0
Comment
Question by:kw66722
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 10

Expert Comment

by:daryal
ID: 34924525
you should examine the html generated, and find the edit button.
Then you can write a css directly changing the style of the button.
0
 
LVL 1

Author Comment

by:kw66722
ID: 34931344
This is what is generated.  not sure how I can change it.

<td>
<a href="javascript:__doPostBack('ctl00$ctl00$topbody$GridView1','Edit$0')">Edit</a>
</td>
0
 
LVL 10

Expert Comment

by:daryal
ID: 34934552
can you send the full html?
0
 
LVL 1

Author Comment

by:kw66722
ID: 34935520
This is the generated source.  I put the button after the edit in the format that I would like the edit button to be.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Untitled Page</title>
<link href="App_Themes/sampleTheme/default.css" type="text/css" rel="stylesheet" />
</head>
<body>
    <form name="form1" method="post" action="sample1.aspx" id="form1">
<div>
<input type="hidden" name="__EVENTTARGET" id="__EVENTTARGET" value="" />
<input type="hidden" name="__EVENTARGUMENT" id="__EVENTARGUMENT" value="" />
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="FVOPr/RsBM2y+P0VaI2BM7BqbOAUHQjlDRJzhAV6A0LU6kLGe24ZJMUZWlyiziUwXrza0350Ydz+kGGexij5pV7jglVlGpTO2IXnnjmSQjac5AsGNH+uMHVBQBerL1zbIqK5Maga3e5LqNwYE87Pdl18ERg/a2HylCwpD436JuC/NUpW4sIjPM8wOFwD/UR1QuIrgvMW1M4cqnzJ+rQ3QH1H4ERwxg0JtZay075t5/P9Riqgj/vaPUjz8hKiuqY2hhR459VLffn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DzoF6GwxPDF6jabVl65CT41L8ohfQtaPMFNfaoGbPVtLbogkhcu/zKgrNewL6XaFA/OhGY+5IJZ/i+EbdlZtI7dH3CO5+jWHlJohVpdvi2WPB7pnE0gxhcH1CQMfsBpELmZjXhQ65nTspNgWtXAixrfW2g9ssL+29M7aKqw/frrTGo8gh2eS6lawrtx49hlfX4qf0cHb9HiPFz7Bw/Z6Z9UJYKlDT8SxtzQFaIvCizzJEVJ53Wvd+ndgu9xAK2LA==" />
</div>

<script type="text/javascript">
//<![CDATA[
var theForm = document.forms['form1'];
if (!theForm) {
    theForm = document.form1;
}
function __doPostBack(eventTarget, eventArgument) {
    if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
        theForm.__EVENTTARGET.value = eventTarget;
        theForm.__EVENTARGUMENT.value = eventArgument;
        theForm.submit();
    }
}
//]]>

</script>


<div>

&#9;<input type="hidden" name="__VIEWSTATEENCRYPTED" id="__VIEWSTATEENCRYPTED" value="" />
&#9;<input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION" value="S0v+jfi3hxgHQBxTIfQW9f2FeIc/XS1H+djRn/hj4D1gQUc353eGmjfoDOU+gI9ikkotn8qOxjITNWvsy3cPo8UjwKBn/uIvMkILXzAuiH7K5a+yRIXXT+607r1gZOKkvHqZwIvsqmvKf2cJ+sFKcQMU1D36RFND2Rjl7UtwbIdG6AK4" />
</div>
            
<div>
<br /><br  /><br />
<div>
<table cellspacing="0" rules="all" border="1" id="GridView1" style="border-collapse:collapse;">
<tr>
<th scope="col">&nbsp;</th>
<th scope="col">&nbsp;</th>
<th scope="col" style="font-family:verdana,arial,helvetica;;font-size:9px;">&nbsp;</th>
<th scope="col" style="font-family:verdana,arial,helvetica;;font-size:9px;">First</th>
<th scope="col" style="font-family:verdana,arial,helvetica;;font-size:9px;">Last</th>
<th scope="col" style="font-family:verdana,arial,helvetica;;font-size:9px;">E-Mail</th>
<th scope="col" style="font-family:verdana,arial,helvetica;;font-size:9px;">Type</th>
</tr>
<tr>
<td><a href="javascript:__doPostBack('GridView1','Edit$0')">Edit</a></td>
<td><input type="submit" name="GridView1$ctl02$Edit" value="Save" id="GridView1_ctl02_Edit" style="color:White;background-color:Green;border-color:#F59C34;border-width:1px;border-style:Solid;font-family:arial,verdana,helvetica;font-size:10pt;font-weight:bold;" /></td>
<td style="font-family:verdana,arial,helvetica;font-size:9px;">1</td><td style="font-family:verdana,arial,helvetica;font-size:9px;">&nbsp;</td><td style="font-family:verdana,arial,helvetica;font-size:9px;">&nbsp;</td><td style="font-family:verdana,arial,helvetica;">&nbsp;</td>
<td><select name="GridView1$ctl02$DropDownType" id="GridView1_ctl02_DropDownType">
<option selected="selected" value="-1">Type</option>
</select>  
</td>
</tr>
<tr style="background-color:#99CCFF;">
<td><a href="javascript:__doPostBack('GridView1','Edit$1')">Edit</a></td>
<td><input type="submit" name="GridView1$ctl03$Edit" value="Save" id="GridView1_ctl03_Edit" style="color:White;background-color:Green;border-color:#F59C34;border-width:1px;border-style:Solid;font-family:arial,verdana,helvetica;font-size:10pt;font-weight:bold;" /></td>
<td style="font-family:verdana,arial,helvetica;font-size:9px;">2</td>
<td style="font-family:verdana,arial,helvetica;font-size:9px;">&nbsp;</td>
<td style="font-family:verdana,arial,helvetica;font-size:9px;">&nbsp;</td>
<td style="font-family:verdana,arial,helvetica;">&nbsp;</td>
<td><select name="GridView1$ctl03$DropDownType" id="GridView1_ctl03_DropDownType">
<option selected="selected" value="-1">Type</option>
</select>  
</td>
</tr>
<tr>
<td><a href="javascript:__doPostBack('GridView1','Edit$2')">Edit</a></td>
<td><input type="submit" name="GridView1$ctl04$Edit" value="Save" id="GridView1_ctl04_Edit" style="color:White;background-color:Green;border-color:#F59C34;border-width:1px;border-style:Solid;font-family:arial,verdana,helvetica;font-size:10pt;font-weight:bold;" /></td>
<td style="font-family:verdana,arial,helvetica;font-size:9px;">3</td><td style="font-family:verdana,arial,helvetica;font-size:9px;">&nbsp;</td><td style="font-family:verdana,arial,helvetica;font-size:9px;">&nbsp;</td><td style="font-family:verdana,arial,helvetica;">&nbsp;</td>
<td><select name="GridView1$ctl04$DropDownType" id="GridView1_ctl04_DropDownType">
<option selected="selected" value="-1">Type</option>
</select>  
</td>
</tr>
<tr style="background-color:#99CCFF;">
<td><a href="javascript:__doPostBack('GridView1','Edit$3')">Edit</a></td><td>
<input type="submit" name="GridView1$ctl05$Edit" value="Save" id="GridView1_ctl05_Edit" style="color:White;background-color:Green;border-color:#F59C34;border-width:1px;border-style:Solid;font-family:arial,verdana,helvetica;font-size:10pt;font-weight:bold;" />
 </td><td style="font-family:verdana,arial,helvetica;font-size:9px;">4</td><td style="font-family:verdana,arial,helvetica;font-size:9px;">&nbsp;</td><td style="font-family:verdana,arial,helvetica;font-size:9px;">&nbsp;</td><td style="font-family:verdana,arial,helvetica;">&nbsp;</td><td>
 <select name="GridView1$ctl05$DropDownType" id="GridView1_ctl05_DropDownType">
&#9;&#9;&#9;&#9;<option selected="selected" value="-1">Type</option>

&#9;&#9;&#9;</select>  

</td>
&#9;</tr>
&#9;</table>
</div>
 
    </div>
    </form>
</body>
</html>

Open in new window

0
 
LVL 7

Accepted Solution

by:
mr_nadger earned 500 total points
ID: 35126651
try this link, it has a couple of options

http://forums.asp.net/t/1444568.aspx
0

Featured Post

Get proactive database performance tuning online

At Percona’s web store you can order full Percona Database Performance Audit in minutes. Find out the health of your database, and how to improve it. Pay online with a credit card. Improve your database performance now!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Australian government abolished Visa 457 earlier this April and this article describes how this decision might affect Australian IT scene and IT experts.
When it comes to security, close monitoring is a must. According to WhiteHat Security annual report, a substantial number of all web applications are vulnerable always. Monitis offers a new product - fully-featured Website security monitoring and pr…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

627 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question