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

ButtonGroup overflow

1 Answer 200 Views
ButtonGroup (Mobile)
This is a migrated thread and some comments may be shown as answers.
Erik
Top achievements
Rank 1
Erik asked on 19 Jun 2020, 01:37 AM

Is there a way to setup overflow on a ButtonGroup?

 

<div class="demo-section k-content"  >
  
            
                @(Html.Kendo().ButtonGroup()
                .Name("DashboardNavigate-select")
                .HtmlAttributes(new { style = "  display:" + displayToolbar + ";    " })

                        .Items(t =>
                    {
                      foreach (KeyValuePair<string, string>     kvp in Model.ButtonList)
                    {
                        
                              t.Add().Text(kvp.Value).HtmlAttributes(new { datavalue = kvp.Key.ToString() });
                         
                    }

                        })
                 .Events(events => events.Select("buttonNavigateNew"))

                )
              
</div>

1 Answer, 1 is accepted

Sort by
0
Ivan Danchev
Telerik team
answered on 22 Jun 2020, 04:50 PM

Hello Erik,

You will have to override default styles, in order to apply overflow to the ButtonGroup. For example:

<style>  
  #DashboardNavigate-select {
    width: 150px;
    overflow-x: auto;
    display: inline-block;
    margin: 0px;
  }
  
  .k-button-group .k-button {
    margin-right: -4px;
  }
</style>

With the CSS above, if the combined width of the buttons exceeds the specified width value, a scrollbar will appear: screenshot.

Regards,
Ivan Danchev
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
Tags
ButtonGroup (Mobile)
Asked by
Erik
Top achievements
Rank 1
Answers by
Ivan Danchev
Telerik team
Share this question
or