Jeffrey
Thanks for the response. I didn't really find the msdn documentation on
IListSource very helpful. It read like it would be helpful if I already
understood how thing worked! In any case I found a simpler way. Since in my
case there are a fixed number of cells in the matrix I ended up just using a
panel with 81 TextBox controls -- generated and placed at form load time. I
used the Observer Pattern to link up my cell objects with the corresponding
TextBox so that any change to the value of a cell would be reflected
immediately in the UI.
Interestingly I found that letting my app run full speed resulted in no
update of the UI, presumably the messages were being genereated so quickly
that each message caused the previous to be ignored. I vaguely remember
something about this message loop handling from some long ago reading about
Windows architecture. What I wanted to achieve was a visual reflection of a
game board tree search for the game of Sudoku. I finally got it to work by
inserting a call to Sleep() in my cell update code.
One problem remains however. When the form is running you can watch the
tree search progress (and regress), but if I bring another application's
window in front of the form, then switch focus back to the form I find that
the visual update has stopped. Any idea what might cause that?
Thanks,
Bill
[quoted text, click to view] ""Jeffrey Tan[MSFT]"" <v-jetan@online.microsoft.com> wrote in message
news:8JSxiRnaFHA.3928@TK2MSFTNGXA01.phx.gbl...
> Hi Bill,
>
> Thanks for your post.
>
> For your requirement, we have several options to get it done.
>
> 1. We can dynamically create a n-Column int type DataTable, then add the
> n^2 elements in the DataTable, then we can bind the DataTable to the
> DataGrid. I think this is the simplest way.
>
> 2. What you wanted is similiar with the funciton DataTable and DataSet
> class provided. Actually, DataTable and DataSet both implemented
> IListSource interface, if you also want to enable internal Column
> databinding to certain field, your class should implement IListSource
> interface. You may view IListSource in MSDN:
>
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/
> frlrfSystemComponentModelIListSourceClassTopic.asp
>
> However, this requires more work to be done. For more information, please
> refer to:
> "HOWTO: implement IListSource in Winforms v2"
>
http://noiseehc.freeweb.hu/IListSource.html >
> Hope this helps
> ===============================================================
> Thank you for your patience and cooperation. If you have any questions or
> concerns, please feel free to post it in the group. I am standing by to be
> of assistance.
>
> Best regards,
> Jeffrey Tan
> Microsoft Online Partner Support
> Get Secure! -
www.microsoft.com/security > This posting is provided "as is" with no warranties and confers no rights.
>