Data Controls :: Change Color Of GridLines In GridView?

Aug 30, 2013

how to change the color of gridlines?

I tried 2 codes but its not working:-

protected void MyGrid_RowDataBound(object sender, GridViewRowEventArgs e)
{
foreach (TableCell tc in e.Row.Cells)
{
tc.Attributes["style"] = "border-color: #c3cecc";
}
}

and

protected void Page_Load(object sender, EventArgs e)
{
this.MyGrid.Attributes.Add("bordercolor", "c3cecc");
}

View 1 Replies


Similar Messages:

Data Controls :: Change GridLines Color Of GridView

Mar 15, 2014

I use gridview in my page below is code

<asp:GridView ID="GridView2" runat="server"
AutoGenerateColumns = "false" Font-Names ="Tahoma"
AllowPaging ="true"
OnPageIndexChanging = "OnPaging" PagerStyle-CssClass = "GridPager" PagerSettings-Mode="NumericFirstLast"
BorderColor="#02ca02" BorderStyle="Solid" BorderWidth="1px" RowStyle-BorderColor="#02ca02"
RowStyle-BorderStyle="Solid" RowStyle-BorderWidth="1px"
AlternatingRowStyle-BackColor = "#C0C0C0" ShowHeader="False" GridLines="both">

Here I put gridlines="both" and bordercolor="#02ca02" 

In chrome it shows color of gridview's border correctly but in firefox it shows  gridviews border in black color....

View 1 Replies

Forms Data Controls :: How To Change Row Color In GridView

Feb 25, 2010

I am developing a scheduling system in which customers are alloted 15 minute timeslots (see example below). During rowdatabound event I know how to change the value of Cell(1) to NULL by using e.Row.Cells(1).Text = "" so Select option is not available for that timeslot. This works fine for someone who has taken only 1 timeslot.

Question is, when a Customer has for example 1:00 hour appointment (which is 4 x 15 minute time slots), how do I make the next 3 rows Cell(1) value NULL?

Is there anything like e.Row+1.Cells(1).Text = "" or some loop that I can run to take care of next few rows?

[code]....

View 4 Replies

Forms Data Controls :: How To Change GridView Row Color

Jun 1, 2010

I am pretty new to asp.net development. I have a a checkbox in template column in gridview how do i change the color of grid row when the check state changes.

View 5 Replies

Forms Data Controls :: GridView Row Color Change?

Dec 13, 2010

i have gridview & m appliying for dis gv paging sorting and row color change respective courses for dat i have written code but after 3 records he give this error

Specified argument was out of the range of valid values.

Parameter name: index my code is

[code]....

View 5 Replies

Data Controls :: How To Change Color Of CommandField In GridView

May 7, 2015

I used commandfield in gridview that users can update their data in gridview Below is code:

<asp:CommandField EditText = "EDIT" UpdateText = "Update" CancelText = "Cancel" ShowEditButton="True" ItemStyle-Width="45px" ButtonType="Link" ControlStyle-CssClass="linkGVE" />

and css:

.linkGVE
{
text-decoration:none;
color:#02ca02;
text-align:center; }

Here this css if for all EditText and UpdateText and CancelText 

But I want EditText has blue color  and CancelText has red color how I can do it?

View 1 Replies

Data Controls :: Change Background Color Of GridView Row

May 7, 2015

How Coloring cells and rows in a Gridview using javascript with these examples of this page. url...

View 1 Replies

Data Controls :: Change Color Of Particular GridView Row On Some Condition?

Nov 27, 2013

There is a gridview, in that i have 5 columns. Data is coming from Database inside gridview.

I want to change the ForeColor of 5th column's particular rows in gridview according to condition.

The data in 5th column is coming from Database. I want to change the ForeColor of that column's particular rows according to condition.

here is gridview data:-

Station Name
State
Gate1
Gate2

[Code].....

I want to change the color of 5th column("DangerValue") rows only according to condition.

View 1 Replies

Data Controls :: Change Background Color Of Gridview

Apr 9, 2014

how to change backcolor of gridview In ModalPopupExtender

View 1 Replies

Forms Data Controls :: Change The Row Color Of Some Rows In Gridview?

Aug 17, 2010

I am binding a gridview to a stored procedure. I want to change of some row color based on the data binding.

For example: if "Lesson" =0, change the row color to RED.

[Code]....

View 9 Replies

Forms Data Controls :: How To Change The Color Of The Value In Gridview Using Condition

Jun 17, 2010

[URL]

if the ABOVE pic is not visible CLICK HERE to view

I want to change the colors of the values from the table SALARY

if the salary is > 20,000 i want to change it to GREEN color

if < 20,000 then it should show RED color

View 4 Replies

Forms Data Controls :: How To Change Row Color Manually In Gridview

Nov 8, 2010

I m having a gridview and Next and Previous button below gridview. If I click on next, I want to highlight the next row.

If i click on Previous, I want to highlight the previous row.

View 2 Replies

Data Controls :: Change GridView Row Color Based On Condition

Jul 26, 2013

I want to change the color of particular gridview rows with an image in one row, based on condtion. How to achieve it.

View 1 Replies

Data Controls :: Change GridView Row Color Based On Date?

Sep 16, 2013

 rollno  name  dateofbd

 1  a  sep 16
 2  b  sep 17
 3 c  sep 18
4  d  sep 19

This is datagridview after data is loaded.

whenever i load the data it compare the dateofbd with system date

if systemdate matches with dateofbd. that particular cell say example  sep 16 that cell background color

should changes to red.and sep 16 should display in bold in windows application.

View 1 Replies

Data Controls :: How To Change Color Of Particular Cell Of Gridview As Per Condition

Feb 25, 2016

I have a gridview that shows Gender column, My requirement is to set the color of Gender column with following condition

if Male-->Color is Red

if Female-->Color is Yellow

how should i do this ?

View 1 Replies

Data Controls :: Change Row Color Of GridView Control As Per Condition Specified

Jan 23, 2013

In my asp.net+vb web with access database in a gridview i used the following code

Sub GridView1_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs)
If e.Row.RowType = DataControlRowType.DataRow Then
If (e.Row.DataItem("TEN") > 24) Then
e.Row.ForeColor = Drawing.Color.Red

[Code] ....

The above code is working in my sqldatabase web but not working in access database web...

View 1 Replies

Forms Data Controls :: How To Change The Gridview Column Font Color

Jun 1, 2010

i have a gridview table and in one column i have this code...

<asp:BoundField DataField="MAIL_READ" HeaderText="VIEW" >

i want to change the font color if the MAIL_READ = 1 (red) and if MAIL_READ is not eq 1 (black)

View 13 Replies

Forms Data Controls :: Unable To Change Row Item Color In GridView

Mar 4, 2010

I want to change row items colour if last column value of each row >72 therefore I used following code:

[Code]....

The above code is working fine but when I am trying to control row items to the generlized method by the following code, it is working fine but the procedure is not applying successfully for one row which is also meeting criteria:

[Code]....

View 7 Replies

Forms Data Controls :: Change Gridview Row Color With Any Selection Made?

Dec 30, 2010

I have Edit / Delete / Select buttons enabled on my gridview.. Originally i had added the code to change the BackColor when you made a selection.

But now as the edit and delete functions are being completed.. i need to enable that coloring regardless which linkbutton you select.. As long as something on that row is selected, then i need to change it.

I have this within my SelectedIndexChanged event

[Code]....

View 6 Replies

Forms Data Controls :: Change Color Of Link Button In Gridview?

Feb 17, 2011

i am using one gridview with linkbutton when i click the linkbutton it should sending a mail to respective email id , i write sending
mail method and called at onCommand of link button in the gridview. it is working fine, my problem when i successfully a mail is sended
then clicked linkbutton should change the color that indicates that mail are sended.

View 5 Replies

Forms Data Controls :: Change Gridview Color On Expired Date?

Jan 9, 2011

i want to change color of gridview row to red ,if user login period is expired .

i am doing this:

protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
ViewState["expdatex"] = DateTime.Now.ToString("MM/dd/yyyy");
if (e.Row.RowType == DataControlRowType.DataRow)

[Code]....

but it is changed all the cells color.

View 5 Replies

Data Controls :: Change GridView Row Color Based On Date In BoundField?

Mar 7, 2013

In my asp.net+vb we+access DB. i have a field named DOB which is date of birth. i displays the data in grid view whose DOB+90 is less than ot equl to current date

DOB+90<=now()

and it works currect. but when i try to used vb code to change the row colour as per data it works for this one.

Protected Sub GridView1_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GridView1.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
If (e.Row.DataItem("DOR") <= Now()) Then
e.Row.ForeColor = Drawing.Color.Red
End If

But i want three diffrent conditions

1.  whose DOB=current month

2.  whose DOB comes in next month

3. whose DOB comes in month after next month

The font colour should be diffrent

View 1 Replies

Data Controls :: Change Background Color Of GridView Row Based On Date Value

May 7, 2015

I want a RowDataBound if the previous date in filed check in  not found be red color

Like  the date 10/10/2014 not found so 10/11/214 be red and how can i edit the date to be dd/mm/yyyy  

Name Checkin Checkout Branch
450 10/6/2014 9:13:38 AM 10/6/2014 6:01:50 PM branch0
450 10/7/2014 9:16:34 AM 10/7/2014 6:44:21 PM branch0
450 10/8/2014 9:11:53 AM branch0
450 10/8/2014 6:03:25 PM branch0
450 10/11/2014 9:17:33 AM 10/11/2014 6:29:16 PM branch0 (red color )
450 10/11/2014 4:50:42 PM branch0
450 10/12/2014 9:09:38 AM branch0

View 1 Replies

Data Controls :: Change Header Text Color Of GridView When Exporting To PDF

May 7, 2015

How to change header text font colour when  exporting gridview data to pdf.

View 1 Replies

Forms Data Controls :: Can Change Gridview Row Value Color Based On Current Date

Mar 15, 2011

I have Jobschedule( different work centers) displaying in grid view on my webform When particular workcenter passes the current date then it should highlight with Red color ,(following sechedule i bolded the dated which are passed current date since i did not find how to make color here)

View 12 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved