Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuriyGS <grigorchuk@ugpa.ru>2017-11-30 11:27:04 +0300
committerYuriyGS <grigorchuk@ugpa.ru>2017-11-30 11:27:04 +0300
commit0c873d207a1539ef4e9d3d6bd38cfea5f64ed316 (patch)
tree4202b0133626c5d48dc278f34bee303d2758f887 /mcs/class/System.Windows.Forms
parent2bd75f83ea38b2913c98937a57088c531bde17d0 (diff)
AdjustCellBorderStyle - implemented edge/non-edge header/non-header row and column border styles fixed.
Fixed singleVerticalBorderAdded and singleHorizontalBorderAdded flags for the AdjustCellBorderStyle method call.
Diffstat (limited to 'mcs/class/System.Windows.Forms')
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/DataGridViewCell.cs26
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/DataGridViewRow.cs5
2 files changed, 30 insertions, 1 deletions
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/DataGridViewCell.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/DataGridViewCell.cs
index c34973ec4c7..6a89cc3d4b2 100644
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/DataGridViewCell.cs
+++ b/mcs/class/System.Windows.Forms/System.Windows.Forms/DataGridViewCell.cs
@@ -432,6 +432,32 @@ namespace System.Windows.Forms {
[EditorBrowsable (EditorBrowsableState.Advanced)]
public virtual DataGridViewAdvancedBorderStyle AdjustCellBorderStyle (DataGridViewAdvancedBorderStyle dataGridViewAdvancedBorderStyleInput, DataGridViewAdvancedBorderStyle dataGridViewAdvancedBorderStylePlaceholder, bool singleVerticalBorderAdded, bool singleHorizontalBorderAdded, bool isFirstDisplayedColumn, bool isFirstDisplayedRow) {
+ if (dataGridViewAdvancedBorderStyleInput.All == DataGridViewAdvancedCellBorderStyle.Single) {
+
+ dataGridViewAdvancedBorderStylePlaceholder.Left = (isFirstDisplayedColumn && singleVerticalBorderAdded) ? DataGridViewAdvancedCellBorderStyle.Single : DataGridViewAdvancedCellBorderStyle.None;
+ dataGridViewAdvancedBorderStylePlaceholder.Right = DataGridViewAdvancedCellBorderStyle.Single;
+ dataGridViewAdvancedBorderStylePlaceholder.Top = (isFirstDisplayedRow && singleHorizontalBorderAdded)? DataGridViewAdvancedCellBorderStyle.Single : DataGridViewAdvancedCellBorderStyle.None;
+ dataGridViewAdvancedBorderStylePlaceholder.Bottom = DataGridViewAdvancedCellBorderStyle.Single;
+ return dataGridViewAdvancedBorderStylePlaceholder;
+ }
+
+ if ((dataGridViewAdvancedBorderStyleInput.All == DataGridViewAdvancedCellBorderStyle.NotSet) && (DataGridView != null) && (DataGridView.AdvancedCellBorderStyle == dataGridViewAdvancedBorderStyleInput)) {
+ if (DataGridView.CellBorderStyle == DataGridViewCellBorderStyle.SingleVertical) {
+ dataGridViewAdvancedBorderStylePlaceholder.Left = (isFirstDisplayedColumn && singleVerticalBorderAdded) ? DataGridViewAdvancedCellBorderStyle.Single : DataGridViewAdvancedCellBorderStyle.None;
+ dataGridViewAdvancedBorderStylePlaceholder.Right = DataGridViewAdvancedCellBorderStyle.Single;
+ dataGridViewAdvancedBorderStylePlaceholder.Top = DataGridViewAdvancedCellBorderStyle.None;
+ dataGridViewAdvancedBorderStylePlaceholder.Bottom = DataGridViewAdvancedCellBorderStyle.None;
+ return dataGridViewAdvancedBorderStylePlaceholder;
+ }
+ if (DataGridView.CellBorderStyle == DataGridViewCellBorderStyle.SingleHorizontal) {
+ dataGridViewAdvancedBorderStylePlaceholder.Left = DataGridViewAdvancedCellBorderStyle.None;
+ dataGridViewAdvancedBorderStylePlaceholder.Right = DataGridViewAdvancedCellBorderStyle.None;
+ dataGridViewAdvancedBorderStylePlaceholder.Top = (isFirstDisplayedRow && singleHorizontalBorderAdded)? DataGridViewAdvancedCellBorderStyle.Single : DataGridViewAdvancedCellBorderStyle.None;
+ dataGridViewAdvancedBorderStylePlaceholder.Bottom = DataGridViewAdvancedCellBorderStyle.Single;
+ return dataGridViewAdvancedBorderStylePlaceholder;
+ }
+ }
+
return dataGridViewAdvancedBorderStyleInput;
}
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/DataGridViewRow.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/DataGridViewRow.cs
index 300ed426ec8..ac7d7029cd1 100644
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/DataGridViewRow.cs
+++ b/mcs/class/System.Windows.Forms/System.Windows.Forms/DataGridViewRow.cs
@@ -557,6 +557,9 @@ namespace System.Windows.Forms
bounds.X += DataGridView.RowHeadersWidth;
bounds.Width -= DataGridView.RowHeadersWidth;
}
+
+ bool singleVerticalBorderAdded = !DataGridView.RowHeadersVisible;
+ bool singleHorizontalBorderAdded = !DataGridView.ColumnHeadersVisible;
for (int i = DataGridView.first_col_index; i < sortedColumns.Count; i++) {
DataGridViewColumn col = sortedColumns[i];
@@ -593,7 +596,7 @@ namespace System.Windows.Forms
}
DataGridViewAdvancedBorderStyle intermediateBorderStyle = (DataGridViewAdvancedBorderStyle)((ICloneable)DataGridView.AdvancedCellBorderStyle).Clone ();
- DataGridViewAdvancedBorderStyle borderStyle = cell.AdjustCellBorderStyle (DataGridView.AdvancedCellBorderStyle, intermediateBorderStyle, true, true, cell.ColumnIndex == 0, cell.RowIndex == 0);
+ DataGridViewAdvancedBorderStyle borderStyle = cell.AdjustCellBorderStyle (DataGridView.AdvancedCellBorderStyle, intermediateBorderStyle, singleVerticalBorderAdded, singleHorizontalBorderAdded, cell.ColumnIndex == 0, cell.RowIndex == 0);
DataGridView.OnCellFormattingInternal (new DataGridViewCellFormattingEventArgs (cell.ColumnIndex, cell.RowIndex, value, cell.FormattedValueType, style));