Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > GridView Edit Template Control Style

Reply
Thread Tools

GridView Edit Template Control Style

 
 
Morris Neuman
Guest
Posts: n/a
 
      02-10-2009
Hi,
I have a gridview and have set the font size to 8pt and forecolor to navy.

When I set the editrowstyle to different values it works for labels in edit
template mode, but not for textboxes, dropdownlist or other controls. Do I
have to set the style for each control individually? I only want the
different style to affect the controls in edit template mode.
--
Thanks
Morris
 
Reply With Quote
 
 
 
 
Allen Chen [MSFT]
Guest
Posts: n/a
 
      02-11-2009
Hi Morris,

To do this you can set CssClass for the EditRowStyle.

CSS:

<style type="text/css">
.test input{ background-color:Red;}
.test select { background-color:Green;}
</style>


aspx:

<asp:GridView ...
<EditRowStyle CssClass="test" />
...

ASP.NET TextBox control renders <input> to the client side. ASP.NET
DropDownList control renders <select> to the client side. So the above
styles will apply to the elements rendered by them. You can view source of
the page to see what HTML tags are rendered by ASP.NET controls to see how
to set correct CSS for them.

Please have a try and let me know if it works.

Regards,
Allen Chen
Microsoft Online Support

 
Reply With Quote
 
 
 
 
Allen Chen [MSFT]
Guest
Posts: n/a
 
      02-13-2009
Hi Morris,

Can my code work?

Regards,
Allen Chen
Microsoft Online Support

 
Reply With Quote
 
Morris Neuman
Guest
Posts: n/a
 
      02-17-2009
How do I create a CssClass page?
--
Thanks
Morris


"Allen Chen [MSFT]" wrote:

> Hi Morris,
>
> Can my code work?
>
> Regards,
> Allen Chen
> Microsoft Online Support
>
>

 
Reply With Quote
 
Allen Chen [MSFT]
Guest
Posts: n/a
 
      02-17-2009
Hi Morris,

To use CSS on your page you have two options in general.

" Inline style sheet:
http://www.w3schools.com/Css/tryit.a...ckground-color

" External style sheet:
http://www.w3schools.com/Css/showit.asp?filename=ex1

You can learn CSS from:
http://www.w3schools.com/Css/default.asp

Other reference:
http://msdn.microsoft.com/en-us/library/h4kete56.aspx

If you have additional questions please feel free to ask.

Regards,
Allen Chen
Microsoft Online Support

 
Reply With Quote
 
Allen Chen [MSFT]
Guest
Posts: n/a
 
      02-19-2009
Hi Morris,

Have you solved this issue?

Regards,
Allen Chen
Microsoft Online Community Support

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Gridview edit template control style Morris Neuman ASP .Net Web Controls 0 02-10-2009 08:28 PM
GridView Edit Template Control Style Morris Neuman ASP .Net Web Controls 0 02-10-2009 08:28 PM
GridView control enters edit mode when I click Edit link twice Jaime Stuardo ASP .Net Web Controls 0 04-07-2006 12:47 AM
Snapshot restraint - edit, edit, edit Alan Browne Digital Photography 24 05-10-2005 10:15 PM
Snapshot restraint - edit, edit, edit Patrick Digital Photography 0 05-06-2005 10:53 PM



Advertisments