PC Review


Reply
Thread Tools Rate Thread

Alex Feinman Datagrid Binder Class

 
 
Juan Santander
Guest
Posts: n/a
 
      19th May 2005
Alex,
I'm using your binder control found on
"http://www.alexfeinman.com/samples.asp", to change the forecolor of
selected rows on a datagrid. Now I need to be able to change the
backcolor of the datagrid based upon a condition.
I've tried modificating your Binder class, to control the
"m_CellBackColor" field of the datagrid (a SolidBrush), on the GetValue
method. This does paint some cells, but it has an undesired behavior.
It paints all the selected row always starting by the second cell, and
it paints also the first cell of the next row.
I'm stating the instruction to paint the row, just after the one that
changes the color of the text, and this last one works OK, but the
first one does not.
I'm using the following statement:
m_renderer.GetType().GetField("m_brushCellBack",
BindingFlags.NonPublic|BindingFlags.Instance).SetValue(m_renderer, new
SolidBrush(Color.Violet) );

Also tried this one:
br = (SolidBrush) m_renderer.GetType().GetField("m_brushCellBack",
BindingFlags.NonPublic|BindingFlags.Instance).GetValue(m_renderer);
br.Color = Color.Violet;

I would really appreciate your help, I just need to highlight a whole
row (by changing its backcolor) depending on a condition found on one
of its columns.

Thank you very much.

Juan C. Santander P.

 
Reply With Quote
 
 
 
 
Alex Feinman [MVP]
Guest
Posts: n/a
 
      20th May 2005
I've modified the sample slightly to allow for coloring the background
(http://www.alexfeinman.com/download....=GridDemo3.zip)
You might also want to take a look at the different approach here:
http://www.alexfeinman.com/download....venOddRows.zip


--
Alex Feinman
---
Visit http://www.opennetcf.org
"Juan Santander" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Alex,
> I'm using your binder control found on
> "http://www.alexfeinman.com/samples.asp", to change the forecolor of
> selected rows on a datagrid. Now I need to be able to change the
> backcolor of the datagrid based upon a condition.
> I've tried modificating your Binder class, to control the
> "m_CellBackColor" field of the datagrid (a SolidBrush), on the GetValue
> method. This does paint some cells, but it has an undesired behavior.
> It paints all the selected row always starting by the second cell, and
> it paints also the first cell of the next row.
> I'm stating the instruction to paint the row, just after the one that
> changes the color of the text, and this last one works OK, but the
> first one does not.
> I'm using the following statement:
> m_renderer.GetType().GetField("m_brushCellBack",
> BindingFlags.NonPublic|BindingFlags.Instance).SetValue(m_renderer, new
> SolidBrush(Color.Violet) );
>
> Also tried this one:
> br = (SolidBrush) m_renderer.GetType().GetField("m_brushCellBack",
> BindingFlags.NonPublic|BindingFlags.Instance).GetValue(m_renderer);
> br.Color = Color.Violet;
>
> I would really appreciate your help, I just need to highlight a whole
> row (by changing its backcolor) depending on a condition found on one
> of its columns.
>
> Thank you very much.
>
> Juan C. Santander P.
>


 
Reply With Quote
 
Juan Santander
Guest
Posts: n/a
 
      20th May 2005
Alex,
I'm really thankfull for your help, this problem has been a big head
ache for me for quite a long time.
I took your example "DataGridEvenOddRows", and modified it to meet my
needs.
Again, thank you very much for your help.

Juan Santander

*** Sent via Developersdex http://www.developersdex.com ***
 
Reply With Quote
 
Juan Santander
Guest
Posts: n/a
 
      1st Dec 2005
Hello Alex,
I was wondering if you may have a Windows version of this binder. I was
trying to adapt the current component to work with a Windows DataGrid
but I'm getting some errors.
Thanks beforehand for your help.
Regards,

Juan Santander


*** Sent via Developersdex http://www.developersdex.com ***
 
Reply With Quote
 
Alex Feinman [MVP]
Guest
Posts: n/a
 
      2nd Dec 2005
No, not possible. This binder used internal implementation details of the CF
DataGrid, which are totally different on the desktop. OTOH you don't need in
on the desktop. You have Format and Parse events

"Juan Santander" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> Hello Alex,
> I was wondering if you may have a Windows version of this binder. I was
> trying to adapt the current component to work with a Windows DataGrid
> but I'm getting some errors.
> Thanks beforehand for your help.
> Regards,
>
> Juan Santander
>
>
> *** Sent via Developersdex http://www.developersdex.com ***


 
Reply With Quote
 
Juan Santander
Guest
Posts: n/a
 
      2nd Dec 2005
Thank you Alex, but I cannot figure out how to use those events on the
Binding class to format a cell. Will it be necessary to create a custom
TextBoxColumn ?, is there an easy way to change backcolor for the whole
row instead changing it for one column at a time?
Thanks again,

Juan Santander


*** Sent via Developersdex http://www.developersdex.com ***
 
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
PowerAwareApp by Alex Feinman andyw999-NO-SPAM-PLEASE-@hotmail.com Microsoft Dot NET Compact Framework 0 26th Oct 2006 07:41 AM
PowerAwareApp by Alex Feinman andyw999-NO-SPAM-PLEASE-@hotmail.com Microsoft Dot NET Compact Framework 0 25th Oct 2006 10:41 AM
Alex Feinman DataGrid Example =?Utf-8?B?bW9iaWxlbW9iaWxl?= Microsoft Dot NET Compact Framework 2 26th Jul 2006 05:09 AM
for Alex Feinman, CSD connection??? adan Microsoft Dot NET Compact Framework 1 21st Jun 2005 07:56 PM
Alex Feinman's beta TAPI C# wrapper class =?Utf-8?B?UGV0ZXIgQmVlZGVsbA==?= Microsoft Dot NET Compact Framework 1 1st Mar 2005 05:14 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:38 AM.