Reputation: 63
in the following is my gridview and i want to delete all borders.
How could be this possible to do? because i tried a lot but couldn't got succeeded.
Upvotes: 2
Views: 21097
Reputation: 743
2 ways. You can do this with design view click on the gridview and choose Gridlines:both to Gridlines:none or give the grid a cssclass and the nborder:none
Upvotes: 1
Reputation: 18916
Have you tried to set the property "GridLines" to "none" of the gridview? It should make it.
Otherwise, you could try to to create as CSS Class ;
<style type="text/css">
.MyClass {
border:none // As @DiederikEEn said.
}
.MyClass td{
border:none // As @DiederikEEn said.
}
</style>
And set a the CssClass of your gridview like that :
<asp:GridView runat="server" id="myGridView" CssClass="MyClass">
[...]
</asp:GridView
Upvotes: 1
Reputation: 9074
You will have to Add RowDataBound
event in GridView control:
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
TableCell tCell = e.Row.Cells[2];
tCell.Attributes["style"] = "border-right:0";
}
Also Try With
<ItemStyle border="0" />
With Properties:
BorderStyle>>RowStyle:none
Hope Its Helpful.
Upvotes: 3