PC Review


Reply
Thread Tools Rate Thread

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

 
 
DraguVaso
Guest
Posts: n/a
 
      16th Dec 2003
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


 
Reply With Quote
 
 
 
 
Jared
Guest
Posts: n/a
 
      19th Dec 2003
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" <(E-Mail Removed)> wrote in message
news:3fdf2749$0$291$(E-Mail Removed)...
> 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
>
>



 
Reply With Quote
 
Jared
Guest
Posts: n/a
 
      19th Dec 2003
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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" <(E-Mail Removed)> wrote in message
> news:3fdf2749$0$291$(E-Mail Removed)...
> > 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
> >
> >

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Datagrid onclick change cell backcolor Franck Microsoft ASP .NET 1 7th Jun 2005 02:24 PM
Custom format that shows blank cell if another cell is empty Zdenek Moravec Microsoft Excel Misc 1 25th Mar 2005 11:45 AM
individual cell or line font or backcolor change... Chris Microsoft Access 1 4th Feb 2004 07:22 AM
DataGrid Cell: Custom Font/Backcolor/Format cell by cell (VB.NET) DraguVaso Microsoft ADO .NET 7 28th Jan 2004 09:04 PM
DataGrid Cell: Custom Font/Backcolor/Format cell by cell (VB.NET) DraguVaso Microsoft Dot NET Framework Forms 5 7th Jan 2004 09:09 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:56 AM.