Sunday 15 March 2015

winforms - Check Listbox returning System.DataRow -- VB.Net -


I am working with Win form and VBnet

  Private subload package name ( ) LbPackageName .ValueMember = "Value" lbPackageName.DisplayMember = "Label" lbPackageName.DataSource = ReportRunner.GetReportPackages () Ends sub-personal sub lbPackageNameSelectedIndexChanged (as the object, and sender as EventArgs) handles lbPackageName. The selected index changes lbRunTime .DisplayMember = "Label" lbRunTime.ValueMember = "value" lbRunTime.DataSource = ReportRunner.GetReportTimes (lbPackageName.SelectedValue) clbReportName.DisplayMember = "Label" clbReportName.ValueMember = "value" clbReportName.DataSource = ReportRunner.GetReportNames (lbPackageName.SelectedV Alue) End of Sub Code  

Code is simple Clicking different options in the list box lbPackageName I get different results. I sometimes get values ​​in CLBReportName. Sometimes I get the system Data.DataRow LbPackageName and lbRunTimes, for now, always populate correctly

Is there something different about the check list box?

Enter image details here

Here is a query that Returns as a DataTable

  SELECT A.ReportName AS ReportRunnerPackageToReportAssociation value as label, A.ReportName where an A.PackageName = @PackageName  
< P> An interesting search: Sometimes displaymember is set back to blank? Enter image details here

In answer to your question:

Is there something different about the check list box?

Yes.

When the "ValueMember" property of the checked list box is bound, the value must be boolean.

You may not have the value "2/18/2013 3: 21 o'clock" this should be "right" or "false".

So you might want to pair "displaymember" with "label" and get indexes to get the data to get the data. you require. Or, in your case, label and value are exact identical data "A.ReportName" because you can get the text of items checked during an event.

A good example of this is the force for the checklist box


No comments:

Post a Comment