473,385 Members | 1,752 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

GridView and coloring some rows

i want in my GridView

to color in some colors background of the rows,when i have certin values in
the binded data.

how can i do this?

thnaks in advance

peleg

Jul 10 '07 #1
3 1239
On Jul 11, 4:40 am, pelegk1 <pele...@discussions.microsoft.comwrote:
i want in my GridView

to color in some colors background of the rows,when i have certin values in
the binded data.

how can i do this?

thnaks in advance

peleg
hi try this hope help
private void DG_RowDataBound(object o, GridViewRowEventArgs e)
{
// apply custom formatting to data cells
if (e.Row.RowType == DataControlRowType.DataRow)
{
// set formatting for the category cell
TableCell cell = e.Row.Cells[0];
cell.BackColor = System.Drawing.Color.LightGray;
}

nahid
http://nahidulkibria.blogspot.com/
http://www.kaz.com.bd
}

Jul 10 '07 #2
i want to color all the row background not just a cell
how do i do it?
thnaks
peleg

"nahid" wrote:
On Jul 11, 4:40 am, pelegk1 <pele...@discussions.microsoft.comwrote:
i want in my GridView

to color in some colors background of the rows,when i have certin values in
the binded data.

how can i do this?

thnaks in advance

peleg

hi try this hope help
private void DG_RowDataBound(object o, GridViewRowEventArgs e)
{
// apply custom formatting to data cells
if (e.Row.RowType == DataControlRowType.DataRow)
{
// set formatting for the category cell
TableCell cell = e.Row.Cells[0];
cell.BackColor = System.Drawing.Color.LightGray;
}

nahid
http://nahidulkibria.blogspot.com/
http://www.kaz.com.bd
}

Jul 10 '07 #3
On Jul 11, 5:26 am, pelegk1 <pele...@discussions.microsoft.comwrote:
i want to color all the row background not just a cell
how do i do it?
thnaks
peleg

"nahid" wrote:
On Jul 11, 4:40 am, pelegk1 <pele...@discussions.microsoft.comwrote:
i want in my GridView
to color in some colors background of the rows,when i have certin values in
the binded data.
how can i do this?
thnaks in advance
peleg
hi try this hope help
private void DG_RowDataBound(object o, GridViewRowEventArgs e)
{
// apply custom formatting to data cells
if (e.Row.RowType == DataControlRowType.DataRow)
{
// set formatting for the category cell
TableCell cell = e.Row.Cells[0];
cell.BackColor = System.Drawing.Color.LightGray;
}
nahid
http://nahidulkibria.blogspot.com/
http://www.kaz.com.bd
}- Hide quoted text -

- Show quoted text -
its simple try
private void DG_RowDataBound(object o, GridViewRowEventArgs e)
{
e.Row.BackColor = System.Drawing.Color.AliceBlue;
}

nahid
http://nahidulkibria.blogspot.com/
http://www.kaz.com.bd
Jul 11 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Miguel Dias Moura | last post by:
Hello, I have a GridView in my page which is created in runtime. It works fine. My page has 2 Asp Buttons: - The HIDE button makes GridView.Visible = False; - The SHOW button makes...
1
by: mercercreek | last post by:
This one should be easy. Hope someone has a clue. Simple Scenario: Gridview with mulitple rows, each row with a checkbox. The user checks boxes of her choice. Clicks a button on the form (not in...
2
by: Blasting Cap | last post by:
I've got a gridview (that I converted over from a datagrid, which had been working properly), that is doubling up the number of rows returned. When it was running as a datagrid, the same code sent...
0
by: sharonrao123 | last post by:
hello all, I have a parent gridview company and in this one a nested gridview people, Is it possible to allow the user to select one row or multiple rows from the people gridview using a check box...
2
by: GISmatters | last post by:
I have unbound checkboxes in a nested gridview to allow multi-selection of "child" rows. For context, the parent gridview rows are for large "reports", the child rows are for various specific files...
1
Frinavale
by: Frinavale | last post by:
I'm working on an ASP.NET application using VB.NET for server side code. I have a GridView listing a bunch of stuff. Above the GridView I have a checkbox named "ChkBx_SelectAll". If this...
2
by: Michael | last post by:
It seems that a gridview allows us to delete only a single row at a time. How to extend this functionality to select multiple rows and delete all of the selected rows in a single stroke? just like...
1
by: COHENMARVIN | last post by:
I have a gridview and I need to know the number of rows in it. I find the Page_load and the Gridview_Load events are too early to find out the number of rows. I can use the Gridview_databound...
6
by: =?Utf-8?B?UGF1bA==?= | last post by:
Hi I have a gridview control with a template column that has a textbox and when the control is bound to the datasource the textbox is filled ok. I then change what is in the textbox in the gridview...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.