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

HeaderStyle-Width and Scrolling not working

3 Answers 555 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Omar Alexander
Top achievements
Rank 1
Omar Alexander asked on 08 May 2015, 07:22 PM

Hello,

I have two columns of button with a fixed width header (HeaderStyle-Width) and all columns automatically fit the width of the grid, but to enable the scroll (<Scrolling AllowScroll ="true" UseStaticHeaders="true" />), the scroll does not appear.

<telerik:RadGrid ID="dbgCuentasCorreos" runat="server" AutoGenerateColumns="False" AllowPaging="True" AllowSorting="True" AllowMultiRowSelection="false">
                <MasterTableView ShowFooter="True" DataKeyNames="IdEmpresa, IdCuenta" CommandItemDisplay="Top" PagerStyle-Mode="NextPrevNumericAndAdvanced" InsertItemDisplay="Top" InsertItemPageIndexAction="ShowItemOnFirstPage" TableLayout="Fixed">
                    <Columns>
                        <telerik:GridEditCommandColumn UniqueName="EditCommandColumn"  ButtonType="ImageButton" HeaderStyle-Width="30" EditImageUrl="../imagenes/Edit.png" InsertImageUrl="../imagenes/Edit.png"></telerik:GridEditCommandColumn>
                        <telerik:GridBoundColumn UniqueName="IdCuenta" DataField="IdCuenta" HeaderText="Cuenta" DataType="System.Int64"></telerik:GridBoundColumn>
                        <telerik:GridBoundColumn UniqueName="Nombre" DataField="Nombre" HeaderText="Nombre" DataType="System.String" MaxLength="100"></telerik:GridBoundColumn>
                        <telerik:GridBoundColumn UniqueName="Descripcion" DataField="Descripcion" HeaderText="DescripciĆ³n" DataType="System.String" MaxLength="200"></telerik:GridBoundColumn>
                        <telerik:GridBoundColumn UniqueName="Estado" DataField="Estado" HeaderText="Estado" DataType="System.String" Display="false"></telerik:GridBoundColumn>
                        <telerik:GridButtonColumn ConfirmText="Desea eliminar este registro?" HeaderStyle-Width="30" ConfirmDialogType="RadWindow" ConfirmTitle="Eliminar" ButtonType="ImageButton"
                            CommandName="Delete" ImageUrl="../imagenes/Delete.png" UniqueName="DeleteColumn" Text="Eliminar" FilterControlAltText="Filter DeleteColumn column">
                        </telerik:GridButtonColumn>
                    </Columns>
                    <PagerStyle Mode="NextPrevNumericAndAdvanced"></PagerStyle>
                </MasterTableView>
                <ClientSettings>
                    <Selecting AllowRowSelect="true" />
                    <Scrolling AllowScroll ="true" UseStaticHeaders="true" />
                </ClientSettings>
            </telerik:RadGrid>

 

If remove the header fixed width of the two columns, the scroll if it appears.

 

Thanks for your help.

3 Answers, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 11 May 2015, 02:44 PM
Hi,

In order to show the horizontal scroll you need to make sure that sum of all column widths exceed the width of the grid, otherwise they will fit in the available grid space.

Regards,
Pavlina
Telerik
 

See What's Next in App Development. Register for TelerikNEXT.

 
0
Omar Alexander
Top achievements
Rank 1
answered on 11 May 2015, 07:53 PM

Thanks for your answer Pavlina.

I have applied what you explain to me. I also removed the property TableLayout = "Fixed" as this fits the columns to grid width.

Attached images showing the before and after setting the HeaderStyle-Width property in the different dimensions of the Grid. The Scroll is always set to on.

Thank you.

0
Pavlina
Telerik team
answered on 14 May 2015, 02:55 PM
Hello,

What happens if you set fixed columns width as shown below:
<MasterTableView ShowFooter="True" DataKeyNames="IdEmpresa, IdCuenta"  CommandItemDisplay="Top" HeaderStyle-Width="150px" PagerStyle-Mode="NextPrevNumericAndAdvanced" InsertItemDisplay="Top" InsertItemPageIndexAction="ShowItemOnFirstPage" TableLayout="Fixed">

Regards,
Pavlina
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Grid
Asked by
Omar Alexander
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Omar Alexander
Top achievements
Rank 1
Share this question
or