Dennis,
You need to raise events. In the case of the DataSet object model, the
IBindingList.ListChanged event notifies the DataGrid that a property of an
item changed via the ListChangeType.ItemChanged value. As I stated earlier I
don't have my sample handy when I did it. I want to say that my objects
raised a Changed event, which my "list" handled, then the "list" raised the
ItemChanged event to notify the datagrid.
I'm heading into a rather busy weekend, I will see if I can find more info
first part of next week...
Hope this helps
Jay
"Dennis" <De****@discussions.microsoft.com> wrote in message
news:53**********************************@microsof t.com...
| Jay, in my MultiGrid that I wrote, I still have a couple of issues I'm
trying
| to work and maybe you can give me some adivce. When I bind to an
ArrayList,
| I have it worked so that if a Cell in the Grid is edited the Arraylist is
| updated. However, if one of the property or field values is changed in
one
| of the Arraylist elements outside the Grid, I can't seem to figure out how
to
| get the grid to sense the change except for the user to call an update
method
| of the Grid which refreshes all the Grid. Is there any way in my grid to
| detect a change in an ArrayList property such I can for a DataTable,
Dataset,
| etc.?
|
| "Jay B. Harlow [MVP - Outlook]" wrote:
|
| > stojilcoviz,
| > The data grid needs a "list" that implements the IBindingList interface,
| > specifically IBindingList.SupportsSorting, IBindingList.SortDirection,
| > IBindingList.SortProperty, IBindingList.ApplySort,
IBindingList.RemoveSort,
| > and IBindingList.IsSorted. One such class is the DataView class. Another
is
| > the classes found in CSLA .NET
http://www.lhotka.net/
| >
| > Unfortunately ArrayList itself does not implement IBindingList. With
effort
| > one could create a class that implements a IBindingList wrapper over an
| > ArrayList. One of the projects I've worked on we took such an approach,
| > unfortunately I don't have a sample of that code readily available.
| >
| > Lhotka's book "Expert One-on-One - Visual Basic .NET Business Objects"
| > covers CSLA .NET & includes an example of implementing IBindingList that
| > supports sorting. NOTE: You can download the source to CSLA .NET at the
| > above site.
| >
| > Hope this helps
| > Jay
| >
| > "stojilcoviz" <st***********************@libero.it> wrote in message
| > news:Xn*********************************@193.70.19 2.192...
| > | <Ke**********@discussions.microsoft.com> wrote in
| > | news:5B**********************************@microsof t.com:
| > |
| > | This would be a solution.
| > | I hoped that grid sorting could be handled like for datatables (i.e.
you
| > | click the column header and the grid is sorted based on the column you
| > | clicked).
| > |
| > | Can somebody confirm that this doesn't work on datagrid with arraylist
as
| > | datasource?
| > |
| > |
| > | > Assuming that the datagrid is displaying the arraylist items in the
| > | > order that they exist in the arraylist, you can use the datagrid's
| > | > CurrentRowIndex as an index to the arraylist's Item property. This
| > | > will let you obtain a reference to the object in the arraylist.
| > | >
| > | > You could sort the datagrid by sorting the arraylist.
| > | >
| > | >> I've a datagrid whose datasource is an arraylist object. The
| > | >> arraylist holds many instances of a specific class.
| > | >>
| > | >> I've two questions about this:
| > | >> 1 - Is there a way by which I can obtain a reference to the
arraylist
| > | >> item
| > | >> the current row points to?
| > | >> 2 - Is it possible to sort the grid?
| > | >>
| > | >> Many thanks in advance.
| > |
| >
| >
| >