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


Top 5 Contributors of the Month
SP
satyapriyanayak
Subhransu Sekhar Jena
abhays
DotnetUser
Post New Web Links

How to change the row color

Posted By:      Posted Date: September 23, 2010    Points: 0   Category :ASP.Net
 

I'm having one gridview with template fileld. code is as follows.


i want to change the color of selected row. when i click on "LinkButton1" edit operation will happen . means it will another panel.  how to change the selected linkbutton row in grid view


please check the following code.



<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" SelectedRowStyle-BackColor="Beige"  OnRowDataBound="GridView1_RowDataBound" Width="477px" OnRowEditing="GridView1_RowEditing" OnRowDeleted="GridView1_RowDeleted" OnRowDeleting="GridView1_RowDeleting" EmptyDataText="No records are there now" BorderStyle="Solid" CellPadding="4" ForeColor="Green" GridLines="None" OnRowCreated="GridView1_RowCreated"  >
                                  <Columns>
                                 &nb


View Complete Post


More Related Resource Links

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.


How can I change the color of my clandar by data from Db

  
Sub DayRender(ByVal source As Object, ByVal e As DayRenderEventArgs)
        

            Dim i As Integer
            For i = 0 To DataGrid1.Items.Count - 1
            'If (DataGrid1.Items(i).Cells(1).Text = e.Day.Date) Then
            'If (DataGrid1.Items(i).Cells(0).Text <> "") Then
            If (DataGrid1.Items(i).Cells(1).Text.Equals(e.Day.Date.ToString)) Then

                '  e.Cell.BackColor = Color.DarkOrange
                e.Cell.BackColor = System.Drawing.Color.Red
                e.Cell.ForeColor = System.Drawing.Color.Yellow

            End If
        Next
now I click the day on clendar, which have data from db it chage color ,  How can I let when the calendar is load wich day have dat in db change color ?



    End Sub


 


change the font color according to the column

  

hi,

i have a column in the list which has values 1.Added

2.Chnaged

3.Killed

i want to make the field values Killed to be make it as Red so i tried in sharepoint designer converting to xslt data view then did formatting but the problem is i am not able to see the edit in data sheet option. can you please is there any way i can have both to be working? or is there any alternate solution for formatting column based on values

thank you so much.

 

 


How to remove underline from Hyperlink and change the color of the link

  
How to remove underline from Hyperlink and change the color of the link

How do I change the backlground and font color of a web part header - Sharepoint 2010

  
Hello,  Im verya mateur with Sharepoint so bare with me.   We are running Sharepoint 2010 and I am settingup a basic site for our company.  What I need to know is there a way to change the color of the web part header.   I have a calendar web part that displays a list of our holidays, and I was able to change the background color of the content as well as the font colors for the list of holidays,  but I cannot seem to change the background for the title box where it says Holidays and Events remains with a white background.   I would appreciate any help!   Thanks   Charlie   charlieprice@live.com

How to Change the Color of Link Label which is a Datagridview Column on a Row Selection?

  
Hi All I have a Link label as one of the column of Datagridview & also my SelectionBackColor set to Blue. Is there any way that i can change the link label color on a particular row selection as now my selectionbackcolor & link label color is matching...I am unable to the contents of that link label column. Should i do this on design level or in code level? Pls Help

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

Change performance point report color

  
This should be a simple question. I would like to change the color of the bars in the bar graph charts, and the color of the line in the line graph charts. I would imagine there is a way to do this. 

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

HTML Editor: Change Edit Panel Background Color

  
I've created a custom editor from the default AJAX HTMLEditor control to limit the toolbar buttons, etc. But I can't see how to set the background color of the text area in design mode. I'd like to set the background color to something other than white, because with my app most users will want to use white as their text color. White text on a white background is no bueno. The editor has ForeColor and BackColor properties, but these values don't control the text area. I tried creating custom css styles based on Editor.css, but all I end up with is an HTMLEditor without a border. Am I approaching this wrong? Any suggestions?

Change background color of default 2010 look?

  
Hi, I like the default look of the 2010 v4.master.  I was just wondering if it was possible to change just the background color from white to another color (gray in my case)?  Thats really the only change i would like to make.  Thanks!

change the color of label control inside gridview

  

Hi i am saving color as a string in database 

i have a gridview control

 <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" OnRowUpdating="Update_Schedule"
                    OnRowDeleting="Delete_Schedule" OnPageIndexChanging="OnPaging" OnRowEditing="Edit_Schedule"
                    OnRowCancelingEdit="CancelEdit" PageSize="10">
                    <Columns>
                        <asp:TemplateField>
                            <ItemTemplate>
                                <asp:CheckBox ID="Todo" runat="server" AutoPostBack="true" Height="23px" OnCheckedChanged="CheckedChanged" />
                                <asp:HiddenField ID="hdn_ScheduleID" runat="server" Value='<%#Eval("ID") %>' />
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField>
                            <ItemTemplate>
                                <asp:Label Text='<%# Eval("Title") %>' runat="server" ID="lbl1"></asp:Label>
                            </ItemTem

change the color of lines

  

Please advice---------

Let me explain this.
// aspx
<asp:TextBox runat="server" ID="txtOld" TextMode="MultiLine" Columns="70" Rows="30" Width="425px" />
<asp:TextBox runat="server" ID="txtNew" TextMode="MultiLine" Columns="70" Rows="30" Width="425px" />
<asp:Button Text="Compare" runat="server" ID="btnCompare" OnClick="btnCompare_Click" />

// c#
I have two string

string strOld = "This a line 1\nThis is going to be line 2\rThis is going to be line 3\rThis is line 4";
string strNew = "This a line 1\nThis text is changed here going to be line 2\rThis is going to be line 3\rThis is changed line 4";

Please note that these strings have \n and \r in it.

When form loads, I do something like this
 if (!IsPostBack)
        {
            txtOld.Text = strOld;
            txtNew.Text = strNew;
        }
Web browser automatically splits the strings and align nicely in the Text box like this

t

How do you change the color of the main frame on a Window in WPF?

  

I have an application where all windows have a very custom look/feel.  When the user has their theme set to Classic, or even set to certain default themes, the colors clash with my main app colors.

Seems like it should be easy to set a brush on the Frame portion of a Window in WPF but this appears to be missing from WPF.

I have searched around, but the only solutions have found involve making the main window transparent and manually creating the border and drawing the frame yourself and handling all the sizing/move options yourself.  I got this to work just fine, however I have a window on which I need to use INTEROP to show an HwndHost on a canvas.

HwndHost doesn't appear when being used on a Transparent window, so I simply cannot make the window Transparent without making my app useless.

I have tried setting the WindowStyle="None" and that gets me close, but shows an ugly thin frame around whatever I put on the window.  I wish "None" really meant none..  Unfortunately, it doesn't.

Does anybody have any way to override the color of the main window frame without making it Transparent or setting the WindowStyle="None" ?

Please help me out with a code sample if you have a good solution for this?

Thanks a bunch,

Curtis

 


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