| | |
Page numbers displayed in single cell in asp.net datagrid, why?
Please support our ASP.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: May 2009
Posts: 2
Reputation:
Solved Threads: 0
It is an asp.net web application with following specifications:
Wndows Xp o/s, IIS 5.1, asp.net frame work is 1.1, VB is server side script, SQL Server 2000 Enterprise edition.
An asp.net datagrid control is dynamicaly populated with sql server 2K database table data by VB Script. The page numbers are properly displayed in local system. But on real remote web server, the page numbers are displayed in a single cell and it's colspan had been set as 1 instead of 10 which is the max. column counts in the grid. Hence the width of the first column in the grid is growing upto the no. of pages are grwoing.
How to solve the problem?
Please assit me at earleast if anybody has solution!
Early thanks,
Regards,
Prasanna V.
Wndows Xp o/s, IIS 5.1, asp.net frame work is 1.1, VB is server side script, SQL Server 2000 Enterprise edition.
An asp.net datagrid control is dynamicaly populated with sql server 2K database table data by VB Script. The page numbers are properly displayed in local system. But on real remote web server, the page numbers are displayed in a single cell and it's colspan had been set as 1 instead of 10 which is the max. column counts in the grid. Hence the width of the first column in the grid is growing upto the no. of pages are grwoing.
How to solve the problem?
Please assit me at earleast if anybody has solution!
Early thanks,
Regards,
Prasanna V.
•
•
Join Date: May 2009
Posts: 2
Reputation:
Solved Threads: 0
Hello serkan sendure,
Thanks for your concern.
The HTML code part is below.
The server side VB Script is below:
My words:
The output comes properly in datagrid. But the page numbers are displayed winthin a single cell of data gride. Hence the first column width is growing upto the no. of pages.
Please assist.
Thanks,
Regards,
Prasanna V
Thanks for your concern.
The HTML code part is below.
asp.net Syntax (Toggle Plain Text)
<div id="tBooksOrderedList" style="BORDER-RIGHT: #ff8080 1px solid; TABLE-LAYOUT: fixed; BORDER-TOP: #ff8080 1px solid; VISIBILITY: visible; OVERFLOW: auto; BORDER-LEFT: #ff8080 1px solid; WIDTH: 990px; BORDER-BOTTOM: #ff8080 1px solid; BORDER-COLLAPSE: separate; HEIGHT: 500px"> <asp:datagrid id="dgdBooksOrderedList" runat="server" BorderColor="Black" PageSize="7" AllowPaging="True" BorderStyle="Solid" CellPadding="5"> <SelectedItemStyle BackColor="#FF0066"></SelectedItemStyle> <AlternatingItemStyle CssClass="udsGridAlternateItem"></AlternatingItemStyle> <ItemStyle Font-Size="XX-Small" Font-Names="Verdana" HorizontalAlign="Justify" VerticalAlign="Middle"></ItemStyle> <HeaderStyle HorizontalAlign="Center" CssClass="udsGridHeader" VerticalAlign="Middle" BackColor="#FFE0C0"></HeaderStyle> <Columns> <asp:TemplateColumn HeaderText="Sl. No."> <ItemTemplate> <asp:Label ID="lblSlNo_T" runat="server" Text='<%# dgdBooksOrderedList.Items.Count +1 %>' CssClass=udsGridItem > </asp:Label> </ItemTemplate> </asp:TemplateColumn> </Columns> <PagerStyle Position="TopAndBottom" Mode="NumericPages"></PagerStyle> </asp:datagrid> </div>
The server side VB Script is below:
VB Syntax (Toggle Plain Text)
oleDBCon.ConnectionString = strCon oleDBCon.Open() strQry = "Select * From tabTableName" oleDBCMD.Connection = oleDBCon oleDBCMD.CommandText = strQry oleDBAdr = New OleDbDataAdapter(strQry, strCon) oleDBAdr.Fill(dsBooksReport, "tabBooksReportsT") dgdBooksOrderedList.DataSource = Nothing dgdBooksOrderedList.Dispose() dgdBooksOrderedList.DataSource = dsBooksReport.Tables(0) dgdBooksOrderedList.DataBind() dgdBooksOrderedList.Visible = True
My words:
The output comes properly in datagrid. But the page numbers are displayed winthin a single cell of data gride. Hence the first column width is growing upto the no. of pages.
Please assist.
Thanks,
Regards,
Prasanna V
Last edited by peter_budo; May 22nd, 2009 at 3:55 pm. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks) and [icode] (inline code) tags.
•
•
Join Date: Jan 2008
Posts: 2,052
Reputation:
Solved Threads: 122
ok as far as i understood you are complaining about having a single cell in your grid, and i think the reason is obvious : you have only one column in your columns collection in your datagrid. to have as many columns as you want, you have to add other templateColumns in your columns section of your datagrid. or you can basically remove all these and set autogeneratecolumns property of the datagrid to true.
Due to lack of freedom of speech, i no longer post on this website.
![]() |
Similar Threads
- Simple ASP.Net Login Page using C# (C#)
- Updated : Simple ASP.Net Login Page (ASP.NET)
- Looking for Sr. ASP .NET Developers (Software Development Job Offers)
- Front-End Developer with ASP.net needed!!! (Web Development Job Offers)
- ASP.Net / C# Web Developer (Web Development Job Offers)
- Linking to asp.net page from html page (ASP.NET)
- How To Hyperlink Normal HTML page with ASP.NET Page? (ASP.NET)
- Simple ASP.Net Login Page (Using VB.Net) (ASP.NET)
Other Threads in the ASP.NET Forum
- Previous Thread: AutoPostback for the Textbox in the userControl
- Next Thread: AutoPostback Problem on the Grid
| Thread Tools | Search this Thread |
Tag cloud for ASP.NET
.net 2.0 activexcontrol ajax alltypeofvideos anathor appliances application asp asp.net bc30451 beginner box browser button c# cac checkbox commonfunctions complex dataaccesslayer database datagridview datagridviewcheckbox datalist development dgv dialog dropdownlist dynamically edit editing expose feedback fileuploader fill flash form formatdecimal formview google gridview gudi iis image javascript list listbox login microsoft migration mouse mssql news numerical opera panelmasterpagebuttoncontrols parent problem project radio redirect registration relationaldatabases reportemail response.redirect richtextbox rows save schoolproject search security select session sessionvariables silverlight smartcard smoobjects software sql-server sqlserver2005 suse textbox tracking treeview unauthorized validatedate validation vb.net video videos vista visualstudio web webapplications webdevelopemnt webprogramming webservice xsl youareanotmemberofthedebuggerusers






