本文介绍了从W#上获取checklistbox的价值来自C#。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

绑定CheckListBox



Binding CheckListBox

ChkSavingScheme.DataSource = NormalSavingModel.GetNormalSavingSchemeShareDividend();
ChkSavingScheme.ValueMember = "Alias";
ChkSavingScheme.DisplayMember = "Name";





用于检查项目物品的价值





for checking the value of checket items

foreach (object item in ChkSavingScheme.CheckedItems)
               {
                   var row = (item as DataRowView).Row;
                   if (row != null)
                       MessageBox.Show(row["Alias"] + ": " + row["Name"]);
               }





我尝试过:



错误出现在循环上



What I have tried:

The error came on the loop as "

Object reference not set to an instance of an object.





如何获取所选核对清单框的值

"

How to get the value of selected check list box

推荐答案


这篇关于从W#上获取checklistbox的价值来自C#。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-30 04:50