locked
Horizontal ScrollBar RRS feed

  • Question

  • User-1499457942 posted

    Hi

      I have below code and i want Horizontal Scrollbar to be added

    <div class="row">  
            <div class="col-lg-12 "> 
                <div class="table-responsive">
                    <asp:GridView ID="gvwEmployee" OnPreRender="gvwEmployee_PreRender" runat="server"  CssClass="table table-bordered table-striped"
                     AutoGenerateColumns="false" OnRowCommand="gvwEmployee_RowCommand" OnRowDataBound="gvwEmployee_RowDataBound"
                    ClientIDMode="Static"
                    EmptyDataText="No Records Found!" EmptyDataRowStyle-ForeColor="Red" EmptyDataRowStyle-CssClass ="gvEmpty" >
                    
                    <Columns>
    <asp:templatefield headertext="Name">
                            <itemtemplate>
                                <asp:label runat="server" id="lblFullName" text='<%#Eval("FullName") %>'></asp:label>
                            </itemtemplate>
                        </asp:templatefield>
                        <asp:templatefield headertext="Email">
                            <itemtemplate>
                                <asp:label runat="server" id="lblEmail" text='<%#Eval("Email") %>'></asp:label>
                            </itemtemplate>
                        </asp:templatefield>
                        <asp:templatefield headertext="Grade">
                            <itemtemplate>
                                <asp:label runat="server" id="lbldescription" text='<%#Eval("Grade") %>'></asp:label>
                            </itemtemplate>
                        </asp:templatefield>
                        <asp:templatefield headertext="Location">
                            <itemtemplate>
                                <asp:label runat="server" id="lblLocation" text='<%#Eval("BranchCode") %>'></asp:label>
                            </itemtemplate>
                        </asp:templatefield>
    </Columns>
                    </asp:GridView>

    Thanks

    Friday, November 16, 2018 6:10 AM

Answers

  • User839733648 posted

    Hi JagjitSingh,

    You could add a overflow style and set the width in a div to add the horizontal scrallbar like below.

            <div class="row">
                <div class="col-lg-12 ">
                    <div class="table-responsive">
                        <div style="overflow-x: scroll; width: 150px;">
                            <asp:GridView ID="gvwEmployee" runat="server" CssClass="table table-bordered table-striped" AutoGenerateColumns="false"
                                ClientIDMode="Static" EmptyDataText="No Records Found!" EmptyDataRowStyle-ForeColor="Red" EmptyDataRowStyle-CssClass="gvEmpty">
                                   ........
                            </asp:GridView>
                        </div>
                    </div>
                </div>
            </div>

    result:

    Best Regards,

    Jenifer

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, November 19, 2018 4:25 AM