RibbonComboBox explodes while selecting item

Feb 9, 2009 at 1:51 PM
Hi beloved experts,

I am meeting a serious issue when I try to select an item in my RibbonComboBox.
Here is the code:

XAML

<r:ribbongroup groupsizedefinitions="{StaticResource RibbonCompanyLayout}">
<r:ribbongroup.command>
<r:ribboncommand labeltitle="Société">
</r:ribboncommand>
<r:ribbonlabel>Nom de la société</r:ribbonlabel>
<r:ribboncombobox iseditable="True" selectionchanged="OnCompanySelectionChanged" isreadonly="True" name="comboBoxCompanySelection" width="150">
</r:ribboncombobox>
<r:ribbonbutton name="buttonAddCompany" command="{StaticResource AddCompany}">
<r:ribbonbutton name="buttonModifyCompany" command="{StaticResource EditCompany}">
</r:ribbonbutton>
</r:ribbonbutton>
</r:ribbongroup.command>
</r:ribbongroup>

C#

        /// <summary>
        /// Initializes the user interface.
        /// </summary>
        private void InitializeUI()
        {
            BusinessManager.CreateBusinessManager(new Logger(false));
            GeolocDataSet.CompanyDataTable companyTable = BusinessManager.Instance.GetCompanies(null);
            this.companyDataView = new DataView(companyTable);

            this.comboBoxCompanySelection.ItemsSource = this.companyDataView;
            this.comboBoxCompanySelection.DisplayMemberPath = "CompanyName";
            this.comboBoxCompanySelection.SelectedValuePath = "CompanyID";
        }

And then, when I select manually an item from this combobox I get:

"Unable to cas object of type 'System.Data.DataRowView' to type 'Microsoft.Windows.Controls.Ribbon.RibbonComboBoxItem'."

I need help !

Thx,

Roubachof.
Feb 9, 2009 at 1:59 PM
Sorry guys, the answer was here:

http://www.codeplex.com/wpf/Thread/View.aspx?ThreadId=40365