This is a migrated thread and some comments may be shown as answers.

DataFormComboBoxField select multiple items

1 Answer 32 Views
DataForm
This is a migrated thread and some comments may be shown as answers.
adao
Top achievements
Rank 1
adao asked on 14 Nov 2011, 07:49 PM
We are moving all our projects to Telerik Silverlight controls and, in old code, one of our features was the ability to choose multiple items from a combobox using a checkbox .

I've already found the equivalent code here but i cant figure out how to apply it to auto generated forms. For example, when i have a field like ta_country_id i replace current datafield with a code like this:

if (campo.StartsWith("ta_") && campo.EndsWith("_id"))
{
    DataFormComboBoxField dataField = new DataFormComboBoxField();
    dataField.Label = campo;
    dataField.DisplayMemberPath = "FieldName";
    dataField.SelectedValuePath = "FieldID";
    dataField.DataMemberBinding = new Binding(campo);
    e.DataField = dataField;
    getComboboxData(campo, dataField);
}
 
Now i need something similar but where i am able to select multiple items via checkbox for fields that allow multiple values (example: ta_options_ids). This field keeps a value in format id1, id2, id3, ..., idn

Thank you in advance

1 Answer, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 15 Nov 2011, 02:06 PM
Hi Adao,

You can try to create ContentTemplate for the combo box field in xaml and assign it in the code-behind. I am sending you a sample project illustrating this approach. Would you take a look at it and let me know whether it will correspond to your requirements ? 

Regards,
Maya
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
DataForm
Asked by
adao
Top achievements
Rank 1
Answers by
Maya
Telerik team
Share this question
or