ListBox not updating

  • Thread starter Thread starter Joseph Byrns
  • Start date Start date
J

Joseph Byrns

I have a listbox that is bound to a DataTable as follows:

Me.JobListBox.DisplayMember = "DisplayMember"
Me.JobListBox.ValueMember = "GUID"
Me.JobListBox.DataSource = dTable

Simple enough, when I add a row to dTable the list box updates and displays
the row, when I remove a row from dTable, the row is likewise removed from
the listbox, all as expected so far. However, when I alter the
DisplayMember column of a row in the datatable the listbox is NOT updated
with the new DisplayMember.

Dim r As DataRow = dTable.Rows(0)
r("DisplayMember") = "New Display Member"
r.EndEdit() ''tried it without this, but I get the same result.

Anyone have any ideas?
 
Yes, a JobListBox.Refresh and a JobListBox.Update, but still no luck.

Any other ideas?
 
All list controls on NETCF V1 ignore ItemChanged event produced by data
binding engine.

You can create a custom control which would process this event.

To do so you should inherit from ListBox and override this:

protected virtual void SetItemCore(int index, object value)

As a workaround you can rebind or delete and add row.



That has been fixed on NETCF V2.



Best regards,


Ilya

This posting is provided "AS IS" with no warranties, and confers no rights.

*** Want to find answers instantly? Here's how... ***

1. Go to
http://groups-beta.google.com/group/microsoft.public.dotnet.framework.compactframework?hl=en
2. Type your question in the text box near "Search this group" button.
3. Hit "Search this group" button.
4. Read answer(s).
 
Thanks,

I'll look into that on monday.


Ilya Tumanov said:
All list controls on NETCF V1 ignore ItemChanged event produced by data
binding engine.

You can create a custom control which would process this event.

To do so you should inherit from ListBox and override this:

protected virtual void SetItemCore(int index, object value)

As a workaround you can rebind or delete and add row.



That has been fixed on NETCF V2.



Best regards,


Ilya

This posting is provided "AS IS" with no warranties, and confers no
rights.

*** Want to find answers instantly? Here's how... ***

1. Go to
http://groups-beta.google.com/group/microsoft.public.dotnet.framework.compactframework?hl=en
2. Type your question in the text box near "Search this group" button.
3. Hit "Search this group" button.
4. Read answer(s).
 
Back
Top