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

ComboBoxColumn with value

7 Answers 65 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Johnny
Top achievements
Rank 1
Johnny asked on 07 Feb 2012, 02:59 AM
Hi,

I am designing a grid that has three columns, and two of those are ComboBoxColumn and the last column is an expression column. I would like to get all three columns working with each other, which means selection from column A would determines the available selection choices in column B, and column C would display the number that binds to the selection of column B. To better illustrate my design, considering the grid display information about continents, countries, and population, where column A (continents) controls the selection of countries in column B and column C displays the number of population from the country selection from column B. So far I have gotten both of the column A and B working, but I have difficulty to get the last column bind to the selection from column B. I have my column B's DataMemberBinding binds to population, and set the expression for column C binds to population too. However, once I try to test my app, the app would crash. How can I get my design working? Thanks.

7 Answers, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 07 Feb 2012, 10:25 AM
Hello Johnny,

I would recommend you to run through this blog post for a reference. Considering GridViewExpressionColumn, you can use both our online documentation and demos for more information. 
Let me know in case you need any further assistance.

Kind regards,
Maya
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Johnny
Top achievements
Rank 1
answered on 09 Feb 2012, 07:38 PM
Hi,

Thanks for the reply, I actually got the cascaded columns working by following the way as the blog post. I am trying to get my last column work now.  I have tried many different approaches to get it work, however, it is not working so far. Currently I set up the number associate with each of the selection from the drop down box as another class, and with ID associate with it. And I have an express column binds to the number I would like to display whenever the drop down box update its value. However, the express column only shows the ID number but not the actual value I would like to display.
0
Maya
Telerik team
answered on 10 Feb 2012, 08:32 AM
Hello Johnny,

Based on the provided information I get the impression that you are trying to create your expression from different sources (the one of the grid and the one of the combo box column). Am I right or am I missing something ? Could you take a look at this forum thread and the sample project attached there (GridViewExpressionColumn_ExprFromTwoSources) and let me know whether it corresponds to your scenario ? 

Greetings,
Maya
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Johnny
Top achievements
Rank 1
answered on 14 Feb 2012, 08:26 PM
Hi,

Thanks for providing that thread. I was able to use the example as the guidance to get what I wanted.
0
Johnny
Top achievements
Rank 1
answered on 15 Feb 2012, 01:06 AM
Actually, I could be able to get one combo box column work, and that combo box column works very similar as the one from the example.   Since controlling in my grid is kinda complicated, I still can't able to get that cascaded column output the value, which means combo A controls combo B and combo B not only display string of Name in column B but it also display Number in column C. Do you have any example project that I can use it as a reference? since the schedule to finish this grid is pretty tight, I wish I can have more time to think through. Thank you very much. !!
0
Maya
Telerik team
answered on 15 Feb 2012, 09:09 AM
Hi Johnny,

You can try updating the last column once the property for the second one (Country) is changed. I am sending you a sample project illustrating a possible way to go. Although it is for WPF, the same approach could be used in Silverlight as well.
Please take a look at it and let me know whether it corresponds to your requirements. 

Kind regards,
Maya
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Johnny
Top achievements
Rank 1
answered on 15 Feb 2012, 10:18 PM
Thank you!! It works perfectly.
Tags
GridView
Asked by
Johnny
Top achievements
Rank 1
Answers by
Maya
Telerik team
Johnny
Top achievements
Rank 1
Share this question
or