Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Jan 24, 2013 08:45 PM by tinac99
Member
74 Points
137 Posts
Jan 22, 2013 04:49 PM|LINK
Hi,
Is there a way for me to programmatically hide the borders of the table in the listview?
<asp:ListView ID="ListView1" runat="server" DataSourceID="LinqDataSource1" UseAccessibleHeader="True" AllowPaging="False" AllowSorting="False" DataKeyNames="Id" SelectedIndex="1" AutoGenerateColumns="False" OnLayoutCreated="ListView1_OnLayoutCreated"> <LayoutTemplate> <table id="table1" runat="server" style="border: thin solid #000000"> <tr> <th></th><th></th> <th>Type</th> <th>Description</th><th>Collected</th><th>Unknown <br />Location</th> </tr> <tr runat="server" id="itemPlaceholder" /> </table> </LayoutTemplate> </asp:ListView>
Thanks,
tinac99
Contributor
4242 Points
923 Posts
Jan 22, 2013 05:37 PM|LINK
This should help.
208 Points
81 Posts
Jan 22, 2013 05:43 PM|LINK
Hai
try
GridView1.RowStyle.BorderStyle = BorderStyle.None;
All-Star
118619 Points
18779 Posts
Jan 24, 2013 02:06 AM|LINK
tinac99 <table id="table1" runat="server" style="border: thin solid #000000">
A table with a runat=server will be converted to an HtmlTable (server-side control). So Just set its Border=0;
Jan 24, 2013 08:34 PM|LINK
The script is in a user control. I need the tables with border in other webpages so I need to set the borders to none programmatically.
Jan 24, 2013 08:35 PM|LINK
having problems with referencing a table inside a listview.
Jan 24, 2013 08:45 PM|LINK
HtmlTable table1 = (HtmlTable)ListView1.FindControl("table1");
if (table1 != null) { table1.Attributes.Remove("style"); }
tinac99
Member
74 Points
137 Posts
hide table borders in listview
Jan 22, 2013 04:49 PM|LINK
Hi,
Is there a way for me to programmatically hide the borders of the table in the listview?
<asp:ListView ID="ListView1" runat="server" DataSourceID="LinqDataSource1"
UseAccessibleHeader="True" AllowPaging="False" AllowSorting="False"
DataKeyNames="Id" SelectedIndex="1"
AutoGenerateColumns="False"
OnLayoutCreated="ListView1_OnLayoutCreated">
<LayoutTemplate>
<table id="table1" runat="server" style="border: thin solid #000000">
<tr>
<th></th><th></th>
<th>Type</th> <th>Description</th><th>Collected</th><th>Unknown <br />Location</th>
</tr>
<tr runat="server" id="itemPlaceholder" />
</table>
</LayoutTemplate>
</asp:ListView>
Thanks,
tinac99
_Manvel_
Contributor
4242 Points
923 Posts
Re: hide table borders in listview
Jan 22, 2013 05:37 PM|LINK
This should help.
rsrvs214
Member
208 Points
81 Posts
Re: hide table borders in listview
Jan 22, 2013 05:43 PM|LINK
Hai
try
GridView1.RowStyle.BorderStyle = BorderStyle.None;
Decker Dong ...
All-Star
118619 Points
18779 Posts
Re: hide table borders in listview
Jan 24, 2013 02:06 AM|LINK
Hi,
A table with a runat=server will be converted to an HtmlTable (server-side control). So Just set its Border=0;
tinac99
Member
74 Points
137 Posts
Re: hide table borders in listview
Jan 24, 2013 08:34 PM|LINK
The script is in a user control. I need the tables with border in other webpages so I need to set the borders to none programmatically.
tinac99
Member
74 Points
137 Posts
Re: hide table borders in listview
Jan 24, 2013 08:35 PM|LINK
having problems with referencing a table inside a listview.
tinac99
Member
74 Points
137 Posts
Re: hide table borders in listview
Jan 24, 2013 08:45 PM|LINK
HtmlTable table1 = (HtmlTable)ListView1.FindControl("table1");
if (table1 != null)
{
table1.Attributes.Remove("style");
}