Question

I have a lot of legacy code and I am trying to modify very few lines so as to get the desired functionality. My problem is :

I have a DevExpress.XtraEditors.ListBoxControl. Now there is a 'initFunction' which populates this ListBoxControl at runtime. The initFunction() was originally like this:

initFunction()
{
//code to populate and initialize ListBoxControl
abc = new DevExpress.XtraEditors.ListBoxControl(); //abc is declared as ListBoxControl
}//end of initFunction

usual ListBoxControl

I have to modify the function so that it looks like this:

initFunction(bool allowMultipleSelect)
{
if(allowMultipleSelect)
{
//initialize the ListBoxControl as a CheckedListBoxControl 

}
if(!allowMultipleSelect)
{
/*initialize the ListBoxControl as Radio Group Control so that only one value can be selected from the list */

}


}//end of initFunction

enter image description here

Now, how do i go ahead and do this? I tried looking for properties in the ListBoxControl which will allow me to selectively initialize the control as a checked/radio control but could not find any.

Also initializing a ListBoxControl as a CheckedListBoxControl / Radio Control is not possible. So any suggestions?

Était-ce utile?

La solution

Ok, there is no easy way to achieve this. A lot of code is involved. Here is a link which answers this query in not so elegant way: E3152

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top