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

RadGridView.EditorRequired not firing

2 Answers 234 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Kevin Meyer
Top achievements
Rank 1
Kevin Meyer asked on 25 Mar 2008, 09:24 PM
I have a grid with two combo box columns.  The first is a list of countries (GridViewComboBoxColumn.DataSource = countryList) and the second is a list of states (GridViewComboBoxColumn.DataSource = stateList).  I've implemented the following recommended solution with Q3 2007 SP1 to correlate the combo boxes (Country drives State list):
http://www.telerik.com/community/forums/thread/b311D-bbdamc.aspx#444988


This solution does not work with Q1 2008 Beta because RadGridView.EditorRequired never fires.

What is the recommended solution with the Q1 2008 Beta controls?

2 Answers, 1 is accepted

Sort by
0
Kevin Meyer
Top achievements
Rank 1
answered on 26 Mar 2008, 06:11 PM
Here's my [ugly] work around:

1. Register to RadGridView.CellBeginEdit event
2. If the current cell is the dependent field (e.g., States in the Country/State example), get the RadComboBoxEditor from the cached editors (RadGridView.EditorManager.CachedEditors)
3. Change the editor datasource as needed
4. Clear the cached editors (I guess this is so the change doesn't affect the next column that needs the editor ??)

For this to work, I assume the cell gets the reference to the cached editor before CellBeginEdit is fired.  This seems very fragile and [my guess is] it will likely break with the next release.

I am eager to hear about a better long term solution that won't break with minor [or even revision] builds.
0
Dimitar Kapitanov
Telerik team
answered on 27 Mar 2008, 03:52 PM
Hello Kevin Meyer,

The EditorRequired event was never fired, as in the new RadGridView design it was considered that it will fire only if the default editor is not produced by the GridViewEditManager.

Because of your request we reconsidered our design, and decided that it is best to always fire the event. In case a default editor instance is available it will be passed through the Editor property of the event arguments to the user. In this way, you will be able to substitute the editor implementation, or just provide a custom initialization.

Regarding the issue with the combobox, it will be addressed in the official release.


Sincerely yours,
Dimitar Kapitanov
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
GridView
Asked by
Kevin Meyer
Top achievements
Rank 1
Answers by
Kevin Meyer
Top achievements
Rank 1
Dimitar Kapitanov
Telerik team
Share this question
or