Grids : How do they do it?

  • Thread starter Thread starter Xlar54
  • Start date Start date
X

Xlar54

Im just curious how grid controls work. Internally, how is this thing
made up? Probably a better way to ask is, if I were to create a grid
control from scratch, how do you think it should be done? Using only
intrinsic controls, and no C++.
 
Im just curious how grid controls work. Internally, how is this thing
made up? Probably a better way to ask is, if I were to create a grid
control from scratch, how do you think it should be done? Using only
intrinsic controls, and no C++.

basically, the Grid holds an array of GridCell elements. each GridCell
should carry enough information to be able to paint itself. the grid manages
the painting process for all cells - it handles scrollbars, determines which
cells are visible and then asks them to paint themselves. all painting is
done by the grid itself.

take a look at some source codes. for example:
http://www.codeproject.com/cs/miscctrl/csharpgridcontrol.asp

regards,
Wiktor Zychla
 
Grid cells can also have their own control(s). Ultimately access to the cell value is through the control.
 
Back
Top