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

[Bug]: KDataGridView Cell Borders #499

Closed
Wagnerp opened this issue Nov 29, 2021 · 8 comments
Closed

[Bug]: KDataGridView Cell Borders #499

Wagnerp opened this issue Nov 29, 2021 · 8 comments
Labels
bug Something isn't working DataGrid fixed This issue has been fixed.
Milestone

Comments

@Wagnerp
Copy link
Contributor

Wagnerp commented Nov 29, 2021

Bug reported by Erik on Discord

Toolkit version: Canary 6.2111.310-beta

Use the included program to reproduce.

Cell Borders are still displayed when set to false. Somewhat similar inconsistent behaviour with KForm
State.(Common, Normal, etc.).DataCell.Border has 2 properties that handle the cell borders:

  1. Draw
  2. DrawBorders

When DrawBorders has one one or more options checked and Draw is set to False the cell-borders are
still shown.

Also the KryptonFrom object has similar behaviour (pic. 2) Only some of the border are

Is this the correct behaviour.

This shows Draw = False and still cell borders are present.

image

KForm has somewhat similar behaviour. Although setting draw to False and using RED as the border colour will turn the border colour to Black. But still draws the border. Only deselecting all DrawBorders options will remove the border.State(Active, Inactive Common).Border & .Header.Border all have similar behaviour.

image

KDataGridViewBorders.zip

@Wagnerp Wagnerp added the bug Something isn't working label Nov 29, 2021
@mbsysde99
Copy link

For KryptonDataGridView border bug, look at KryptonDataGridView.cs

protected override void OnCellPainting(DataGridViewCellPaintingEventArgs e)
{	
        // I hid the rest of the code for easy viewing.
        // ...

        // add this to correct behaviour.
	if (this.StateCommon.DataCell.Border.Draw == InheritBool.True)
	{
		Renderer.RenderStandardBorder.DrawBorder(renderContext, tempCellBounds, _borderForced, VisualOrientation.Top, state);
	}

        // I hid the rest of the code for easy viewing.
        // ...
}

Result:
image
image
image

@Smurf-IV Smurf-IV self-assigned this Dec 5, 2021
@Smurf-IV Smurf-IV added the in progress A fix for this issue is in the works. label Dec 5, 2021
@Smurf-IV
Copy link
Member

Smurf-IV commented Dec 5, 2021

cheers @mbsysde99 I'll create a PR and see if it still works in the Current test apps today.

@Smurf-IV
Copy link
Member

Smurf-IV commented Dec 5, 2021

I see why this has been missed in testing, If the DrawBorders is set to None then nothing is drawn as expected.
It never occurred for the test to also include the Draw value as well !

@Smurf-IV
Copy link
Member

Smurf-IV commented Dec 5, 2021

I'll have to modify the code to take into account the other states..
Not going to be as quick as the solution given, but at least it's a start !

@Smurf-IV
Copy link
Member

Smurf-IV commented Dec 5, 2021

Done:
Example

Smurf-IV added a commit to Krypton-Suite/Standard-Toolkit-Demos that referenced this issue Dec 5, 2021
- Add Example gif
- Change the layout of the Readme to be able to see examples straight away
Tests: Krypton-Suite/Standard-Toolkit#499
@Smurf-IV Smurf-IV changed the title [Bug]: KDataGridView Cell Borders & KForm Borders [Bug]: KDataGridView Cell Borders Dec 5, 2021
@Smurf-IV
Copy link
Member

Smurf-IV commented Dec 5, 2021

Note: Please generate a new Bug for the form borders with a specific example just for that

@Wagnerp
Copy link
Contributor Author

Wagnerp commented Dec 5, 2021

Note: Please generate a new Bug for the form borders with a specific example just for that

Are the KForm borders messed up?

Smurf-IV added a commit that referenced this issue Dec 5, 2021
@Smurf-IV
Copy link
Member

Smurf-IV commented Dec 5, 2021

Note: Please generate a new Bug for the form borders with a specific example just for that

Are the KForm borders messed up?

Comment based on Original title and comment in original description.
This fix is "Just" for the DataGrid borders (Cell's / rows / headers)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working DataGrid fixed This issue has been fixed.
Projects
None yet
Development

No branches or pull requests

3 participants