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

Dynamically creating combobox columns in codebehind/event

1 Answer 66 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Kevin
Top achievements
Rank 1
Kevin asked on 31 Oct 2013, 08:43 AM
We are using dynamically creating combo column. please give us some suggestions:
Purposes:
1. dynamic columns
2. dynamic columns with combox box.
3. after selection, combobox will effect other columns (calculation)

It is impossible to declare GridViewComboBoxColumn in xaml because of columns is dynamic.
There will have serveral dynamic columns which are combobox and each row has different itemsource.
We have tried following possible workaround but it fails including 
1. blank cell when loading 
2. selection is not reflect back to cell.

Event 
private void RadTreeListView1_DataLoaded(object sender, System.EventArgs e)
      {
          GridViewComboBoxColumn column = new GridViewComboBoxColumn();
 
          column.SelectedValueMemberPath = "TestID";
          column.UniqueName = "Hello";
          column.ItemsSourceBinding = new Binding("MySchool");
          column.DataMemberBinding = new Binding("ID");
          column.DisplayMemberPath = "Name";
          this.RadTreeListView1.IsSynchronizedWithCurrentItem = true;
 
          this.RadTreeListView1.Columns.Add(column);
          // TODO: Add event handler implementation here.
      }

Issue see 1.jpg.
Please advise us for how to resolve this issue.

After a lot of reference, there are some workaround, but still failed:
1. create custom cell control and override createCellEditTemplate Method.
2. using xml.loader for cellEditTemplate xml.
3. using dynamic runtime object when dropdown list is open.
4. using datacontext and dataproxy to dropdown list.
5. assign itemssouce to combobox.
6. set itemssourcebinding to combobox.

After all. The precondition is those columns are dynamic. so some solutions may not working for our project.

Please give us some solutions. 

Thanks 

1 Answer, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 01 Nov 2013, 02:29 PM
Hi Kevin,

Will it be possible to clarify whether you are still dealing with those issues since in the project you sent in one of your other tickets those requirements were met ?  Do you need any assistance with the implementation ?

Regards,
Maya
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Tags
GridView
Asked by
Kevin
Top achievements
Rank 1
Answers by
Maya
Telerik team
Share this question
or