3 Answers, 1 is accepted
0
Hi Zensell,
Thank you for writing.
Please find a sample project as an attachment to this message, which demonstrates how to achieve functionality similar to the described one.
I hope this helps. Let me know if you have any additional questions about this.
Greetings,
Martin Vasilev
the Telerik team
Thank you for writing.
Please find a sample project as an attachment to this message, which demonstrates how to achieve functionality similar to the described one.
I hope this helps. Let me know if you have any additional questions about this.
Greetings,
Martin Vasilev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0

Zensell
Top achievements
Rank 1
answered on 06 Oct 2010, 10:22 AM
Thanks Martin. I am using Q2 2010 SP1. I have found an issue in that sample project:
1. Change the country of any row. For example, select 'Canada'.
2. Select the last item in the city dropdown in that row. For example, select 'Redeer'.
3. Leave the city cell.
Then the city cell in that row blanks out! Is there a fix for this?
1. Change the country of any row. For example, select 'Canada'.
2. Select the last item in the city dropdown in that row. For example, select 'Redeer'.
3. Leave the city cell.
Then the city cell in that row blanks out! Is there a fix for this?
0
Accepted

Emanuel Varga
Top achievements
Rank 1
answered on 07 Oct 2010, 11:35 PM
Hello Zensell,
Please try it with these changes:
Hope this helps, if you have any other questions or comments, please let me know,
Best Regards,
Emanuel Varga
Please try it with these changes:
void
radGridView1_CellEditorInitialized(
object
sender, GridViewCellEventArgs e)
{
if
(
this
.radGridView1.CurrentColumn.FieldName ==
"CityId"
)
{
RadDropDownListEditor listEditor = (RadDropDownListEditor)
this
.radGridView1.ActiveEditor;
RadDropDownListEditorElement editorElement = (RadDropDownListEditorElement)listEditor.EditorElement;
localCities.Clear();
int
currentCountryId =
int
.Parse(
this
.radGridView1.CurrentRow.Cells[
"CountryId"
].Value.ToString());
for
(
int
numberOfCities = 0; numberOfCities < cities.Count; numberOfCities++)
{
if
(cities[numberOfCities].CountryId == currentCountryId)
{
localCities.Add(cities[numberOfCities]);
}
}
editorElement.DataSource = localCities;
radGridView1.CurrentCell.Value = (
int
)e.Value == -1 ? localCities[0].Id : e.Value;
}
}
Hope this helps, if you have any other questions or comments, please let me know,
Best Regards,
Emanuel Varga