p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


Go Back   p2p.wrox.com Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
I forgot my password Register Now
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.

Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics section of the Wrox p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.

Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old July 29th, 2008, 02:59 PM
Friend of Wrox
Points: 923, Level: 11
Points: 923, Level: 11 Points: 923, Level: 11 Points: 923, Level: 11
Activity: 5%
Activity: 5% Activity: 5% Activity: 5%
 
Join Date: Mar 2007
Location: West Palm Beach, Florida, USA.
Posts: 198
Thanks: 4
Thanked 0 Times in 0 Posts
Default [2005] GridView - empty cell shows no border

I have a GridView that fills one of the cells with plain text from a table. When text is available it fills the cell with the text and a default border for the cell. However, where there is no text in the table, the cell appears empty (which is correct) but with no border at all. It looks a little bit funny. I tried to use the EmptyDataText property for the GridView to set a default text but it does not seem to have any effect. Any ideas??? Thanks.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #2 (permalink)  
Old July 29th, 2008, 03:12 PM
Friend of Wrox
Points: 788, Level: 10
Points: 788, Level: 10 Points: 788, Level: 10 Points: 788, Level: 10
Activity: 17%
Activity: 17% Activity: 17% Activity: 17%
 
Join Date: Nov 2007
Location: Central Florida, USA.
Posts: 199
Thanks: 2
Thanked 15 Times in 15 Posts
Default

Set GridLines="Both" if it's not already set.

Jason Hall
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #3 (permalink)  
Old July 29th, 2008, 03:49 PM
Friend of Wrox
Points: 923, Level: 11
Points: 923, Level: 11 Points: 923, Level: 11 Points: 923, Level: 11
Activity: 5%
Activity: 5% Activity: 5% Activity: 5%
 
Join Date: Mar 2007
Location: West Palm Beach, Florida, USA.
Posts: 198
Thanks: 4
Thanked 0 Times in 0 Posts
Default

Jason, GridLines is already set = Both. Any other suggestions? Thank you. Maybe you can detect something in my mark up code:

Code:
<asp:GridView ID="GridView2" runat="server" Style="z-index: 10px; position: relative; top: 43px; border-right: gray thin solid; border-top: gray thin solid; border-left: gray thin solid; border-bottom: gray thin solid; font-size: 12px; left: 10px;" Width="518px" AllowPaging="True" AllowSorting="True" Font-Size="Small" AutoGenerateColumns="False" CellSpacing="2" 
            HorizontalAlign="Left" BorderColor="LightGray" BorderStyle="None" PageSize="14" OnSorting="GridView2_Sorting" EmptyDataText="N/A">
               <Columns>
                   <asp:BoundField DataField="job_date" DataFormatString="{0:d}" HeaderText="Date" SortExpression="job_date" HtmlEncode="False">
                       <ItemStyle HorizontalAlign="Center" Width="20px" />
                   </asp:BoundField>
                   <asp:BoundField DataField="item_number" HeaderText="Cost Code" HtmlEncode="False">
                       <ItemStyle HorizontalAlign="Left" Width="30px" />
                   </asp:BoundField>
                   <asp:BoundField DataField="source_name" HeaderText="Source Name">
                       <ItemStyle HorizontalAlign="Left" Width="80px" Wrap="False" />
                   </asp:BoundField>
                   <asp:BoundField DataField="product_name" HeaderText="Product Name">
                       <ItemStyle HorizontalAlign="Left" Width="80px" Wrap="False" />
                   </asp:BoundField>
                   <asp:BoundField DataField="item_qty" HeaderText="Quantity">
                       <ItemStyle HorizontalAlign="Right" Width="30px" Wrap="False" />
                   </asp:BoundField>
                   <asp:TemplateField HeaderText="Notes">
                       <EditItemTemplate>
                           <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("item_notes") %>'></asp:TextBox>
                       </EditItemTemplate>
                       <ItemTemplate>
                           <asp:Label ID="Label1" runat="server" Text='<%# Bind("item_notes") %>' ToolTip='<%# Bind("item_notes1") %>'></asp:Label>
                       </ItemTemplate>
                       <ItemStyle HorizontalAlign="Left" Width="120px" />
                   </asp:TemplateField>
                   <asp:TemplateField HeaderText="Notes1" Visible="False">
                       <EditItemTemplate>
                           <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("item_notes1") %>'></asp:TextBox>
                       </EditItemTemplate>
                       <ItemTemplate>
                           <asp:Label ID="Label2" runat="server" Text='<%# Bind("item_notes1") %>'></asp:Label>
                       </ItemTemplate>
                   </asp:TemplateField>
            </Columns>
                <HeaderStyle BackColor="#FFC080" Height="35px" />
                <AlternatingRowStyle BackColor="#FFFFC0" /> 
                <RowStyle Height="20px" Wrap="False" />
                <SelectedRowStyle BackColor="#FF8080" Wrap="False" />
            <EmptyDataRowStyle BorderStyle="Solid" />

            </asp:GridView>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Get GridView Cell Value Based on GridView Column stublair C# 2008 aka C# 3.0 0 September 4th, 2008 09:30 AM
cell is empty while using For Each cell In Range jase2007 Excel VBA 1 July 11th, 2008 05:56 PM
Change border color for every cell of a table jdang67 CSS Cascading Style Sheets 3 February 23rd, 2006 05:03 PM
check if a cell has a bottom border crmpicco Excel VBA 2 January 10th, 2006 07:19 AM
text box to fill cell completely(no white border a Raif ASP.NET 1.0 and 1.1 Professional 0 August 20th, 2004 04:25 PM



All times are GMT -4. The time now is 10:39 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
© 2008 Wiley Publishing, Inc