Grid with SplitButton in GridColumnTemplate

1 Answer 62 Views
Grid SplitButton
Matt
Top achievements
Rank 1
Iron
Matt asked on 27 Sep 2024, 07:36 PM

I have a grid and I want to present the user with a set of custom actions for each specific row. I am using the splitbutton control in the gridcolumn template. The grid and splitbutton renders but the splitbutton popup is not visible.

https://blazorrepl.telerik.com/mykXmBPX33zR9mDO27

<TelerikGrid Data="@data">
    <GridColumns>
        <GridColumn>
            <Template>
                <TelerikSplitButton Icon="@SvgIcon.FileExcel">
                    <SplitButtonContent />
                    <SplitButtonItems>
                        <SplitButtonItem Icon="@SvgIcon.FilePdf" />
                        <SplitButtonItem Icon="@SvgIcon.DataJson" />
                    </SplitButtonItems>
                </TelerikSplitButton>
            </Template>
        </GridColumn>
        <GridColumn Field="@nameof(Data.field)" />
    </GridColumns>
</TelerikGrid>

@code {
    class Data
    {
        public string field{ get; set; }
    }

    IEnumerable<Data> data = Enumerable.Range(0, 10).Select(x => new Data { field = x.ToString() });
}

1 Answer, 1 is accepted

Sort by
0
Hristian Stefanov
Telerik team
answered on 29 Sep 2024, 07:50 PM

Hi Matt,

The reason the SplitButton popup isn't appearing is that each <SplitButtonItem> tag needs to have some content. If you prefer not to use text, you can include a TelerikSvgIcon as the content.

I've modified your example with these changes: REPL link. Please run and test it to see the updated result.

Regards,
Hristian Stefanov
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Matt
Top achievements
Rank 1
Iron
commented on 30 Sep 2024, 01:19 PM

Thanks that worked!
Tags
Grid SplitButton
Asked by
Matt
Top achievements
Rank 1
Iron
Answers by
Hristian Stefanov
Telerik team
Share this question
or