Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting rid of borders in GridView, WPF/WinForms issues #2703

Open
ris-work opened this issue Nov 20, 2024 · 0 comments
Open

Getting rid of borders in GridView, WPF/WinForms issues #2703

ris-work opened this issue Nov 20, 2024 · 0 comments

Comments

@ris-work
Copy link

Expected Behavior

The borders are gone.

Actual Behavior

The borders are still there. I don't know what those black and white boxes are.
I even tried setting WPF GridView's border brush to transparent. Didn't work.
What are those? On WinForms, I am unable to style the selected row, but the borders aren't there.

eto_exhibit

Steps to Reproduce the Problem

Create a GridView.
Load it up with random entries.

Code that Demonstrates the Problem

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Eto.Forms;
using Eto;
using System.IO;

namespace HealthMonitorLogViewer
{
    public class NavigableListFormMinimal: Form
    {
        public NavigableListFormMinimal()
        {
            GridView LB = new GridView() { ShowHeader = false, GridLines = GridLines.None };
            LB.Size = new Eto.Drawing.Size(200, 600);
            LB.Columns.Add(new GridColumn() { HeaderText = "Navigate to...", DataCell = new TextBoxCell(0){ } });
            LB.BackgroundColor = Eto.Drawing.Colors.Black;
            //LB.TextColor = Eto.Drawing.Colors.White;
            //LB.Font = new Eto.Drawing.Font("Courier", 18);
            
            Panel CurrentPanel = new Panel();
            
            var loadOncePanels = new List<string>() {
                "Network Stats Panel",
                "Network Stats Panel 2",
                "Network Stats Panel 3",
                "Network Stats Panel 4"
            };
            LB.DataStore = loadOncePanels.Select(x => new List<string>() { x  }).ToList();
            Content = new StackLayout(new StackLayoutItem(LB), new StackLayoutItem(CurrentPanel)) { Orientation = Orientation.Horizontal, Spacing = 10 };
            LB.GridLines = GridLines.None;

            LB.CellFormatting += (e, a) => {
                if (a.Row == LB.SelectedRow)
                {
                    a.ForegroundColor = Eto.Drawing.Colors.Black;
                    a.BackgroundColor = Eto.Drawing.Colors.White;
                    
                }
                else
                {
                    a.ForegroundColor = Eto.Drawing.Colors.Wheat;
                    a.BackgroundColor = Eto.Drawing.Colors.Black;
                }
                a.Font = new Eto.Drawing.Font("Segoe UI", 10, Eto.Drawing.FontStyle.Bold, Eto.Drawing.FontDecoration.None);
            };
            BackgroundColor = Eto.Drawing.Colors.Black;
            Padding = 10;
        }
    }
}

Specifications

  • Version:
  • Platform(s): WPF, WinForms
  • Operating System(s): Windows 10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant