.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan
without borders   

Hi.

If you have a table with some rows and columns, and set the background color on the <tr>´s like this:

table.mytable tr
{
  background-color:Aqua;
}


Then you can see the lines that seperates the <tr>´s and <td>´s. Its like the borders that define the tablestructure still has its original color (or is transparent). And it looks quite ugly. How do you avoid this? Is there a way in CSS to make these borders 0 pixels wide?

I know that I can just put the background color on the table instead, but that is not a possible solution in my case.


Thanks alot :)


body   
{
    background: #b6b7bc;
    font-size: .80em;
    font-family: "Helvetica Neue", "Lucida Grande", "Segoe UI", Arial, Helvetica, Verdana, sans-serif;
    margin: 0px;
    padding: 0px;
    color: #696969;
}

a:link, a:visited
{
    color: #034af3;
}

a:hover
{
    color: #1d60ff;
    text-decoration: none;
}

a:active

MSChart - color only part of background

  
I'm trying to make a risk chart in ASP.NET using an MSChart control, and I only want to color the background for some of the quadrants.  The chart is 5 by 5, with 25 quadrants, and let's say I just want to color the upper-right quadrant red.  Can anyone tell me if that is possible?Thanks!Dave

change TD background/foreground color problem.

  
I have some javascript that is suppose to change the color of a table TD. the CSS file has an entry like this .tdcommand {} HTML TD is like <td colspan="2" height="162" valign="top" class="tdcommand"> if i put a background-color:red or whatever in the CSS file, the color is shown correctly. If i change it via a script it doesnt seem to have any impact. using the alert() to post info, i've found its entering my function correctly and getting the correct info. the important part of the function is thisfor (var i = 0; i < document.styleSheets[0][CSSRules].length; i++) { if (document.styleSheets[0][CSSRules][i].selectorText == obj) { document.styleSheets[0][CSSRules][i].style[prop] = color document.getElementById("opt_" + option).innerHTML = "'" + color + "'" } }   as i said, using the alert() i can validate that its finding the class ok (obj = .tdcommand) and the property is correct (background-color) and the innerHTML update is working fine. I use this same function to set other things, such as text color and highlighting of span's without any problem. what am i missing?   Justin

changing font color on a data column field based on the contents

  
I am trying to change font color if the datafield has the string EMERGENCY. This is my original template field: <asp:TemplateField HeaderText="Type" SortExpression="DigType"> <EditItemTemplate> <asp:Label ID="Label1" runat="server" Text='<%# Eval("DigType") %>' ></asp:Label> </EditItemTemplate> <ItemTemplate> <asp:Label ID="Label1" runat="server" Text='<%# Eval("DigType") %>' ></asp:Label> </ItemTemplate> </asp:TemplateField>   and this is what I thought would work: <EditItemTemplate> <asp:Label ID="Label1" runat="server" Text='<%# Eval("DigType") %>' ForeColor='<%# IIf(Eval("DigType")="EMERGENCY","Black", "Red") %>'></asp:Label> </EditItemTemplate> <ItemTemplate> <asp:Label ID="Label1" runat="server" Text='<%# Eval("DigType") %>' ForeColor='<%# IIf(Eval(&quo

How do I get the background color of a FrameworkElement passed into a method?

  
Hello, How do I get the background color of a FrameworkElement passed into a method? Here is the code: public static void SetEditability(FrameworkElement Control, bool IsEditable) { switch (System.Text.RegularExpressions.Regex.Match(Control.GetType().ToString(), @"\.(\w{1,})$").Groups[1].ToString()) { case "TextBox": SolidColorBrush scb = new SolidColorBrush(); scb.Color = Colors.White; // scb.Color = ((SolidColorBrush)((TextBox)Control).Background).Color; if (IsEditable) { ((TextBox)Control).IsReadOnly = false; scb.Opacity = 1; } else { ((TextBox)Control).IsReadOnly = true; scb.Opacity = 0.25; } ((TextBox)Control).Background = scb; break;   The code above works as seen.  But, I can't retain the background color because I can't get the background color from the passed in control (the commented out code above).  The color and opacity do change, just cannot get the color from the control.  How do I get it?  I've already tried several different ways, but I always get the following error: "NullReferenceException was unhandled Object reference not set to an instance of an object." I cannot test for null in this way "if (((SolidColorB

Alternative coloring and Image background color

  
Hi        I wanted to simple create a report with alternative background colors. Which I could achieve easily. Now I have a column in this report which is supposed to display image. Based on value from the data field a red or green or blue icon is displayed in this column based on expression. Which is also working fine. Now the problem is after I place an image in this details column (with or without expression).  the alternative row coloring stopped working. its always white. I even tried creating a colored background image and still its not helping. Can some one help me out please? If the question is still not clear, please let me know.... for Screenshot please refer http://binabdu-fayaz.blogspot.com/2010/09/alternative-coloring-and-image.html Thanks a lot. Fayaz  

How to change background or border brush color of an element while it has template in xaml?

  
Dear all, I want to change some style property of one element in code behind while that element already had a data template in xaml. as an example this is a code for my window: <Window x:Class="Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Window1" Height="300" Width="300" Loaded="Window_Loaded"> <Window.Resources> <Style x:Key="ButtonStyle" TargetType="{x:Type Button}"> <Setter Property="Template"> <Setter.Value> <ControlTemplate> <ControlTemplate.Resources> <Storyboard x:Key="OnMouseEnter1"> <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="grid" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)"> <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/> <SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="1.1"/> </DoubleAnimationUsingKeyFrames> <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Story

changing color on hover

  
Hiii Coders, I have this kind of div and inside that i have taken a link as shown below. Now i want that whenever user hovers his mouse over the div, the colour of complete division should change  <div class="mycollapsiblelinks"> <a href="javascript:animatedcollapse.toggle('div1')"> <div border="0"> <h1>ELCOMPONICS SALES PVT LTD</h1> </div> </a> </div>   How can i achieve this? plz rep asap
Post New Web Links

Changing Background Color Of DataGrid Row WPF 4

Posted By: Asim Sajjad     Posted Date: October 03, 2010    Points: 2   Category :WPF
 
In this post I will show you the way you can change the background color of the data grid row depending on the binding value. Let us start with the code of how to highlight or change the background color of the data grid row.


View Complete Post


More Related Resource Links

Inside Div text and background color not changing in HTML Tabs

  
there is below a I have Written a JAVAScript for TABS in HTML of div format and on anchor click the tab changes<script type="text/javascript"> function DisplayDiv(tabno){ var divnum; divnum=tabno; if(divnum == 1){ document.getElementById("div1").style.backgroundcolor="#D0DBF9"; document.getElementById("div2").style.backgroundcolor="#EFF3FE"; document.getElementById("div3").style.backgroundcolor="#EFF3FE"; document.getElementById("thisaudio").style.disply='block'; document.getElementById("comment").style.display='none'; document.getElementById("related").style.display='none'; } if(divnum == 2){ document.getElementById("div1").style.backgroundcolor="#EFF3FE"; document.getElementById("div2").style.backgroundcolor="#D0DBF9"; document.getElementById("div3").style.backgroundcolor="#EFF3FE"; document.getElementById("thisaudio").style.display='none'; document.getElementById("comment").style.display='block'; document.getElementById("related").style.display='none'; } if(divnum == 3){ document.getElementById("div1").style.backgroundcolor="#EFF3FE"; document.getElementById("div2").style.backgroundcolor="#EFF3F

Changing Background Color/Theme between different pages

  
So I made this thread sometime last year and never really did anything with it. I have a field in my database called 'Color' that is a varchar(25) value. In this table I can put Orange or #FF5B5B for example. Is there a way within my code I can grab the 'Color' field from the database to be displayed using a system.drawing.color? Any help is appreciated. Thanks! I know these below options show the actual colors in a textbox but I am looking to grab a field in the database.  TextBoxColor.BackColor = System.Drawing.Color.Orange; TextBoxColor.BackColor = System.Drawing.ColorTranslator.FromHtml("#FF5B5B");             

How to set row Background color for WPF DataGrid Programmatically (WPF & C#) based on the value in t

  

Hi,

I have a WPF Datagrid binded with list of interface objects.
Consider, ClsEmployee class implements I_Employee interface with properties Empl_Id, Empl_Name, Department, Address and City_name.

List<I_Employee> _emplList;

consider, _emplList has 10 items.

dgEmployeeGrid.ItemsSource = _emplList;

Question:
Now, if the user clicks on a button, then i should be able to read the City_name. Based on the City_name, i should be able to set the color (Color can be different for each row) for the rows dynamically through C# code.

Please help me how to do this?

Thanks in advance!


How to change the datagrid cell background color linear to the value

  

Hi,

I have a WPF 4.0 Datagrid displaying order values and I need to colour the backgroud of the high value orders so the user will notice high value orders easily. Is it possible to set the colour from white to red but increasing in steps say every 10,000 and increase the colour intensity according to the value.

Many Thanks.

Vijay


DataGrid Cell Background Color

  

Can someone show me how to change the background color of a DataGrid cell.  I have tried several examples and still having a time getting it to work.   I have a datagrid that is 10 by 11.  Each cell has a number (number will never change, just the color).  The number represents a particuliar alarm from a test stand.  I have to analyze the data from a data source and then set the background color. I am not binding to the data source.  I am really new to WPF and could use a complete example.  I do not have the toolkit install and I am using MS Visual C# express.  Thanks in advance.


Changing the Background color of SSRS reports

  

Hi All,

I have very urgent requirement like

1> "change the color of the background of report to the  RGB (240, 240, 240)" and

2>change the background of the legend to "white" i am able to do the second requirement please any one of you please suggest me in doing the first requirment

 

Thanks in advance...

Snusha

 


Changing background Color of a custom slider when IsEnabled = False (Expression Blend)

  

I have a customized slider control. When the control is set to IsEnabled=false, the color changes to the default desabled color. How do I change this to a different color in Expression blend? I have tried unchecking IsEnabled property in Expression Blend, and changing the color, but is still takes the default disabled color. 

 

Would appreciate if anyone knows how to do this using Expression Blend

 

Thank you


AUA

Selected to change the background color of the page

  

Hi,

As this site, http://www.borfin.com.tr/genel/Default.aspx, How can I change the background color selected pages.


Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend