J
Juan Santander
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.
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.