开发者

selecteditem range

开发者 https://www.devze.com 2023-03-14 03:56 出处:网络
I have two cmboboxes that displays all the cases no a coordinator has. Note that the case no is not sequential meaning 1 case can be no.001 the next can be 010,开发者_运维技巧 014, 019 and so on..

I have two cmboboxes that displays all the cases no a coordinator has. Note that the case no is not sequential meaning 1 case can be no.001 the next can be 010,开发者_运维技巧 014, 019 and so on..

ex. coordinator A has 4 cases with nos. 1,3,5,8,25.(this will be in a list form and will be the itemsource of both comboboxes from and to)

The user has to choose the case(s) she wants to print. cboFrom.selectedItem = 3 cboFrom.selectedItem = 8 By choosing 3 and 8, program will have to generate mail merge case no. 3, 5 and 8.

Question is how do I get the case(s) no. in between the selected from and to items? I can't use for loop since it is not sequestial. What is the best way? Sorry I didn't come up to a solution coz nothing is working and I am clueless. I only know if it is squestial or in date range.

thanks for the help.


int fromCase = Convert.ToInt32(cboCaseFrom.SelectedItem.ToString());
                int toCase = Convert.ToInt32(cboCaseTo.SelectedItem.ToString()); 
var selectedCases = _caseList.Where(CaseNo => Convert.ToInt32(CaseNo) >= fromCase && Convert.ToInt32(CaseNo) <= toCase);
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号