On Apr 15, 2:01 am, "Hans Olav Stjernholm" <n...@email.herewrote:
I would suggest resorting to the CssClass property. Associate a style class
to it where you define your background-color.
'Hans Olav.
<r...@rediffmail.comwrote in message
news:11**********************@w1g2000hsg.googlegro ups.com...
How do I change the BorderColor of the rows under the 2nd column in a
DetailsView?
I could change the BorderColor of the 1st column using the
FieldHeaderStyle-BorderColor property but using RowStyle-BorderColor,
the BorderColor of the 2nd column just refuses to change.
I even tried using AlternatingRowStyle-BorderColor but that doesn't
make any difference. What is surprising is the other properties of
RowStyle & AlternatingRowStyle like BackColor, Font-Italic, Font-
Strikeout, Font-Underline etc. work as expected; only the BorderColor
refuses to budge!- Hide quoted text -
- Show quoted text -
No Hans your suggestion doesn't work out as well. This is what I
tried:
<style>
..formatrow{
border-color:"black";
border-width:10;
background-color:"ghostwhite";
font-family:'Courier New';
font-size:12;
}
</style>
<asp:DetailsView ID="MyDV" BorderColor="black" BorderWidth="2"
CssClass="formatrow" FieldHeaderStyle-BackColor="black"
FieldHeaderStyle-BorderColor="black" FieldHeaderStyle-BorderWidth="2"
FieldHeaderStyle-ForeColor="ghostwhite" runat="server">
<RowStyle CssClass="formatrow"/>
<AlternatingRowStyle CssClass="formatrow"/>
<CommandRowStyle CssClass="formatrow"/>
<EditRowStyle CssClass="formatrow"/>
<EmptyDataRowStyle CssClass="formatrow"/>
<FooterStyle CssClass="formatrow"/>
<HeaderStyle CssClass="formatrow"/>
<InsertRowStyle CssClass="formatrow"/>
<PagerStyle CssClass="formatrow"/>
</asp:DetailsView>
Each & every property changes when the corresponding property within
the <style></styletag is changed except for the border-color &
border-width!
I even tried this:
Sub Page_Load(.....)
MyDV.AlternatingRowStyle.BorderColor = Drawing.Color.Black
MyDV.AlternatingRowStyle.BorderWidth = 10
MyDV.RowStyle.BorderColor = Drawing.Color.Black
MyDV.RowStyle.BorderWidth = 10
MyDV.CommandRowStyle.BorderColor = Drawing.Color.Black
MyDV.CommandRowStyle.BorderWidth = 10
MyDV.EditRowStyle.BorderColor = Drawing.Color.Black
MyDV.EditRowStyle.BorderWidth = 10
MyDV.FooterStyle.BorderColor = Drawing.Color.Black
MyDV.FooterStyle.BorderWidth = 10
MyDV.HeaderStyle.BorderColor = Drawing.Color.Black
MyDV.HeaderStyle.BorderWidth = 10
MyDV.InsertRowStyle.BorderColor = Drawing.Color.Black
MyDV.InsertRowStyle.BorderWidth = 10
MyDV.PagerStyle.BorderColor = Drawing.Color.Black
MyDV.PagerStyle.BorderWidth = 10
End Sub
But this doesn't work out as well! In fact, I put the above lines in
all the different sub-routines that are present in this ASPX page but
all my efforts went in vain & have gone down the drain.
Any other suggestions??