Solved

gridview changing style of edit button

Posted on 2011-02-17
5
476 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
  • 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/vaPUjz8hKiuqY2hhR459VLffnyUGurCNcLfzNLmTgaHTAH+vE7NIjow25z/L/L7SYxU0hhPHA3uO1Aaky00Qh/CfEvdpRqNNgCaDBlT3OoY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tI7dH3CO5+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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Get to know the ins and outs of building a web-based ERP system for your enterprise. Development timeline, technology, and costs outlined.
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
The is a quite short video tutorial. In this video, I'm going to show you how to create self-host WordPress blog with free hosting service.

832 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