Unplanned
Last Updated: 19 Jun 2017 11:41 by ADMIN
ADMIN
Dess | Tech Support Engineer, Principal
Created on: 19 Jan 2017 12:43
Category: RichTextEditor
Type: Bug Report
1
FIX. RichTextEditorRibbonBar - incorrect SelectedValue/SelectedIndex in RadDropDownListElement on a custom tab after a table is inserted
To reproduce: please refer to the attached gif file

Add a custom tab in the ribbon UI and a RadDropDownListElement bound to a list of strings. The first item is selected by default. Insert a table by using the ribbon UI and try to get programmatically the RadDropDownListElement.SelectedValue/Index. It is null/-1 although the text is correct.

Workaround:

public class CustomRichTextEditorRibbonBar : RichTextEditorRibbonBar
{
           protected override void CreateChildItems(RadElement parent)
    {
        base.CreateChildItems(parent);
        FieldInfo fi = typeof(RadRibbonBar).GetField("ribbonBarElement", BindingFlags.Instance | BindingFlags.NonPublic);
        RadRibbonBarElement ribbonBarElement = fi.GetValue(this) as RadRibbonBarElement;

        ribbonBarElement = new CustomRadRibbonBarElement();
        fi.SetValue(this, ribbonBarElement);
        this.RootElement.Children.Add(ribbonBarElement);

        ribbonBarElement.CommandTabSelecting +=
            delegate (object sender, CommandTabSelectingEventArgs args) { OnCommandTabSelecting(args); };
        ribbonBarElement.CommandTabSelected +=
            delegate (object sender, CommandTabEventArgs args) { OnCommandTabSelected(args); };

        ribbonBarElement.ExpandedStateChanged += delegate (object sender, EventArgs args)
        {
            this.OnRibbonBarExpandedStateChanged(args);
        };


    }
}

public class CustomRadRibbonBarElement : RadRibbonBarElement
{
  
    protected override float GetMaximumTabContentHeight()
    {
        return 104; 
    }
}
0 comments