Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
2730
Ultra Option Set
posted

When setting "this.ultraOptionSetFilter.CheckedIndex = -1;" to -1, the option set goes null,

so then when i try to set the value to a property or variable i get an error. i am simply trying to clear the option set first then after I do a certain thing, then when I come back around to it, I want ot be able to reselect with out getting the error object has not been set to an instance.

I am going to give an quick example of what I am doing below.

Example:

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

private void ultraOptionSetSearch_ValueChanged(object sender, EventArgs e)

{

 

 

 

if (this.ultraOptionSetSearch.CheckedIndex != -1)

{

 

 

 

 

 

 

////Clear ultraOptionSetFilterBy default if user have selected another item type is selected.

this.ultraOptionSetFilterBy.CheckedIndex = -1;

}

}

Now if re execute the logic below the second time, I get a error

Item =

 

this.ultraOptionSetFilterBy.CheckedItem.DataValue.ToString();