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,

Prasanna V.

7 Years
Discussion Span
Last Post by serkan sendur

please provide some code, reason can be anything..

Hello serkan sendure,

Thanks for your concern.

The HTML code part is below.

<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>
			<asp:TemplateColumn HeaderText="Sl. No.">
					<asp:Label ID="lblSlNo_T" runat="server" 
						Text='<%# dgdBooksOrderedList.Items.Count +1 %>' 
						CssClass=udsGridItem >
		<PagerStyle Position="TopAndBottom" Mode="NumericPages"></PagerStyle>

The server side VB Script is below:

oleDBCon.ConnectionString = strCon

strQry = "Select * From tabTableName"

oleDBCMD.Connection = oleDBCon
oleDBCMD.CommandText = strQry
oleDBAdr = New OleDbDataAdapter(strQry, strCon)
oleDBAdr.Fill(dsBooksReport, "tabBooksReportsT")

 dgdBooksOrderedList.DataSource = Nothing

 dgdBooksOrderedList.DataSource = dsBooksReport.Tables(0) 
 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.


Prasanna V


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.

This article has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.