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

Urgent-- can not find combobox in gridview cell

1 Answer 103 Views
GridView
This is a migrated thread and some comments may be shown as answers.
m
Top achievements
Rank 1
m asked on 22 May 2011, 06:09 PM
I have spent a few hours trying to figure out how to find a combobox in myWPF Gridview cell. I need to find it after gridview row is bound. There are no examples out there. It needs to happen in code behind Can anybody help? This is really driving me nuts.

1 Answer, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 23 May 2011, 04:33 PM
Hello m,

 In general it is not a recommended practice to deal with the visual elements(i.e. to find them in the visual tree of the RadGridView).

 It depends on what your purpose is, but basically it would be more appropriate to use GridViewComboBoxColumn, instead of adding a combo box inside GridViewDataColumn

In code behind you could find the GridViewComboBoxColumn in CellLoaded event of the grid:

private void playersGrid_CellLoaded(object sender, Telerik.Windows.Controls.GridView.CellEventArgs e)
{
       if (e.Cell.DataColumn is GridViewComboBoxColumn)
       {
            GridViewComboBoxColumn column = e.Cell.DataColumn as GridViewComboBoxColumn;
       }
}

If this suggestion is not appropriate in your project, could you please share with us some additional information regarding:
- why your scenario requires finding the ComboBox in WPF GridView cell(what is your purpose)?
- how you have defined the ComboBox in your xaml?

Kind regards,
Didie
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
Tags
GridView
Asked by
m
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Share this question
or