Binding linq result to list box -
I have the following piece of code, that for some reason that I am unaware, LINQ does not populate the result set in the list box ( And there are many results in this list), however, I bind it with the original figures, it works well any thoughts:
datatable t = _partitionsDataSet.Tables [0]; Choose from new customizedPartitions = t.AsEnumerable (). New {name = string.Format ("{0} [{1}]", r ["name"], r ["username"]), BlobId = r [ "Blobid"]. Toasting ()}; If (Customized Partition .ts ()> gt; 0) {_dataView.Sort = "Name"; ListBoxPartitions.DisplayMember = "name"; ListBoxPartitions.ValueMember = "BlobID"; ListBoxPartitions.DataSource = Optimized section; }
To call you listBoxPartitions.DataBind ()
Method after setting the data source.
Comments
Post a Comment