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

Button inside MultiColumnComboBox

3 Answers 64 Views
MultiColumnComboBox
This is a migrated thread and some comments may be shown as answers.
sarthkee
Top achievements
Rank 1
Veteran
sarthkee asked on 27 Feb 2021, 04:06 AM
How to add button inside MultiColumnComboBox at the end of all rows inside it Or in a column? 

3 Answers, 1 is accepted

Sort by
0
Peter Milchev
Telerik team
answered on 03 Mar 2021, 12:04 PM

Hello,

You can add an additional column and use the ColumnTemplate to add a button:

Keep in mind that this is a client-side template, so you cannot use server controls inside it.

Regards,
Peter Milchev
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

0
sarthkee
Top achievements
Rank 1
Veteran
answered on 12 Mar 2021, 08:50 AM
thanks peter. Can you please send me code for it?
0
Peter Milchev
Telerik team
answered on 16 Mar 2021, 02:42 PM

Hello Sarthkee,

Here is a simple snippet demonstrating a very simple implementation:

<script>
    function buttonClickHandler(button, ev) {
        var mccb = $find("<%= RadMultiColumnComboBox1.ClientID %>");
        var row = $telerik.$(button).closest("li.k-item")[0];
        var dataItem = mccb.get_dataItem(row);
        // access the properties of the dataItem
        // https://www.telerik.com/blogs/improve-your-debugging-skills-with-chrome-devtools#get-intellisense-for-the-client-side-object
        console.log(dataItem.text); 
    }
</script>
<telerik:RadMultiColumnComboBox ID="RadMultiColumnComboBox1" runat="server" DataTextField="text">
    <ColumnsCollection>
        <telerik:MultiColumnComboBoxColumn Field="text" Title="Item Text"></telerik:MultiColumnComboBoxColumn>
        <telerik:MultiColumnComboBoxColumn Title="Button">
            <Template>
                <button onclick="buttonClickHandler(this, event); return false;">Button Text</button>
            </Template>
        </telerik:MultiColumnComboBoxColumn>
    </ColumnsCollection>
    <Items>
        <telerik:MultiColumnComboBoxItem Text="Item 1"></telerik:MultiColumnComboBoxItem>
        <telerik:MultiColumnComboBoxItem Text="Item 2"></telerik:MultiColumnComboBoxItem>
        <telerik:MultiColumnComboBoxItem Text="Item 3"></telerik:MultiColumnComboBoxItem>
        <telerik:MultiColumnComboBoxItem Text="Item 4"></telerik:MultiColumnComboBoxItem>
    </Items>
</telerik:RadMultiColumnComboBox>

Regards,
Peter Milchev
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.

Tags
MultiColumnComboBox
Asked by
sarthkee
Top achievements
Rank 1
Veteran
Answers by
Peter Milchev
Telerik team
sarthkee
Top achievements
Rank 1
Veteran
Share this question
or