登录 | 注册 | FAQ
Anonymous

How to add virtical scroll bar in gridview?

+ 发表回复

5 篇帖子 分页: 1 / 1


How to add virtical scroll bar in gridview?

confidence123 » 周三 10月 22, 2014 5:54 am

Plz give the proper solution..
头像

confidence123

  • 帖子: 7
  • 注册: 周一 10月 13, 2014 4:38 am

Re: How to add virtical scroll bar in gridview?

XainPro » 周一 10月 27, 2014 7:29 am

You can put it inside a div like this:

<div style="width: 100%; height: 400px; overflow: scroll">your GridView</div>
头像

XainPro

  • 帖子: 3933
  • 注册: 周五 2月 17, 2012 8:10 pm

Re: How to add virtical scroll bar in gridview?

Farhin Qureshi » 周一 1月 23, 2017 10:35 am

Hi,

You can add vertical scroll bar in gridview using this below link.

http://www.aspsnippets.com/Articles/Add-vertical-scrollbar-to-GridView-in-ASPNet.aspx

Thanks.
头像

Farhin Qureshi

  • 帖子: 45
  • 注册: 周二 1月 03, 2017 11:33 am
--
Farhin Qureshi
.NET Developer
http://www.ifourtechnolab.com

Re: How to add virtical scroll bar in gridview?

Rdube123 » 周五 11月 17, 2017 7:04 am

Here I write a code to explain how to add Virtical scroll bar in gridview:
HTML Markup
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:UpdatePanel ID="up" runat="server">
<ContentTemplate>
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="false">
<Columns>
<asp:BoundField DataField="ContactName" HeaderText="Contact Name" />
<asp:BoundField DataField="City" HeaderText="City" />
<asp:BoundField DataField="Country" HeaderText="Country" />
</Columns>
</asp:GridView>
<asp:Button ID="Button1" runat="server" Text="Refresh" />
</ContentTemplate>
</asp:UpdatePanel>
Applying the Scrollable Grid jQuery Plugin

<script src="Scripts/jquery-1.4.1.min.js" type="text/javascript"></script>
<script src="Scripts/ScrollableGridViewPlugin_ASP.NetAJAXmin.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function () {
$('#<%=GridView1.ClientID %>').Scrollable({
ScrollHeight: 300,
IsInUpdatePanel: true
});
});
</script>
头像

Rdube123

  • 帖子: 1
  • 注册: 周五 11月 17, 2017 6:51 am

Re: How to add virtical scroll bar in gridview?

Samantha14 » 周一 9月 03, 2018 8:18 am

XainPro 写道:You can put it inside a div like this:

<div style="width: 100%; height: 400px; overflow: scroll">your GridView</div>


I tried your solution and it worked well for desktop version of my site. But for some reason it is not working on my site's mobile version.

Can you tell me why?




----------------------------------------------------
https://www.netguru.co/services
头像

Samantha14

  • 帖子: 10
  • 注册: 周一 9月 03, 2018 6:46 am


+ 发表回复

分页: 1 / 1