2010-10-25 119 views
0

您好我正在使用嵌套的GridView在InnerGridView的mainGrid視圖和CustomerDetails中顯示Customers。對於外部GridView,有一個4px的CellPadding集合。現在,當我使用嵌套的gridview時,我不希望Pading被包含InnerGridView的單元平滑。請幫我解決一下這個。我在4-5小時後停留在此問題上,並找不到任何解決方法。嵌套GridView的樣式asp.net

問候, Harshal

回答

0

嘗試style="padding top right bottom left"在細胞水平上,而不是CellPadding在表級別。

下面是一個例子:

<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> 
+0

喜丹尼感謝您的建議,但我使用一個GridView在內部使表..所以不能直接設定不同的填充每個單元格。 – 2010-10-25 15:50:36

+0

儘管我在RowDataBound- e.Row.Cells [3] .Attributes.Add(「style」,「padding:0px;」); e.Row.Cells [4] .Attributes.Add(「style」,「padding:0px;」);但仍然無法將GridLines添加到嵌套的gridview行。 – 2010-10-25 15:51:31

+0

有解決辦法。不得不要求UI設計者爲嵌套表創建樣式。 – 2010-10-30 04:41:57