[英]Issues with Border in Custom Grid View in Wp7
我現在正在創建customGrid表,而我現在面臨的問題是每個單元格的邊界,我正在得到這種點狀的結構,它可以從背景中反映出來,現在我可以將它復述了。
我使用的代碼是
GridLength len2 = new GridLength(value);
Column.Width = len2;
tableGrid.ColumnDefinitions.Add(Column);
TextBlock textBlock = new TextBlock();
if (i == 0)
{
textBlock.Text = headers[j];
textBlock.FontSize = 35;
border = new Border();
border.Background = new SolidColorBrush(Colors.LightGray);
border.BorderBrush = new SolidColorBrush(Colors.White);
textBlock.HorizontalAlignment = HorizontalAlignment.Center;
textBlock.VerticalAlignment = VerticalAlignment.Center;
textBlock.Foreground = new SolidColorBrush(Colors.Black);
}
else
{
Debug.WriteLine("Data Value j is"+dataValues[j]);
textBlock.Text = "Content" + i + "/" + j;
//textBlock.Text = dataValues[j];
textBlock.FontSize = 25;
border = new Border();
textBlock.HorizontalAlignment = HorizontalAlignment.Center;
SolidColorBrush brush = GetColorFromHexa("0FFB0C4DE");/*0FFB0C4DE*/
border.Background = brush;
border.BorderBrush = new SolidColorBrush(Colors.White);
}
Grid.SetRow(border, i);
Grid.SetColumn(border, j);
tableGrid.Children.Add(border);
Grid.SetRow(textBlock, i);
Grid.SetColumn(textBlock, j);
tableGrid.Children.Add(textBlock);
是否需要更改任何屬性以避免每個單元格末尾出現該點邊框?
您應該將Grid.ShowGridLines設置為false:
tableGrid.ShowGridLines = false;
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.