Gridview Scroll bars

Hi experts,

I am new to ASP.Net. Having one gridview its having nearly 20 feilds .....but i need to pu scrollbars to gridview (header and itemfields also).

by Using CSS sheet , i can scroll only item fields...it not for header ..

 

Can anyone help me..

Thanks in Advance..

Laxmi.M.

0
laxmi
3/5/2009 5:52:47 AM
asp.net.presentation-controls 72751 articles. 3 followers. Follow

3 Replies
935 Views

Similar Articles

[PageSpeed] 12

Please refer to: http://forums.asp.net/t/1388576.aspx




Hope this helps...

Don't forget to mark as answer, if it helps
0
chintanpshah
3/5/2009 6:49:06 AM

laxmi.m:

Hi experts,

I am new to ASP.Net. Having one gridview its having nearly 20 feilds .....but i need to pu scrollbars to gridview (header and itemfields also).

by Using CSS sheet , i can scroll only item fields...it not for header ..

 

Can anyone help me..

Thanks in Advance..

Laxmi.M.

you can refer here

http://www.aspnetworld.com/articles/2004012504.aspx

just use gridview instead of datagrid


MAKMark as Answer if this reply helps you
MVP ASP/ASP.Net
MVP ASP/ASP.Net
ASP.Net Hosting : Host DepotMy Site : ASPSnippets
0
mudassarkhan
3/5/2009 7:00:44 AM

Hi

try this example :-

<script type=”text/javascript”>
    function s()
    {
        var t = document.getElementById(”<%=GridView1.ClientID%>”);
        var t2 = t.cloneNode(true)
        for(i = t2.rows.length -1;i > 0;i–)
        t2.deleteRow(i)
        t.deleteRow(0)
        a.appendChild(t2)
    }
    window.onload = s
    </script>

<table width=”600″ border=”0″ align=”center” cellpadding=”5″ cellspacing=”1″ bgcolor=”#cccccc”>
    <tr>
    <td bgcolor=”#eeeeee” class=”header1″>
    <fieldset>
    <legend>Gridview With Scrollbar</legend>
    <div id=”a”>
    </div>
    <div style=”overflow-y: scroll; height: 200px”>
    <asp:GridView ID=”GridView1″ runat=”server” Font-Size=”12px” BackColor=”#FFFFFF”
    GridLines=”Both” CellPadding=”4″ Width=”560″>
    <HeaderStyle BackColor=”#EDEDED” Height=”26px” />
    </asp:GridView>
    </div>
    </fieldset>
    </td>
    </tr>
    </table>

and in code behind :

protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            string connectionString = “server=localhost;database=Northwind;Integrated Security=SSPI”;
            string customers = “SELECT ContactName,CompanyName,Address FROM Customers”;
            using (SqlConnection con = new SqlConnection(connectionString))
            {
                DataSet ds = new DataSet();
                SqlDataAdapter da = new SqlDataAdapter(customers, con);
                da.Fill(ds, “Customers”);
                GridView1.Attributes.Add(”style”, “table-layout:fixed”);
                GridView1.AutoGenerateColumns = true;
                GridView1.DataSource = ds;
                GridView1.DataBind();
            }
        }
    }

check this link http://yasserzaid.wordpress.com/2009/02/20/gridview-with-scrollbar/

or check this link to freez Gridview Header using css

http://yasserzaid.wordpress.com/2009/02/20/freez-gridview-header/

also one solution is to set the overflow to auto :
<div style=”width: 600px; height: 400px; overflow: auto;”>

 // your Gridview here

</div>

you can also set the div as a server control then dynamicly add its style

 <div id=”Div1″ runat=”server” >

//– your Gridview here 

</div>

then you can add the style like this

Div1.Attributes["Style"]“=” width: 600px; height: 400px; overflow: scroll;”

 

//————another way

.grid_scroll
{
    overflow: auto;
    height: 500px;
    border: solid 1px orange;
    height: 480px;
    width: 800px;
}
<div id=”GridScroll” class=”grid_scroll”>

// Your Gridview

</div>

hope this helps

Good Luck

 

0
yasserzaid
3/6/2009 8:20:54 PM
Reply:

Similar Artilces:

Changing field names (display name) for a web interface and how to create a scroll bar for a datagrid or any control with a scroll bar to display data
Hello,  Can any1 please help me. i was wondering if any1 can tell  me how i can change  field names for a data grid only for the display on the web interface and also how can i put scroll bars on my data grid. Thank you.       Hi misbahmurtza, You can set field names in HeaderText attribute in any column or template. If you want to create a scroll bar, the easiest way is to set style for the <div> which contains your datagrid. Here is a sample: <div style="vertical-align: top; height:100px; width:100%; overflow:auto;"> Make sure ...

gridview control in another gridview control
Hi ia have a questioni have a gridview control which contains button in one colum.now my question is i need another gridview to be placed in the  first gidviewso that when i click on the button the second gridview will populate the data.now my question is how to place second gridview in first gridview.or is there any approach like first grid itself acting as parent and child.please help me  Hi sirikalavalapalli:                I think nested gridview will help you. Check this link and it will show you how...

How to maintain the scroll bar position of the treeview control in a webpart control?
I have a tree view control in a webpart control.  Between postbacks, the scroll is reset to the top of the panel control that contains the tree view control.  Basically I like to achieve the same functionality of TreeNode's EnsureVisible in the Win Form, but in the Web Form. I tried the following client-side script that I read at other posts var name = tvNavigation_Data.selectedNodeID.value;var selectedNode =Document.all?Document.all[name]ocument.getElementById(name);if(selectedNode){ selectedNode.scrollIntoView(true); } where tvNavigation_Data is the name of the tree view c...

Help Req: !!! :- On Disabling Controls Present inside a Gridview control
Hi All, We have A requirement Where we have disable controls inside a grid.These controls can be textbox, DropDownlist (in TemplateField), ComandField present inside the grid.We have to call a generic method for doing the same .(since it can be done for multiple grid.) PFB the code snippet we use. Which disables all the controls inside the page.The bolded part of the code is used to loop inside a grid view.(Not Working.)Is this ideal way to deal with the requirement.Or can someone suggest be a better way.        public void DisableMe(Page p1, st...

Is there a control which can display scroll bar when image dimension exceed the control
I put a image in the control, when the image dimension is less than the control dimension, it's normal, but when  the image dimension is larger than the control dimension, I hope the control can display a scroll bar , so I can view full dimension image by operate scroll bar.SuperCool Multiple ZIP - A utility to unzip multiple files and work with multiple zip filesSuperCool Random Number Generator Hi, You could simply place your image inside a HTML DIV element with a CSS class that keeps the dimensions, something like the following would work: .scrollableImage...

Gridview scroll bar
Is there a way to replace a gridview pager with a scroll bar?   dwfreeman:Is there a way to replace a gridview pager with a scroll bar? What you can do is first disable paging on your gridview.Now create a div with a fixed height, and set it to overflow on the y axis so that it will create a vertical scroll bar if the content it not entirely visible. add your grid view inside on this div.  jimmy q: dwfreeman:Is there a way to replace a gridview pager with a scroll bar?  What you can do is first disable paging on your gridview. Now create a div with a fixe...

Scroll Bars In GridView
Hi Friends, I am using Visual Studio 2005 Asp.net 2.0.I am Using grid view toshow  Excel sheet data with auto generated columns.I have so many Columns.I would like to have Scroll Bars(Both..vertical and H).in grid . I am not able to figure out this property .I tried from Style use Scroll Bars all the time still its not working.Could you please help me out Thanks in Advance. Steev     One of the easiest to implement, will be to use a containing div setting its overflow using css and gridview paging.  Example: HTML <%@ Page Language="C#" AutoEventWireup="tru...

scroll bar in gridview
hi, i have a gridview in a masterpage inside a panel.can any body tell me how to put scroll bar property to panel or to gridview. i am writing gridview in side a div like this <div style="width: 100%; top:150px; height: 250px; overflow: scroll"> gridview </div> it is showing the scrolls but not going focus on this take the properties of the panel, look for scroll bars, select both / vertical or horizontal .. as u like....     <td style="width: 293px"> <asp:Panel ID="Panel1" runat="server" Height="207px&q...

scroll bars for gridviews
Hi, Is there anybody who can help me with the following please?  I have a gridview inside of a master page. The gridview connects to a database and displays the rows and columns as usual, but some times the information is too big and the gridview expands horizontally way too far! I would ideally want the gridview to have scroll bars. I've tried using div tags around the gridview along with specifying the flow of the scroll bars as suggested, but for some unknown reason it doesn't do anything! Why? I got idea from another forum:I removed document type from aspx  page it starte...

how to control scrolling on a gridview
I want to programatically control the number of rows that are displayed in my gridview.  There will be times when my gridview will have a lot of rows and I want to make sure that the user can see all the data without having to scroll down the page... Yes, I know that there is a page property, etc.  But my user does not like the page function... On top of that, he does not want the headers to scroll off when he is "paging" through the gridview with the vertical scroll bar. So, does anyone have any idea how I can mimic the pager functionality so I can keep the gridview on the web ...

Gridview control embedded in another gridview control
I am writing an ambulance crew scheduling application on the web and I need some help completing the last part.  I have an access database that has three tables: user table, shift table (describing the shifts available), and a schedule table (that stores shift by shift_id and user by user_id).  I have a gridview control that will display the available shifts but I cannot get the embedded gridview control that will display the user that is signed up for each shift to display because I cannot figure out how to use the OnRowDataBound method.  I need a simple VB example of how to...

how to use a button to control the scrolling of DW instead of showing the h/v scroll bars
hi there, i am using powerbuilder 6.5, n tried the scroll()/ scrollnextpage()/ setrow() functions, all of them return w a successful state. but the contents of the dw control doesn't change a bit. anyone can help? tks, joe do you test the scrolltorow function ? JL a �crit : > hi there, > > i am using powerbuilder 6.5, n tried the scroll()/ scrollnextpage()/ > setrow() functions, all of them return w a successful state. but the > contents of the dw control doesn't change a bit. > anyone can help? > > tks, > joe > jean, ...

using javascript getting value from textbox when edit button is clicked and both controls are present in gridview control
Hi All using javascript I want to get value  from textbox when edit button is clicked and both controls that is texbox and button are present in gridview control .Alok Hi aloksinha83, Please see this post: http://forums.asp.net/t/1069245.aspx Thanks,Qin Dian TangMicrosoft Online Community SupportPlease remember to mark the replies as answers if they help and unmark them if they provide no help....

Master Details in two seperate GridView Controls
I am simply trying to have a list of people in the top grid control (works fine), then when selected have the second Grid Control show details for that person(not working). Here is what I am trying from the load event: Sub BindData() Dim myConnection As New MySql.Data.MySqlClient.MySqlConnection(System.Configuration.ConfigurationManager.AppSettings("ConnectionSql")) Dim strPersonSQL, strActSQL As String strPersonSQL = "select row_id, first_name, last_name, middle_initial, dsi_id, created, created_by, program_of_study, email from tbl_person" Dim myPerCommand As New MySqlClient.MySqlComm...

Web resources about - Gridview Scroll bars - asp.net.presentation-controls

GridView SelectedItem Binding Gotcha in WinRT
Last night when I was doing some WinRT hacking I was trying to setup databinding to the selected item in the GridView control and I ran into ...

CNW Group
Home Services Beyond the Wire About CNW Financials Webcasts Events My CNW All News Releases Advanced Search Gridview Latest News Releases All ...

CNW Group
... Services Beyond the Wire About CNW my CNW CNW Access CNW Directories Financials Webcasts Events my CNW All News Releases Advanced Search Gridview ...

CNW Group
Home Services Beyond the Wire About CNW Financials Webcasts Events My CNW All News Releases Add a Filter Gridview Latest News Releases All Today ...

New CmdLets of Powershell 2.0
New CmdLets of Powershell 2.0

Price Drop: Softbox
... objects- create product reflection- changing the background with something more interestingUse it as:- softbox- honeycomb softbox- gridview ...

Profile.aspx: ASP Alliance
.NET,ASP,ASP.NET,SQL,XML,HTML,ADO,ADO.NET,JavaScript,JScript,CSharp,VBScript and VB tutorials from AspAlliance.

Quick Answers - CodeProject
Questions - Free source code and tutorials for Software developers and Architects.; Updated: 25 Oct 2012

DotNetKicks.com - Upcoming stories
DotNetKicks.com is a community based news site edited by our members. It specialises in .NET development techniques, technologies and tools including ...

View Features - ExtendASP
Call 847-681-9827 or Request a Demo View Features Testimonials Pricing About Us Coming Soon ExtendASP exposes every feature, more than any other ...

Resources last updated: 12/21/2015 9:17:44 AM