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

Dynamic grid Issue

1 Answer 123 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Kamal
Top achievements
Rank 1
Kamal asked on 11 Apr 2012, 07:36 AM
Hello,

I have dynamic data source using Web service json. I have bind data and columns dynamically. I want to bind data source schema fields dynamically. How to achieve this because schema fields are not array its object?

Also,for editing and adding template we need dropdown based on dynamic columns. How to do this?

Also, for drop down how to select option based on Value not text?

1 Answer, 1 is accepted

Sort by
0
Schlurk
Top achievements
Rank 2
answered on 19 Apr 2012, 05:41 PM
From the sound of things it seems like what you're looking for is the ability to have all of the columns in your Grid automatically generated. This is actually achieved out of the box if you end up not defining a columns collection for the Grid. If you do not define this property when setting up your Grid component it will look at the underlying data source and automatically generate columns for all of the fields.

As for your requirement of having a drop down list in the edit field this demo should be helpful. From my understanding you would have to specify the editor property of the specific column though, so you would have to explicitly define your columns in order to get this working.

When it comes to selecting you can use the approach mentioned in the select method's section here in the documentation. Instead of focusing on the text property of the item you can use value instead!
Tags
Grid
Asked by
Kamal
Top achievements
Rank 1
Answers by
Schlurk
Top achievements
Rank 2
Share this question
or