Skip to content
This repository has been archived by the owner on May 29, 2024. It is now read-only.

Grid and borders #29

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

assemhakmeh
Copy link
Contributor

This enables independent control over grid outer border, and horizontal and vertical grid lines.
Also adds a CellPadding property to control column headers and generated cells internal padding; Doesn't affect DataTemplates.
Also fixes some minor issues: Column labels are now bound to Column.HorizontalContentAlignment instead of hard set to Center.
ListView separator visibility is set to None. (Xamarin ListView has a bug that leaves a single pixel line visible, it has been reported.)
Rows internal view properties for BackgroundColor, ColumnSpacing and Padding are now bound instead of set.

Breaking changes: Removes HeaderBackground and HeaderBordersVisible properties.

…ties. This allows for fine control over grid lines and the outer border cleanly.

CHANGED BorderThickness to control only the outer borders of the grid and moved the rendering of that from the internal views and rows to the containing Grid.
CHANGED outer Grid BackgroundColor to be bound to BorderColor. Rows now have background, spacing and padding properties bound rather than set.
NOTE: CellPadding applies only to cells created by the Grid. If a column uses a DataTemplate, it will not be affected by CellPadding. It is up to the DataTemplate to do so as needed.

BREAKING: Removed HeaderBackgroundProperty (Use HeaderLabelStyle instead) and HeaderBordersVisibleProperty (Use ColumnSeparatorWith and RowSeparatorHeight)
@assemhakmeh
Copy link
Contributor Author

assemhakmeh commented Mar 13, 2017 via email

@akgulebubekir
Copy link
Owner

Hi Assem,

Creating a new threat for v2.0 would be good. In that direction we can remove deprecated properties like HeaderTextColor, HeaderFontSize etc. but HeaderBordersVisible is not one of them and should be stay (see below definition).

HeadersBorderVisible : it uses for hiding header's border. Please see image below.
image

…ation to use the Margins around the HeaderView and ListView. This allows the HeaderBordersVisible property to completely turn off the borders and grid lines of the HeaderView.
@assemhakmeh
Copy link
Contributor Author

I've improved the borders implementation to allow HeaderBordersVisible to work correctly.

…. The previous implementation on set the background of the header when header borders were not shown.

The property now controls the background color of the header cell grids created internally. It is used as a fallback (via trigger) when the HeaderLabel style sets a Transparent background.
@akgulebubekir
Copy link
Owner

HeaderBordersVisible seems not working properly(see below screenshot)
image

PullToRefreshCommand="{Binding RefreshCommand}" IsRefreshing="{Binding IsRefreshing}"
ActiveRowColor="#8899AA">
ActiveRowColor="#8899AA" ColumnSeparatorWidth="2.5" RowSeparatorHeight="1.5"
BorderThickness="4" CellPadding="8" HeaderBordersVisible="true">
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BorderThickness="4" make very thick border please make it thin.

@assemhakmeh
Copy link
Contributor Author

assemhakmeh commented Mar 14, 2017 via email

@akgulebubekir
Copy link
Owner

it appears on windows platform (both UWP and WinRT)

@assemhakmeh
Copy link
Contributor Author

I installed VS Community with Xamarin and built the UWP to see where this black line is coming from. In my env, this line seems to be an overlay and isn't caused by the changes in this pull-request as far as i can tell. I would appreciate your help with further debugging but I changed padding on contentView for the sample and this bar appears to hover outside of the DataGrid. It also does not appear in the release build. Please see images attached.

dg-uwp-debug

dg-uwp-release

…_borders

* commit '20f0c36e8c86d4f68a40e327a70f3a58572ec813':
  License updated to MIT
…_borders

* commit '3d276285b4dd17b5f8e59483e0b2c3b677216a37':
  FormattedTitle feature added

# Conflicts:
#	DataGridSample/DataGridSample/Views/MainPage.xaml
@akgulebubekir
Copy link
Owner

Once I set HeaderBackgroundColor="Red" I would expect to see red backgrounded header, but it does not.

@assemhakmeh
Copy link
Contributor Author

assemhakmeh commented Apr 14, 2017 via email

@akgulebubekir
Copy link
Owner

How about Sorting icon ? what if it is PNG and has transparent background. The background under sorting icon will remain as BorderColor.

@assemhakmeh
Copy link
Contributor Author

assemhakmeh commented Apr 14, 2017 via email

@assemhakmeh
Copy link
Contributor Author

Are we ok to proceed with this PR?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants