|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
GridView Edit Template Control StyleHi,
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 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 Hi Morris,
Can my code work? Regards, Allen Chen Microsoft Online Support How do I create a CssClass page?
-- Show quoteHide quoteThanks Morris "Allen Chen [MSFT]" wrote: > Hi Morris, > > Can my code work? > > Regards, > Allen Chen > Microsoft Online Support > > Hi Morris,
To use CSS on your page you have two options in general. " Inline style sheet: http://www.w3schools.com/Css/tryit.asp?filename=trycss_background-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 Hi Morris,
Have you solved this issue? Regards, Allen Chen Microsoft Online Community Support
CustomValidator
Control disappears DropDownList Input Alternative to asp:MenuControl? open a new window with ajax reorder list Using the ImageUrl property of the HyperLink control Time tracking software with asp.net source code How to prevent JavaScript conflict in custom server control (when added more than once to a page) Control disappears Enter key as select/submit button |
|||||||||||||||||||||||