views:

22

answers:

1

Hi I have am using nested GridView to show Customers in the mainGrid View and CustomerDetails in the Inner GridView. for the outer GridView there is a CellPadding set of 4px. Now when i use nested gridview, I do not want the Pading to be apllied for the cell containing the InnerGridView. Please help me with this. I am stuck on this issue since 4-5 hours and could not find any workaround.

Regards, Harshal

A: 

Try style="padding top right bottom left" at the cell level instead of CellPadding at the table level.

Here is an example:

<table border = 1>
<tr>
<td style="padding:10">Some text with 10 padding all around</td>
<td>Some other text without padding</td>
<tr>
<tr>
<td style="padding:0 10 0 10">Some text with padding on the sides only</td>
<td>Some text without padding</td>
</tr>
</table>
Danny T.
Hi Danny thanks for your suggestion, but I am using a GridView which renders the table internally.. so can not directly set the Padding differently for each cell.
Harshal
Eventhough i got the solution of adding below lines in RowDataBound- e.Row.Cells[3].Attributes.Add("style", "padding:0px;"); e.Row.Cells[4].Attributes.Add("style", "padding:0px;"); But still could not add GridLines to the nested gridview Rows.
Harshal
Got solution. Had to ask UI designer for creating a style for nested tables.
Harshal