473,320 Members | 1,979 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,320 software developers and data experts.

DataGrid - Formatting a specific row

Hi There!

Is there any way I can format a specific row?

For example, I want to format the row where customer name is "David" with
yellow background, or bold the text.

How do I accomplish this using DataGrid??

Thanks all in advance!!!
David
Nov 18 '05 #1
3 1083
....

"David Freeman" <no******@mailingspam.com> wrote in message
news:uD**************@TK2MSFTNGP12.phx.gbl...
Hi There!

Is there any way I can format a specific row?

For example, I want to format the row where customer name is "David" with
yellow background, or bold the text.

How do I accomplish this using DataGrid??

Thanks all in advance!!!
David

Nov 18 '05 #2
You can capture the ItemDataBound event, inspect the value and set the
DataGridItem object's BackColor property (e.Item.BackColor = ...;

DinoE does all sorts of stunts like this in an article with code:
http://msdn.microsoft.com/library/de...ta01102002.asp

HTH,

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Sun, 24 Oct 2004 01:10:10 +1300, "David Freeman"
<no******@mailingspam.com> wrote:
...

"David Freeman" <no******@mailingspam.com> wrote in message
news:uD**************@TK2MSFTNGP12.phx.gbl...
Hi There!

Is there any way I can format a specific row?

For example, I want to format the row where customer name is "David" with
yellow background, or bold the text.

How do I accomplish this using DataGrid??

Thanks all in advance!!!
David


Nov 18 '05 #3
Dino's article is win!!

I'm not done my own on DataBinding, but you can see it here:
http://openmymind.net/databinding/index.html , take a look at the Formatting
and OnItemDataBound sections which should be what you are looking for.

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"Scott Allen" <bitmask@[nospam].fred.net> wrote in message
news:cu********************************@4ax.com...
You can capture the ItemDataBound event, inspect the value and set the
DataGridItem object's BackColor property (e.Item.BackColor = ...;

DinoE does all sorts of stunts like this in an article with code:
http://msdn.microsoft.com/library/de...ta01102002.asp
HTH,

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Sun, 24 Oct 2004 01:10:10 +1300, "David Freeman"
<no******@mailingspam.com> wrote:
...

"David Freeman" <no******@mailingspam.com> wrote in message
news:uD**************@TK2MSFTNGP12.phx.gbl...
Hi There!

Is there any way I can format a specific row?

For example, I want to format the row where customer name is "David" with yellow background, or bold the text.

How do I accomplish this using DataGrid??

Thanks all in advance!!!
David

Nov 18 '05 #4

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

Similar topics

7
by: Matthew Wieder | last post by:
Hi - I have a datagrid that has a black header and the rows alternate white and gray. The problem is that until items are added to the grid, the grid appears as a large black rectangle, which is...
4
by: hope | last post by:
Hi, How can I format a string field using Data Formatting Expression property in datagrid? For example: format last name from BROWN to Brown. Thanks
2
by: DraguVaso | last post by:
Hi, I'm looking for a nice way to format the cell of my datagrid according to some predefined 'rules'. I found a lot on the site of George shepherd, but it wasn't really what I was looking for:...
4
by: Ed Bick | last post by:
I know how to do this stuff so easily in VB6......... 3 questions. I have loaded a grid by binding it to a dataset. All is well with that. 1) How do I retrieve the value of a column when a...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.