[Feature Request]: `KryptonOutlookGridGroupBox` 'CreateGroupBox' method not found
See original GitHub issueHi!
I’ve been using the original KrptonOutlookGrid library from JDH Software. I have an additional method on this library, especifically on KryptonOutlookGridGroupBox.cs
:
/// <summary>
/// Handles the DragDrop event. Add a new grouping column following a drag drop from the grid
/// </summary>
/// <param name="column"></param>
/// <param name="sender">Source of the event.</param>
/// <param name="e">A DragEventArgs that contains the event data.</param>
public void CreateGroupBox(DataGridViewColumn column, string groupingType, SortOrder Order, bool sortBySummary)
{
string columnToMove = column.Name;
string columnName = column.Name;
string columnText = column.HeaderText;
SortOrder sortOrder;
DataGridViewColumnSortMode sortMode;
string[] res = columnToMove.Split('|');
sortOrder = Order;//SortOrder.Ascending;
if (sortOrder == SortOrder.None)
sortOrder = SortOrder.Ascending;
sortMode = (DataGridViewColumnSortMode)Enum.Parse(typeof(DataGridViewColumnSortMode), column.SortMode.ToString());
OutlookGridGroupBoxColumn colToAdd = new OutlookGridGroupBoxColumn(columnName, columnText, sortOrder, groupingType);
//if (res[4] == typeof(OutlookGridDateTimeGroup).Name)
colToAdd.GroupInterval = res[0];
colToAdd.SortBySummaryCount = sortBySummary;
if (!String.IsNullOrEmpty(columnToMove) && !columnsList.Contains(colToAdd) && sortMode != DataGridViewColumnSortMode.NotSortable)
{
/*
//Determine the position of the new Group amongst the others
int i = 0; //first group order is 0
//We are sure that we are going to browse the columns from left to right
foreach (OutlookGridGroupBoxColumn existingColumn in this.columnsList)
{
if (e.X > (existingColumn.Rect.X + existingColumn.Rect.Width / 2))
{
i++;
}
}
*/
columnsList.Insert(0, colToAdd);
//try
//{
//Warns the grid of a new grouping
OnColumnGroupAdded(new OutlookGridColumnEventArgs(new OutlookGridColumn(columnName, null, null, sortOrder, 0, -1)));
this.Invalidate();
//}
//catch (Exception exc)
//{
// MessageBox.Show("Failed to group.\n\n Error:" + exc.Message,
// "Grid GroupBox",
// MessageBoxButtons.OK,
// MessageBoxIcon.Error);
//}
}
}
This method is not included neither on the original library nor the new one. I don’t really know from where I have it, probably from github, but it’s not mine. I think it’s for creating groups without dragging columns, just by code. I would use it like this:
kryptonOutlookGridGroupBox1.CreateGroupBox(kryptonOutlookGrid1.Columns[2], "OutlookGridDefaultGroup", SortOrder.None, true);
It would crate groups from the values in kryptonOutlookGrid1.Columns[2] and group all the rows of the outlook grid. Is it possible to add it? Is there another way to accomplish this?
Thanks!
EDIT: Sorry for the formatting, I don’t know how to show the code well
Issue Analytics
- State:
- Created 2 years ago
- Comments:11 (6 by maintainers)
Hi @NintendoPlayer At the moment I’m working on this https://github.com/Krypton-Suite/Standard-Toolkit/issues/609. However, hopefully I can work on #290 soon.
Hi @Wagnerp! There you have it!
KryptonOutlookGrid.zip