Reputation: 1309
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
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
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?
Upvotes: 0
Views: 1306