Back to Devexpress

RibbonComboBoxValueChangedEventArgs<TData, TValue> Class

blazor-devexpress-dot-blazor-dot-ribboncomboboxvaluechangedeventargs-2.md

latest2.4 KB
Original Source

RibbonComboBoxValueChangedEventArgs<TData, TValue> Class

Contains data for the ValueChanged event.

Namespace : DevExpress.Blazor

Assembly : DevExpress.Blazor.v25.2.dll

NuGet Package : DevExpress.Blazor

Declaration

csharp
public class RibbonComboBoxValueChangedEventArgs<TData, TValue> :
    RibbonValueChangedEventArgsGeneric<TValue>

Type Parameters

NameDescription
TData

The data item type.

| | TValue |

The new editor value.

|

Remarks

Use the RibbonComboBoxValueChangedEventArgs class to identify the event type in the NodeEvent event handler.

The following code snippet displays the value selected from the Ribbon combo box editor:

razor
<DxRibbon NodeEvent="OnNodeEvent">
    <DxRibbonTab Text="Home">
        <DxRibbonGroup>
            <DxRibbonComboBoxItem Data="FontSizes"
                                  Value="@CurrentFontSize"
                                  TextFieldName="@nameof(FontSizeInfo.Size)" />
        </DxRibbonGroup>
    </DxRibbonTab>
</DxRibbon>

<p>@Notification</p>

@code {
    private FontSizeInfo CurrentFontSize { get; set; }
    private IEnumerable<FontSizeInfo> FontSizes => FontSizeInfo.DefaultFontSizes;
    string Notification = "";

    private void OnNodeEvent(RibbonNodeEventArgs args) {
        if(args is RibbonComboBoxValueChangedEventArgs<FontSizeInfo, FontSizeInfo> eventArgs) {
            Notification = $"Changed font size to {eventArgs.Value.Size}";
        }
    }
}

Inheritance

Object EventArgs DevExpress.Blazor.Ribbon.Internal.RibbonEventArgs DevExpress.Blazor.Ribbon.Internal.RibbonNodeEventArgs DevExpress.Blazor.Ribbon.Internal.RibbonValueChangedEventArgs DevExpress.Blazor.Ribbon.Internal.RibbonValueChangedEventArgsGeneric<TValue> RibbonComboBoxValueChangedEventArgs<TData, TValue>

See Also

RibbonComboBoxValueChangedEventArgs<TData, TValue> Members

DevExpress.Blazor Namespace