Page numbers displayed in single cell in asp.net datagrid, why?

Please support our ASP.NET advertiser: Intel Parallel Studio Home
Reply

Join Date: May 2009
Posts: 2
Reputation: prasannav is an unknown quantity at this point 
Solved Threads: 0
prasannav prasannav is offline Offline
Newbie Poster

Page numbers displayed in single cell in asp.net datagrid, why?

 
0
  #1
May 21st, 2009
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.
Reply With Quote Quick reply to this message  
Join Date: Jan 2008
Posts: 2,052
Reputation: serkan sendur is a glorious beacon of light serkan sendur is a glorious beacon of light serkan sendur is a glorious beacon of light serkan sendur is a glorious beacon of light serkan sendur is a glorious beacon of light serkan sendur is a glorious beacon of light 
Solved Threads: 122
Featured Poster
serkan sendur serkan sendur is offline Offline
Postaholic

Re: Page numbers displayed in single cell in asp.net datagrid, why?

 
0
  #2
May 21st, 2009
please provide some code, reason can be anything..
Due to lack of freedom of speech, i no longer post on this website.
Reply With Quote Quick reply to this message  
Join Date: May 2009
Posts: 2
Reputation: prasannav is an unknown quantity at this point 
Solved Threads: 0
prasannav prasannav is offline Offline
Newbie Poster

Re: Page numbers displayed in single cell in asp.net datagrid, why?

 
0
  #3
May 22nd, 2009
Originally Posted by serkan sendur View Post
please provide some code, reason can be anything..
Hello serkan sendure,

Thanks for your concern.

The HTML code part is below.

  1. <div id="tBooksOrderedList" style="BORDER-RIGHT: #ff8080 1px solid;
  2. TABLE-LAYOUT: fixed; BORDER-TOP: #ff8080 1px solid;
  3. VISIBILITY: visible; OVERFLOW: auto; BORDER-LEFT: #ff8080 1px solid;
  4. WIDTH: 990px; BORDER-BOTTOM: #ff8080 1px solid;
  5. BORDER-COLLAPSE: separate; HEIGHT: 500px">
  6.  
  7. <asp:datagrid id="dgdBooksOrderedList" runat="server"
  8. BorderColor="Black" PageSize="7" AllowPaging="True"
  9. BorderStyle="Solid" CellPadding="5">
  10.  
  11. <SelectedItemStyle BackColor="#FF0066"></SelectedItemStyle>
  12. <AlternatingItemStyle CssClass="udsGridAlternateItem"></AlternatingItemStyle>
  13. <ItemStyle Font-Size="XX-Small" Font-Names="Verdana"
  14. HorizontalAlign="Justify" VerticalAlign="Middle"></ItemStyle>
  15. <HeaderStyle HorizontalAlign="Center" CssClass="udsGridHeader"
  16. VerticalAlign="Middle" BackColor="#FFE0C0"></HeaderStyle>
  17.  
  18. <Columns>
  19. <asp:TemplateColumn HeaderText="Sl. No.">
  20. <ItemTemplate>
  21. <asp:Label ID="lblSlNo_T" runat="server"
  22. Text='<%# dgdBooksOrderedList.Items.Count +1 %>'
  23. CssClass=udsGridItem >
  24. </asp:Label>
  25. </ItemTemplate>
  26. </asp:TemplateColumn>
  27. </Columns>
  28. <PagerStyle Position="TopAndBottom" Mode="NumericPages"></PagerStyle>
  29. </asp:datagrid>
  30. </div>


The server side VB Script is below:


  1. oleDBCon.ConnectionString = strCon
  2. oleDBCon.Open()
  3.  
  4. strQry = "Select * From tabTableName"
  5.  
  6. oleDBCMD.Connection = oleDBCon
  7. oleDBCMD.CommandText = strQry
  8. oleDBAdr = New OleDbDataAdapter(strQry, strCon)
  9. oleDBAdr.Fill(dsBooksReport, "tabBooksReportsT")
  10.  
  11. dgdBooksOrderedList.DataSource = Nothing
  12. dgdBooksOrderedList.Dispose()
  13.  
  14. dgdBooksOrderedList.DataSource = dsBooksReport.Tables(0)
  15. dgdBooksOrderedList.DataBind()
  16. 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.
Reply With Quote Quick reply to this message  
Join Date: Jan 2008
Posts: 2,052
Reputation: serkan sendur is a glorious beacon of light serkan sendur is a glorious beacon of light serkan sendur is a glorious beacon of light serkan sendur is a glorious beacon of light serkan sendur is a glorious beacon of light serkan sendur is a glorious beacon of light 
Solved Threads: 122
Featured Poster
serkan sendur serkan sendur is offline Offline
Postaholic

Re: Page numbers displayed in single cell in asp.net datagrid, why?

 
0
  #4
May 22nd, 2009
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.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



Tag cloud for ASP.NET
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC