I have a combo box which have item strings like:
1 . Apple
2 . Banana
3 . Mango
1,2,3 are category id & Apple, Banana, Mango is Category Name.
I want to know Category Id From comboBox using Category name which is sub-string of ComboBox item.
example:
I want to know the Category Id of Banana. which is 2.
Any help ?
Use this code to an event that should be after you selected the item in comboBox :
string []str;
str = comboBox1.Text.Split(' ');
string categoryId = str[0];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With