Click here to Skip to main content
12,889,448 members (49,769 online)
Click here to Skip to main content
Add your own
alternative version


4 bookmarked
Posted 23 Aug 2012

[Silverlight] Work with Cascading Drop-down Lists in the Telerik Gridview Control

, 23 Aug 2012 CPOL
Rate this:
Please Sign up or sign in to vote.
Work with Cascading Drop-down Lists in the Telerik Gridview Control

Editorial Note

This article appears in the Third Party Products and Tools section. Articles in this section are for the members only and must not be used to promote or advertise products in any way, shape or form. Please report any spam or advertising.


How to work with cascading drop-down lists in the Telerik gridview control?

The Solution

I am explaining how to work with cascading drop-down lists in the Telerik gridview control. The overall approach is pretty much the same. To review, when you're working with cascading DropDownList controls, you need to perform these tasks:

  • Populate each of the DropDownList controls.
  • Pre-select the appropriate value in each list to match what's currently in the data.
  • When the user selects a new value in the master dropdown, repopulate the detail dropdown with a new set of dependent values.

Here information about the schema of the tables is involved in this exercise.

Here you go:

Table: City (ID,Name,ContinentCodel)

Table: Continent(Code,Name)

As I say, you can do this in the GridView control in a way similar, but not identical to how you do it in Page. Let's say you have a grid that looks like this in normal mode:

<telerik:radgridview x:name="radGridView" autogeneratecolumns="True">

And looks like this:

When configuring columns that time set AutoGenerateColumns="False" and add columns like:

        <telerik:gridviewcomboboxcolumn datamemberbinding="
        {Binding ContinentCode, Mode=TwoWay}" header="Continent"
        displaymemberpath="Name" selectedvaluememberpath="Code">
        <telerik:gridviewcomboboxcolumn itemssourcebinding="
        {Binding AvailableCountries}" datamemberbinding="{Binding CountryID}"
        header="Country" displaymemberpath="Name"
        selectedvaluememberpath="ID" width="400">

When Continent changes that time set country using this code: In Continent selection, changed event looks like: Attached event in MainPage Constructor like:

new Telerik.Windows.Controls.SelectionChangedEventHandler(comboSelectionChanged));

Selection changed event:

void comboSelectionChanged(object sender, RadRoutedEventArgs args)
            RadComboBox comboBox = (RadComboBox)args.OriginalSource;
            if (comboBox.SelectedValue==null 
                || comboBox.SelectedValuePath != "Code")
            Location location = comboBox.DataContext as Location;
            location.ContinentCode = (string)comboBox.SelectedValue;


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Savalia Manoj M
Software Developer (Senior)
India India
No Biography provided

You may also be interested in...


Comments and Discussions

QuestionHow do i bind a telerik radgrid Griddropdowncolumn with database values? Pin
Alesha Mary Milred Fernandes29-Apr-14 5:15
memberAlesha Mary Milred Fernandes29-Apr-14 5:15 
GeneralMy vote of 5 Pin
Christian Amado23-Aug-12 7:10
memberChristian Amado23-Aug-12 7:10 
GeneralRe: My vote of 5 Pin
Savalia Manoj M26-Aug-12 17:15
memberSavalia Manoj M26-Aug-12 17:15 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.170424.1 | Last Updated 23 Aug 2012
Article Copyright 2012 by Savalia Manoj M
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid