Alex Feinman DataGrid Example

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I know that NETcf 2.0 SP1 has facility to draw alternating rows now, but I
was looking at Alex Feinman's previous example (DataGridEvenOddRows.zip) for
that. It includes the lines below. My question is: Where are the various
fields documented (e.g., m_renderer, m_irowDrawFirst, m_irowDrawLast, etc)?
Or how would you get to that info? Did various searches, couldn't find it.

Thanks for any help,
Steve

m_r = typeof(DataGrid).GetField("m_renderer",
BindingFlags.NonPublic|BindingFlags.GetField|BindingFlags.Instance).GetValue(m_grid);
m_fiRowDrawFirst = m_r.GetType().GetField("m_irowDrawFirst",
BindingFlags.NonPublic|BindingFlags.GetField|BindingFlags.Instance);
m_fiRowDrawLast = m_r.GetType().GetField("m_irowDrawLast",
BindingFlags.NonPublic|BindingFlags.GetField|BindingFlags.Instance);
m_fiColDrawFirst = m_r.GetType().GetField("m_icolDrawFirst",
BindingFlags.NonPublic|BindingFlags.GetField|BindingFlags.Instance);
m_fiColDrawLast = m_r.GetType().GetField("m_icolDrawLast",
BindingFlags.NonPublic|BindingFlags.GetField|BindingFlags.Instance);
m_fiRowVisibleFirst = typeof(DataGrid).GetField("m_irowVisibleFirst",
BindingFlags.NonPublic|BindingFlags.GetField|BindingFlags.Instance);
m_fiRowVisibleLast = typeof(DataGrid).GetField("m_irowVisibleLast",
BindingFlags.NonPublic|BindingFlags.GetField|BindingFlags.Instance);
m_fiColVisibleFirst = typeof(DataGrid).GetField("m_icolVisibleFirst",
BindingFlags.NonPublic|BindingFlags.GetField|BindingFlags.Instance);
m_fiColVisibleLast = typeof(DataGrid).GetField("m_icolVisibleLast",
BindingFlags.NonPublic|BindingFlags.GetField|BindingFlags.Instance);
m_fiRows = typeof(DataGrid).GetField("m_rlrow",
BindingFlags.NonPublic|BindingFlags.GetField|BindingFlags.Instance);
m_miDrawCells = m_r.GetType().GetMethod("_DrawCells",
BindingFlags.NonPublic|BindingFlags.Instance);

brCell = (SolidBrush )m_r.GetType().GetField("m_brushCellBack",
BindingFlags.NonPublic|BindingFlags.GetField|BindingFlags.Instance).GetValue(m_r);
brCellFore = (SolidBrush )m_r.GetType().GetField("m_brushCellFore",
BindingFlags.NonPublic|BindingFlags.GetField|BindingFlags.Instance).GetValue(m_r);
 
These are private and internal fields that would not be documented. You can
use the tools like ildasm or Reflector to disassemble the assembly and take
a pick into the code.
 
As Alex said, they're undocumented and searching won't get them. You have
to understand how to reverse engineer and decompile, as well as make
educated guesses, to do this kind of work.

-Chris
 
Back
Top