привет, у меня проблема с типами enum
Я делаю так ....
namspace XXXXXXxx
{
public partial class form1:form
{
////////
and i am checking the listview selected item with enum type by the following code
private void lstviewcategories_SelectedIndexChanged(object sender, EventArgs e)
{
if (lstviewcategories.SelectedItems[0].ToString() == categorytype.type1.ToString())
{
/////
blah blah...
}
}
and at here i am defining enum like this...
public enum categorytype
{
type1 = "ALL",
type2 ="0-500",
type3 ="500-1000" ,
type4 ="1000+ "
}
}
}
Я получаю ошибку в этих строках type1 = "ALL", t * ype2 = "0-500", type3 = "500-1000" * , type4 = "1000 +" говорят, что не могут неявно преобразовать строку типа в int
как я могу определить их как enum
как я могу получить доступ и сравнить с listviewcategoriesitems .....
кто-нибудь может помочь в этом ......