By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,763 Members | 1,609 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,763 IT Pros & Developers. It's quick & easy.

DataGrid Cell: Custom Font/Backcolor/Format cell by cell (VB.NET)

P: n/a
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:

I found there: How can I change the font used in a Gridcell on a cell by
cell or row by row basis. Wih this code I am able to change the
Font/Background/... based on the position of the field (column and row). The
problem is: it only changes the font etc, and not the format of it.
http://www.syncfusion.com/FAQ/WinFor...c44c.asp#q927q

Another usefull thing: How can I perform custom formatting on the cells in
my datagrid: This changes the format of a cell: like "1234" becomes "12-34"
and stuff like that.
http://www.syncfusion.com/FAQ/WinFor...c44c.asp#q881q

BUT (and now it comes): I'm not able to make something liek a 'merge' of
these two things. What I actually need is being able to change Font,
Backgroundcolor, Format, etc based on the entire row!!

For example: If the value in one field is zero, another Field has to get
marked in a specific Color (in the same record offcourse).

Anybody got any idea? Or better: A nice working example, or somewhere a
Class that takes care for all this stuff.

Thanks a lot in advance!

Pieter
Nov 20 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Do you have to use a datagrid? I think its much easier to format the
datalist control, use can use the custom bindings and the DataBinder.Eval
function to set your datasource and then use any vb functions and methods to
supply the formatting it needs. The drawback is you have to create the
interface yourself. The visual basic resource kit has great examples; I got
mine in a software bundle that I bought, I think you can download it from
Microsoft. You may want to look into it.

Jared

"DraguVaso" <pi**********@hotmail.com> wrote in message
news:3f*********************@reader1.news.skynet.b e...
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:

I found there: How can I change the font used in a Gridcell on a cell by
cell or row by row basis. Wih this code I am able to change the
Font/Background/... based on the position of the field (column and row). The problem is: it only changes the font etc, and not the format of it.
http://www.syncfusion.com/FAQ/WinFor...c44c.asp#q927q

Another usefull thing: How can I perform custom formatting on the cells in
my datagrid: This changes the format of a cell: like "1234" becomes "12-34" and stuff like that.
http://www.syncfusion.com/FAQ/WinFor...c44c.asp#q881q

BUT (and now it comes): I'm not able to make something liek a 'merge' of
these two things. What I actually need is being able to change Font,
Backgroundcolor, Format, etc based on the entire row!!

For example: If the value in one field is zero, another Field has to get
marked in a specific Color (in the same record offcourse).

Anybody got any idea? Or better: A nice working example, or somewhere a
Class that takes care for all this stuff.

Thanks a lot in advance!

Pieter

Nov 20 '05 #2

P: n/a
I just realized that I was talking about the asp datagrid and pieter was
referring to the windows.forms datagrid.
I apologize, please disregard.
"Jared" <VB***********@email.com> wrote in message
news:vu************@corp.supernews.com...
Do you have to use a datagrid? I think its much easier to format the
datalist control, use can use the custom bindings and the DataBinder.Eval
function to set your datasource and then use any vb functions and methods to supply the formatting it needs. The drawback is you have to create the
interface yourself. The visual basic resource kit has great examples; I got mine in a software bundle that I bought, I think you can download it from
Microsoft. You may want to look into it.

Jared

"DraguVaso" <pi**********@hotmail.com> wrote in message
news:3f*********************@reader1.news.skynet.b e...
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:

I found there: How can I change the font used in a Gridcell on a cell by
cell or row by row basis. Wih this code I am able to change the
Font/Background/... based on the position of the field (column and row).

The
problem is: it only changes the font etc, and not the format of it.
http://www.syncfusion.com/FAQ/WinFor...c44c.asp#q927q

Another usefull thing: How can I perform custom formatting on the cells in my datagrid: This changes the format of a cell: like "1234" becomes

"12-34"
and stuff like that.
http://www.syncfusion.com/FAQ/WinFor...c44c.asp#q881q

BUT (and now it comes): I'm not able to make something liek a 'merge' of
these two things. What I actually need is being able to change Font,
Backgroundcolor, Format, etc based on the entire row!!

For example: If the value in one field is zero, another Field has to get
marked in a specific Color (in the same record offcourse).

Anybody got any idea? Or better: A nice working example, or somewhere a
Class that takes care for all this stuff.

Thanks a lot in advance!

Pieter


Nov 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.