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

Top 5 Contributors of the Month
Gaurav Pal
without borders   


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

table.mytable tr

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 :)

    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;

    color: #1d60ff;
    text-decoration: none;


How can i add a textbox into a GridView Cell dynamically and how can i retrieve entred data

Hey, i think that the the subject can explain what i need, it's about adding a TextBox control with the code behind into a GridView, and also about how can i retrieve entered data after submitting, im using C#,Thanks.

I need to set the value of a gridview cell during update.

Hi,  I've been reading the posts here and I'm not finding, or maybe just not understanding, the answer I need so here's my problem. I have a small gridview and the update works very well. The issue is I need to have one of the fields set to a value from my code either when the record is open for undating or when the update runs.  Here is my gridview and the datasource info:<asp:GridView ID="GridViewItemLog" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" BackColor="White" BorderColor="#999999" CellPadding="3" DataKeyNames="LogID" DataSourceID="SqlDataSourceItemLogEntries" GridLines="Vertical" onrowdatabound="GridViewItemLog_RowDataBound" onrowupdating="GridViewItemLog_RowUpdating" onrowediting="GridViewItemLog_RowEditing"><AlternatingRowStyle BackColor="Gainsboro" /><Columns><asp:CommandField ButtonType="Image" CancelImageUrl="~/Resources/StopSmall.png" EditImageUrl="~/Resources/EditSmall.png" ShowEditButton="True" UpdateImageUrl="~/Resources/Save.png" /><asp:Boun

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

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

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

ASP.NET GridView help!! Need to be able to scroll an individual cell up and down.

Hi everyone.  I have an ASP.NET GridView displaying the below grid.  As you can see, the column on the right has a LOT of text and it stretches the column.  I need to be able to set a fixed width for JUST that column (maybe like 200px) and have vertical scroll bars on that cell so the user could scroll down to read the rest of the text, is that possible to do?Here's my markup: <asp:GridView ID="GridView1" runat="server" DataSourceID="SqlDataSource2" AutoGenerateColumns="False" AllowPaging="True" AlternatingRowStyle-Wrap="False" CellPadding="4" ForeColor="#333333" GridLines="None"> <RowStyle Height="30px" BackColor="#EFF3FB" /> <Columns> <asp:BoundField DataField="Customer_Name" HeaderText="Customer" SortExpression="Customer" /> <asp:BoundField DataField="Status" HeaderText="Status" SortExpression="Status" /> <asp:BoundField DataField="Module" HeaderText

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 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");             
Post New Web Links

Dyanmically set background color of GridView cell

Posted By:      Posted Date: October 24, 2010    Points: 0   Category :ASP.Net

How can I make the background color of a GridView cell dependent on the boolean value of field?

 <asp:BoundField DataField="L_Enbld" HeaderText="ON" SortExpression="L_Enbld" >
 <ItemStyle BackColor="#CCFFCC" Font-Bold="True" Font-Names="Calibri" />
Want to make red if L_Enbld is false, green if true.
Thank you


View Complete Post

More Related Resource Links

GridView Alternate Row not taking on the background color that I specified

I have a number of gridview controls within my application.  I am unable to assign the alternating row background color attribute.  All other alternate row attributes do "take".  I have temporarily placed these attributes in-line and removed all references to the CSS and to the skin files.  Here are some code samples.  Any thoughts? <%@ Page Title="" Language="C#" MasterPageFile="~/MasterPages/SiteMasterSG.Master" AutoEventWireup="true" CodeBehind="AddNewMember.aspx.cs" Inherits="IVA.pages.AddNewMember" %> <asp:Content ID="AddNewMemberMenu" ContentPlaceHolderID="MenuContentPlaceHolder" runat="server"> <asp:SiteMapDataSource ID="MemberSiteMapDataSource" runat="server" ShowStartingNode="False" SiteMapProvider="MemAdmin" /> <asp:SiteMapDataSource ID="GuestSiteMapDataSource" runat="server" ShowStartingNode="False" SiteMapProvider="Guest" /> <asp:SiteMapDataSource ID="CompanyMapDataSource" runat="server" ShowStartingNode="False" SiteMapProvider="CoAdmin" /> <asp:SiteMapDataSource ID="SystemSiteMapDataSource" runat="server" ShowStartingNode="False" Site

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



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.


Change selected row background color in gridview using javascript


hi frineds,

              i have a gridview with radio buttons in gridview i have chance to select only one item at a time in gridview like this

i need to change the row color of selected item in gridview with radio button using javascript if i select second row with radio button first row comes to normal condition now second row is in selected mode please help to write this functionality using javascript

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.

Selected to change the background color of the page



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

GridView color



How could I show the entire row or the cell with different color if particular data has been updated previously? For example I am showing 10 employees in gridview with their name and annual  salary, the 5th row employee's salary has been updated with different value. I know I can keep a flag in table and updated with updated flag. Later if I come back to same form, I would like to show this particular employee's  row or salary cell with 'red' color because it has been updated previously. How can I do using VB.net?



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