简体   繁体   中英

Issues with Border in Custom Grid View in Wp7

I am presently creating customGrid table,and problem that i presently face is border of the every cell,I am getting this dot like structure which reflects from background,Can i now how could it be recitified.

在此处输入图片说明

and code i used is

 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);

any Property that needs to be changed to avoid that dot border in end of every cell?

You should set the Grid.ShowGridLines to be false:

tableGrid.ShowGridLines = false;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM