Data Binding

  • Thread starter Thread starter csharpula csharp
  • Start date Start date
C

csharpula csharp

Hello,
I am trying to do data binding with c# Binding - trying to bind
list<object> to a list view. Is there any code example for doing that?
Thank you!
 
The ListView class in C# does not support data binding. The one in WPF
offers data binding, I believe.

If you want to populate items from a data source to the ListView in
Windows Forms, then you have to populate it manually.
 
What about ListBox or any other control that can present list (also can
sort it) and to provide binding of data?
 
You can use the ListBox, yes. You would have to set the DataSource (and
possibly DataMember) properties to the data source.

If you are using a DataTable as the source, then I recommend you create
a DataView on the DataTable and then sort that, and bind the ListBox to the
DataView.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top