In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly introduces "how to dynamically load multi-selected values in C#". In daily operation, I believe that many people have doubts about how to dynamically load multiple-selected values in C#. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful for you to answer the doubts of "how to dynamically load multiple-selected values in C#". Next, please follow the editor to study!
1. New:
/ / add checklist to the data
String checkedText = string.Empty
/ / Loop check values, only stitching check values. Null values are not concatenated and non-null values are separated by commas.
For (int I = 0; I
< this.ckl_factory.Items.Count; i++) { if (this.ckl_factory.GetItemChecked(i)) checkedText += (String.IsNullOrEmpty(checkedText) ? "" : ",") + this.ckl_factory.GetItemText(this.ckl_factory.Items[i]); } 2.加载,实现修改界面加载多选值/ / Service Factory
String [] factory_list = edit_supplier.factory_name.Split (',')
/ / load checklist data, and load the selected data as checked status
String checkedText = string.Empty
For (int I = 0; I < factory_list.Length; iTunes +)
{
For (int j = 0; j < this.ckl_factory.Items.Count; jacks +)
{
CheckedText = this.ckl_factory.GetItemText (this.ckl_ factors. Items [j])
If (factory_ list [I] = = checkedText)
{
This.ckl_factory.SetItemChecked (j, true)
}
}
}
3. The modification function is consistent with the new one.
/ / add checklist to the data
String checkedText = string.Empty
For (int I = 0; I < this.ckl_factory.Items.Count; iTunes +)
{
If (this.ckl_factory.GetItemChecked (I))
CheckedText + = (String.IsNullOrEmpty (checkedText)? "": ",") + this.ckl_factory.GetItemText (this.ckl_ factory.items [I])
}
4. Synchronize to gridview
This.main_form_gridview.SetFocusedRowCellValue ("factory_name", edit_supplier.factory_name)
At this point, the study on "how to dynamically load multiple values in C #" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.