Declined
Last Updated: 21 Oct 2015 13:58 by ADMIN
To reproduce:

public Form1()
{
    InitializeComponent();

    this.radGridView1.CellFormatting+=radGridView1_CellFormatting;
    DataTable dt = new DataTable();
    dt.Columns.Add("Id", typeof(int));
    dt.Columns.Add("Name",typeof(string));
    for (int i = 0; i < 100; i++)
    {
        dt.Rows.Add(i,"Item"+i);
    }
    this.radGridView1.DataSource = dt;
    this.radGridView1.AutoSizeColumnsMode = Telerik.WinControls.UI.GridViewAutoSizeColumnsMode.Fill;
}

private void radGridView1_CellFormatting(object sender, Telerik.WinControls.UI.CellFormattingEventArgs e)
{
    e.Row.Height = 40;
}

private void radButton1_Click(object sender, EventArgs e)
{
     this.radGridView1.TableElement.ScrollToRow(this.radGridView1.Rows.Count - 1);
}

Workaround: instead of using the CellFormatting event to set the Row.Height, you can set the TableElement.RowHeight property.
Completed
Last Updated: 12 Dec 2016 13:02 by ADMIN
ADMIN
Created by: Dess | Tech Support Engineer, Principal
Comments: 1
Category: GridView
Type: Feature Request
1
The AllowNaturalSort  property should indicate whether the no-sort state when changing sort order will be allowed.

Workaround:

Private Sub SortChanging(sender As Object, e As Telerik.WinControls.UI.GridViewCollectionChangingEventArgs)
    If e.Action = NotifyCollectionChangedAction.Remove AndAlso e.OldValue = ListSortDirection.Descending Then
        e.Cancel = True
        For Each sd As SortDescriptor In Me.RadGridView1.SortDescriptors
            If sd.PropertyName = e.PropertyName Then
                sd.Direction = ListSortDirection.Ascending
            End If
        Next
    End If
End Sub
Completed
Last Updated: 20 Oct 2015 08:37 by ADMIN
To reproduce:
- Use this code:
private void Form1_Load(object sender, EventArgs e)
{
    CenterToParent();

    radGridView1.CellEditorInitialized += radGridView1_CellEditorInitialized;

    GridViewTextBoxColumn columnName = new GridViewTextBoxColumn();
    columnName.Name = "Name";
    columnName.HeaderText = "Name";
    columnName.FieldName = "Name";
    columnName.MaxLength = 50;
    columnName.Width = 200;
    columnName.TextAlignment = ContentAlignment.MiddleLeft;
    radGridView1.MasterTemplate.Columns.Add(columnName);

    GridViewDateTimeColumn columnDate = new GridViewDateTimeColumn();
    columnDate.Name = "Date";
    columnDate.HeaderText = "Date";
    columnDate.FieldName = "Date";
    columnDate.Format = DateTimePickerFormat.Custom;
    columnDate.CustomFormat = "MM/dd/yyyy";
    columnDate.FormatString = "{0:MM/dd/yyyy}";
    columnDate.NullValue = null;
    columnDate.Width = 100;
    this.radGridView1.Columns.Add(columnDate);

    radGridView1.Rows.Add("Row 1", null);
    radGridView1.Rows.Add("Row 2", null);
    radGridView1.Rows.Add("Row 3", null);
    radGridView1.Rows.Add("Row 4", null);
}

void radGridView1_CellEditorInitialized(object sender, GridViewCellEventArgs e)
{
    if (e.ActiveEditor is RadDateTimeEditor)
    {
        ((RadDateTimePickerElement)((RadDateTimeEditor)e.ActiveEditor).EditorElement).TextBoxElement.MaskType = MaskType.FreeFormDateTime;
      
    }
}

- Start the application and star edition date time value. You will notice that the editor value is initialized incorrectly. This occurs only when the cell is edited for the firs time.

Workaround:
void radGridView1_CellEditorInitialized(object sender, GridViewCellEventArgs e)
{
    if (e.ActiveEditor is RadDateTimeEditor)
    {
        ((RadDateTimePickerElement)((RadDateTimeEditor)e.ActiveEditor).EditorElement).TextBoxElement.MaskType = MaskType.FreeFormDateTime;
        e.ActiveEditor.Value = radGridView1.CurrentCell.Value;
    }
}
Completed
Last Updated: 08 Sep 2015 11:37 by ADMIN
To reproducce:
- Set the format of a GridViewDateTime column as follows:
GridViewDateTimeColumn dateTimeColumn1 = radGridView1.Columns[3] as GridViewDateTimeColumn;
dateTimeColumn1.Format = DateTimePickerFormat.Custom;

dateTimeColumn1.CustomFormat = "dd.MM.yyyy HH:mm";
dateTimeColumn1.FormatString = "dd.MM.yyyy HH:mm";

- Start the application and try to enter the time.
- You will notice that the caret is moved to the firs item.

Workaround 
void radGridView1_CellEditorInitialized(object sender, GridViewCellEventArgs e)
{
    RadDateTimeEditor editor = e.ActiveEditor as RadDateTimeEditor;
    if (editor != null)
    {
        RadDateTimeEditorElement element = editor.EditorElement as RadDateTimeEditorElement;
        element.TextBoxElement.TextBoxItem.RouteMessages = true;
     
    }
}
Completed
Last Updated: 09 Sep 2015 11:28 by ADMIN
To reproduce:

public Form1()
        {
            InitializeComponent();
            
            this.radGridView1.ReadOnly = true;
            this.radGridView1.MasterTemplate.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill;
            this.radGridView1.DataSource = CreateDataSource();
            this.radGridView1.Relations.AddSelfReference(this.radGridView1.MasterTemplate, "ID", "ParentID");

            this.radGridView1.Columns["ID"].IsVisible = false;
            this.radGridView1.Columns["ParentID"].IsVisible = false;

            this.radGridView1.MultiSelect = true;
            this.radGridView1.SelectionMode = GridViewSelectionMode.CellSelect;
        }

        private static DataTable CreateDataSource()
        {
            DataTable dataSource = new DataTable("fileSystem");
            dataSource.Columns.Add("ID", typeof(int));
            dataSource.Columns.Add("ParentID", typeof(int));
            dataSource.Columns.Add("Name", typeof(string));
            dataSource.Columns.Add("Date", typeof(DateTime));
            dataSource.Columns.Add("Type", typeof(string));
            dataSource.Columns.Add("Size", typeof(int));

            dataSource.Rows.Add(1, null, "Program Files", DateTime.Now.AddDays(-100), "Folder", 5120);
            dataSource.Rows.Add(2, 1, "Visual Studio 2010", DateTime.Now.AddDays(-100), "Folder", 3220);
            dataSource.Rows.Add(3, 2, "bin", DateTime.Now.AddDays(-100), "Folder", 3220);
            dataSource.Rows.Add(4, 2, "READEME.txt", DateTime.Now.AddDays(-100), "Text Document", 3);

            dataSource.Rows.Add(5, 1, "Telerik RadControls", DateTime.Now.AddDays(-10), "Folder", 3120);
            dataSource.Rows.Add(6, 5, "Telerik UI for Winforms", DateTime.Now.AddDays(-10), "Folder", 101);
            dataSource.Rows.Add(7, 5, "Telerik UI for Silverlight", DateTime.Now.AddDays(-10), "Folder", 123);
            dataSource.Rows.Add(8, 5, "Telerik UI for WPF", DateTime.Now.AddDays(-10), "Folder", 221);
            dataSource.Rows.Add(9, 5, "Telerik UI for ASP.NET AJAX", DateTime.Now.AddDays(-10), "Folder", 121);

            dataSource.Rows.Add(10, 1, "Microsoft Office 2010", DateTime.Now.AddDays(-120), "Folder", 1230);
            dataSource.Rows.Add(11, 10, "Microsoft Word 2010", DateTime.Now.AddDays(-120), "Folder", 1230);
            dataSource.Rows.Add(12, 10, "Microsoft Excel 2010", DateTime.Now.AddDays(-120), "Folder", 1230);
            dataSource.Rows.Add(13, 10, "Microsoft Powerpoint 2010", DateTime.Now.AddDays(-120), "Folder", 1230);

            dataSource.Rows.Add(14, 1, "Debug Diagnostic Tools v1.0", DateTime.Now.AddDays(-400), "Folder", 2120);
            dataSource.Rows.Add(15, 1, "Designer's 3D Tools", DateTime.Now.AddDays(-500), "Folder", 1120);
            dataSource.Rows.Add(16, 1, "Communication", DateTime.Now.AddDays(-700), "Folder", 120);

            dataSource.Rows.Add(17, null, "My Documents", DateTime.Now.AddDays(-200), "Folder", 1024);
            dataSource.Rows.Add(18, 17, "Salaries.xlsx", DateTime.Now.AddDays(-200), "Excel File", 1);
            dataSource.Rows.Add(19, 17, "RecessionAnalysis.xlsx", DateTime.Now.AddDays(-200), "Excel File", 1);

            dataSource.Rows.Add(20, null, "Windows", DateTime.Now.AddDays(-100), "Folder", 10240);

            dataSource.Rows.Add(21, 20, "System32", DateTime.Now.AddDays(-220), "Folder", 510);
            dataSource.Rows.Add(22, 20, "assembly", DateTime.Now.AddDays(-20), "Folder", 240);

            dataSource.Rows.Add(23, 22, "System.Data.dll", DateTime.Now.AddDays(-20), "Assembly File", 4);
            dataSource.Rows.Add(24, 22, "System.Core.dll", DateTime.Now.AddDays(-20), "Assembly File", 2);
            dataSource.Rows.Add(25, 22, "System.Drawings.dll", DateTime.Now.AddDays(-20), "Assembly File", 3);
            dataSource.Rows.Add(26, 22, "Telerik.WinControls.UI.dll", DateTime.Now.AddDays(-20), "Assembly File", 5);

            dataSource.Rows.Add(27, null, "Users", DateTime.Now.AddDays(-100), "Folder", 5512);
            dataSource.Rows.Add(28, 27, "Administrator", DateTime.Now.AddDays(-100), "Folder", 1512);
            dataSource.Rows.Add(29, 27, "Guest", DateTime.Now.AddDays(-100), "Folder", 2512);
            dataSource.Rows.Add(30, 27, "User1", DateTime.Now.AddDays(-100), "Folder", 3512);

            dataSource.Rows.Add(31, null, "Share", DateTime.Now.AddDays(-50), "Folder", 15360);
            dataSource.Rows.Add(32, 31, "Photos", DateTime.Now.AddDays(-50), "Folder", 360);
            dataSource.Rows.Add(33, 32, "Flowers.JPG", DateTime.Now.AddDays(-50), "JPEG File", 1);
            dataSource.Rows.Add(34, 32, "Panda.GIF", DateTime.Now.AddDays(-50), "GIF File", 3);
            dataSource.Rows.Add(35, 32, "Landscape.png", DateTime.Now.AddDays(-50), "PNG File", 4);

            dataSource.Rows.Add(36, null, "Music", DateTime.Now.AddDays(-2), "Folder", 0);
            dataSource.Rows.Add(37, 36, "Mozart", DateTime.Now.AddDays(-3), "Folder", 0);
            dataSource.Rows.Add(38, 36, "Pavarotti", DateTime.Now.AddDays(-40), "Folder", 0);
            dataSource.Rows.Add(39, 36, "AC/DC", DateTime.Now.AddDays(-50), "Folder", 0);
            dataSource.Rows.Add(40, 36, "Queen", DateTime.Now.AddDays(-8), "Folder", 0);

            dataSource.Rows.Add(33, null, "Boot.ini", DateTime.Now.AddDays(-10), "INI File", 0);

            return dataSource;
        }

Workaround: custom row behavior 

 //replace row behavior for hierarchical rows
 BaseGridBehavior behavior = (BaseGridBehavior)this.radGridView1.GridBehavior;
 behavior.UnregisterBehavior(typeof(GridViewHierarchyRowInfo));
 behavior.RegisterBehavior(typeof(GridViewHierarchyRowInfo), new MyGridHierarchyRowBehavior());
 //replace row behavior for data rows
 behavior.UnregisterBehavior(typeof(GridViewDataRowInfo));
 behavior.RegisterBehavior(typeof(GridViewDataRowInfo), new MyGridDataRowBehavior());

   public class MyGridHierarchyRowBehavior : GridHierarchyRowBehavior
    {
        protected override bool ProcessMouseSelection(Point mousePosition, GridCellElement currentCell)
        {
            if (this.RootGridBehavior.LockedBehavior != this)
            {
                this.GridControl.Capture = true;
                this.RootGridBehavior.LockBehavior(this);
            }

            bool result = this.DoMouseSelection(currentCell, mousePosition);

            return result;
        }

        private bool DoMouseSelection(GridCellElement currentCell, Point currentLocation)
        {
            if (!this.MasterTemplate.MultiSelect || this.GridViewElement.Template.AllowRowReorder)
            {
                return false;
            }

            Point mouseDownLocation = (Point)typeof(GridRowBehavior).GetField("mouseDownLocation", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(this);
            Rectangle rect = new Rectangle(mouseDownLocation.X - SystemInformation.DragSize.Width / 2, mouseDownLocation.Y - SystemInformation.DragSize.Height / 2,
                SystemInformation.DragSize.Width, SystemInformation.DragSize.Height);

            if (rect.Contains(currentLocation))
            {
                return false;
            }

            GridTableElement tableElement = this.GridViewElement.CurrentView as GridTableElement;

            if (tableElement == null)
            {
                return false;
            }

            bool selectionStartedOnAPinnedColumn = (bool)typeof(GridRowBehavior).GetField("selectionStartedOnAPinnedColumn", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(this);
            bool mouseDownOnLeftPinnedColumn = (bool)typeof(GridRowBehavior).GetField("mouseDownOnLeftPinnedColumn", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(this);
            bool mouseDownOnRightPinnedColumn = (bool)typeof(GridRowBehavior).GetField("mouseDownOnRightPinnedColumn", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(this);
            bool selectionStartedOnAPinnedRow = (bool)typeof(GridRowBehavior).GetField("selectionStartedOnAPinnedRow", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(this);
            bool mouseDownOnTopPinnedRow = (bool)typeof(GridRowBehavior).GetField("mouseDownOnTopPinnedRow", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(this);
            bool mouseDownOnBottomPinnedRow = (bool)typeof(GridRowBehavior).GetField("mouseDownOnBottomPinnedRow", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(this);

            if (selectionStartedOnAPinnedColumn && this.GetViewportBounds(tableElement).Contains(currentLocation))
            {
                if (mouseDownOnLeftPinnedColumn)
                {
                    tableElement.HScrollBar.Value = tableElement.HScrollBar.Minimum;
                    mouseDownOnLeftPinnedColumn = false;
                }

                if (mouseDownOnRightPinnedColumn)
                {
                    tableElement.HScrollBar.Value = tableElement.HScrollBar.Maximum - tableElement.HScrollBar.LargeChange + 1;
                    mouseDownOnRightPinnedColumn = false;
                }

                selectionStartedOnAPinnedColumn = false;
            }

            if (selectionStartedOnAPinnedRow && this.GetViewportBounds(tableElement).Contains(currentLocation))
            {
                if (mouseDownOnTopPinnedRow)
                {
                    tableElement.VScrollBar.Value = tableElement.VScrollBar.Minimum;
                    mouseDownOnTopPinnedRow = false;
                }

                if (mouseDownOnBottomPinnedRow)
                {
                    tableElement.VScrollBar.Value = tableElement.VScrollBar.Maximum - tableElement.VScrollBar.LargeChange + 1;
                    mouseDownOnBottomPinnedRow = false;
                }

                selectionStartedOnAPinnedRow = false;
            }

            if (currentCell.RowInfo is GridViewDataRowInfo)
            {
                if (this.MasterTemplate.SelectionMode == GridViewSelectionMode.FullRowSelect)
                {
                    typeof(GridHierarchyRowBehavior).GetMethod("DoMultiFullRowSelect", BindingFlags.Instance | BindingFlags.NonPublic).Invoke(this, new object[] { currentCell, currentLocation });
                }
                else
                {
                    this.DoMultiCellSelect(currentCell, currentLocation);
                }
            }

            return true;
        }

        private GridRowElement GetFirstScrollableRowElement(GridTableElement tableElement)
        {
            if (tableElement.ViewElement.ScrollableRows.Children.Count < 1)
            {
                return null;
            }

            return (GridRowElement)tableElement.ViewElement.ScrollableRows.Children[0];
        }

        private GridViewColumn GetFirstScrollableColumn(GridTableElement tableElement)
        {
            GridRowElement rowElement = this.GetFirstScrollableRowElement(tableElement);

            if (rowElement == null)
            {
                return null;
            }

            int counter = 0;

            while (counter < rowElement.VisualCells.Count)
            {
                if (!rowElement.VisualCells[counter].IsPinned && rowElement.VisualCells[counter].ColumnInfo is GridViewDataColumn)
                {
                    return rowElement.VisualCells[counter].ColumnInfo;
                }

                counter++;
            }

            return null;
        }

        private int GetRowIndex(GridViewRowInfo rowInfo)
        {
            List<GridViewRowInfo> orderedRows = typeof(GridRowBehavior).GetField("orderedRows", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(this) as List<GridViewRowInfo>;

            return orderedRows.IndexOf(rowInfo);
        }

        private void DoMultiCellSelect(GridCellElement currentCell, Point currentLocation)
        {
            #region GridViewSelection
            
            int rowUnderMouseIndex = this.GetRowIndex(this.RootGridBehavior.RowAtPoint.RowInfo);
            int columnUnderMouseIndex = 0;
            
            GridTableElement tableElement = this.GridViewElement.CurrentView as GridTableElement;
            GridViewColumn col = this.RootGridBehavior.CellAtPoint.ColumnInfo;
            
            if (this.RootGridBehavior.CellAtPoint.ColumnInfo is GridViewRowHeaderColumn)
            {
                col = this.GetFirstScrollableColumn(tableElement);
            }
            
            List<GridViewRowInfo> orderedRows = typeof(GridRowBehavior).GetField("orderedRows", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(this) as List<GridViewRowInfo>;
            List<GridViewColumn> orderedColumns = typeof(GridRowBehavior).GetField("orderedColumns", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(this) as List<GridViewColumn>;
            
            if (col != null)
            {
                columnUnderMouseIndex = orderedColumns.IndexOf(col);
            }
            
            List<GridViewRowInfo> rows = new List<GridViewRowInfo>();
            
            int anchorRowIndex = (int)typeof(GridRowBehavior).GetField("anchorRowIndex", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(this);
            int startIndex = Math.Min(anchorRowIndex, rowUnderMouseIndex);
            int endIndex = Math.Max(anchorRowIndex, rowUnderMouseIndex);
            
            for (int i = startIndex; i < endIndex; i++)
            {
                if (i < 0)
                {
                    continue;
                }
                if (orderedRows.Count > i)
                {
                    rows.Add(orderedRows[i]);
                }
            }
            
            int anchorColumnIndex = (int)typeof(GridRowBehavior).GetField("anchorColumnIndex", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(this);
            int columnLeft = Math.Min(anchorColumnIndex, columnUnderMouseIndex);
            int columnRight = Math.Max(anchorColumnIndex, columnUnderMouseIndex);
            
            GridViewSelectionCancelEventArgs cancelArgs = new GridViewSelectionCancelEventArgs(rows, columnLeft, columnRight);
            this.MasterTemplate.EventDispatcher.RaiseEvent<GridViewSelectionCancelEventArgs>(EventDispatcher.SelectionChanging, this, cancelArgs);
            
            if (cancelArgs.Cancel)
            {
                return;
            }
            
            #endregion
            
            bool isProcessedShiftOrControl = this.IsPressedShift || this.IsPressedControl;
            
            ObservableCollection<GridViewCellInfo> SelectedCells = typeof(GridViewSelectedCellsCollection).GetProperty("ObservableItems",
                BindingFlags.Instance | BindingFlags.NonPublic).GetValue(this.MasterTemplate.SelectedCells) as ObservableCollection<GridViewCellInfo>;
            
            SelectedCells.BeginUpdate();
            this.GridViewElement.CurrentView.BeginUpdate();
            
            int count = this.MasterTemplate.SelectedCells.Count;
            bool notifyUpdates = this.ProcessCellSelection(rowUnderMouseIndex, columnUnderMouseIndex);
            
            if (isProcessedShiftOrControl)
            {
                notifyUpdates = count != this.MasterTemplate.SelectedCells.Count;
            }
            
            this.GridViewElement.CurrentView.EndUpdate(false);
            SelectedCells.EndUpdate(notifyUpdates);
        }
        
        private bool ProcessCellSelection(int rowUnderMouseIndex, int columnUnderMouseIndex)
        {
            int currentRowIndex = (int)typeof(GridRowBehavior).GetField("currentRowIndex", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(this);
            int anchorRowIndex = (int)typeof(GridRowBehavior).GetField("anchorRowIndex", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(this);
            int currentColumnIndex = (int)typeof(GridRowBehavior).GetField("currentColumnIndex", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(this);
            int anchorColumnIndex = (int)typeof(GridRowBehavior).GetField("anchorColumnIndex", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(this);
            
            if ((rowUnderMouseIndex == currentRowIndex && columnUnderMouseIndex == currentColumnIndex) || (rowUnderMouseIndex < 0 || columnUnderMouseIndex < 0))
            {
                return false;
            }
            
            bool verticalDirectionChange = (rowUnderMouseIndex < currentRowIndex && currentRowIndex > anchorRowIndex && rowUnderMouseIndex < anchorRowIndex) ||
                                           (rowUnderMouseIndex > currentRowIndex && currentRowIndex < anchorRowIndex && rowUnderMouseIndex > anchorRowIndex);
            
            bool horizontalDirectionChange = (columnUnderMouseIndex < currentColumnIndex && currentColumnIndex > anchorColumnIndex && columnUnderMouseIndex < anchorColumnIndex) ||
                                             (columnUnderMouseIndex > currentColumnIndex && currentColumnIndex < anchorColumnIndex && columnUnderMouseIndex > anchorColumnIndex);
            
            List<GridViewRowInfo> orderedRows = typeof(GridRowBehavior).GetField("orderedRows", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(this) as List<GridViewRowInfo>;
            List<GridViewColumn> orderedColumns = typeof(GridRowBehavior).GetField("orderedColumns", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(this) as List<GridViewColumn>;
            
            if (verticalDirectionChange || horizontalDirectionChange)
            {
                int rowStartIndex = Math.Min(anchorRowIndex, currentRowIndex);
                int rowEndIndex = Math.Max(anchorRowIndex, currentRowIndex);
                int colStartIndex = Math.Min(anchorColumnIndex, currentColumnIndex);
                int colEndIndex = Math.Max(anchorColumnIndex, currentColumnIndex);
                
                for (int i = rowStartIndex; i <= rowEndIndex; i++)
                {
                    for (int j = colStartIndex; j <= colEndIndex; j++)
                    {
                        GridViewCellInfo cell = orderedRows[i].Cells[orderedColumns[j].Index];
                        
                        if (cell != null && cell.IsSelected)
                        {
                            cell.IsSelected = false;
                        }
                    }
                }
            }
            
            bool expandingSelectionUp = rowUnderMouseIndex < currentRowIndex && rowUnderMouseIndex < anchorRowIndex;
            bool expandingSelectionDown = rowUnderMouseIndex > currentRowIndex && rowUnderMouseIndex > anchorRowIndex;
            bool expandingSelectionLeft = columnUnderMouseIndex < currentColumnIndex && columnUnderMouseIndex < anchorColumnIndex;
            bool expandingSelectionRight = columnUnderMouseIndex > currentColumnIndex && columnUnderMouseIndex > anchorColumnIndex;
            
            if (expandingSelectionDown || expandingSelectionUp || expandingSelectionLeft || expandingSelectionRight)
            {
                int rowStartIndex = Math.Min(anchorRowIndex, rowUnderMouseIndex);
                int rowEndIndex = Math.Max(anchorRowIndex, rowUnderMouseIndex);
                int colStartIndex = Math.Min(anchorColumnIndex, columnUnderMouseIndex);
                int colEndIndex = Math.Max(anchorColumnIndex, columnUnderMouseIndex);
                
                for (int i = rowStartIndex; i <= rowEndIndex; i++)
                {
                    for (int j = colStartIndex; j <= colEndIndex; j++)
                    {
                        if (i >= 0 && i < orderedRows.Count)
                        {
                            GridViewCellInfo cell = orderedRows[i].Cells[orderedColumns[j].Index];
                            
                            if (cell != null && !cell.IsSelected)
                            {
                                cell.IsSelected = true;
                            }
                        }
                    }
                }
            }
            else
            {
                bool shrinkingSelectionUp = rowUnderMouseIndex < currentRowIndex && rowUnderMouseIndex >= anchorRowIndex;
                bool shrinkingSelectionDown = rowUnderMouseIndex > currentRowIndex && rowUnderMouseIndex <= anchorRowIndex;
                bool shrinkingSelectionLeft = columnUnderMouseIndex < currentColumnIndex && columnUnderMouseIndex >= anchorColumnIndex;
                bool shrinkingSelectionRight = columnUnderMouseIndex > currentColumnIndex && columnUnderMouseIndex <= anchorColumnIndex;
                
                if (shrinkingSelectionUp || shrinkingSelectionDown)
                {
                    int rowStartIndex = Math.Min(currentRowIndex, rowUnderMouseIndex);
                    int rowEndIndex = Math.Max(currentRowIndex, rowUnderMouseIndex);
                    int colStartIndex = Math.Min(anchorColumnIndex, columnUnderMouseIndex);
                    int colEndIndex = Math.Max(anchorColumnIndex, columnUnderMouseIndex);
                    
                    if (shrinkingSelectionUp)
                    {
                        rowStartIndex += 1;
                    }
                    
                    if (shrinkingSelectionDown)
                    {
                        rowEndIndex -= 1;
                    }
                    
                    for (int i = rowStartIndex; i <= rowEndIndex; i++)
                    {
                        if (i != anchorRowIndex)
                        {
                            for (int j = colStartIndex; j <= colEndIndex; j++)
                            {
                                GridViewCellInfo cell = orderedRows[i].Cells[orderedColumns[j].Index];
                                
                                if (cell != null && cell.IsSelected)
                                {
                                    cell.IsSelected = false;
                                }
                            }
                        }
                    }
                }
                
                if (shrinkingSelectionLeft || shrinkingSelectionRight)
                {
                    int rowStartIndex = Math.Min(anchorRowIndex, rowUnderMouseIndex);
                    int rowEndIndex = Math.Max(anchorRowIndex, rowUnderMouseIndex);
                    int colStartIndex = Math.Min(currentColumnIndex, columnUnderMouseIndex);
                    int colEndIndex = Math.Max(currentColumnIndex, columnUnderMouseIndex);
                    
                    if (shrinkingSelectionLeft)
                    {
                        colStartIndex += 1;
                    }
                    
                    if (shrinkingSelectionRight)
                    {
                        colEndIndex -= 1;
                    }
                    
                    for (int i = rowStartIndex; i <= rowEndIndex; i++)
                    {
                        for (int j = colStartIndex; j <= colEndIndex; j++)
                        {
                            if (j != anchorColumnIndex && i >= 0 && i < orderedRows.Count)
                            {
                                GridViewCellInfo cell = orderedRows[i].Cells[orderedColumns[j].Index];
                                
                                if (cell != null && cell.IsSelected)
                                {
                                    cell.IsSelected = false;
                                }
                            }
                        }
                    }
                }
            }
            
            typeof(GridRowBehavior).GetField("currentRowIndex", BindingFlags.NonPublic | BindingFlags.Instance).SetValue(this, rowUnderMouseIndex);
            typeof(GridRowBehavior).GetField("currentColumnIndex", BindingFlags.NonPublic | BindingFlags.Instance).SetValue(this, columnUnderMouseIndex);
            
            return true;
        }
        
        private Rectangle GetViewportBounds(GridTableElement tableElement)
        {
            ScrollableRowsContainerElement scrollableRows = tableElement.ViewElement.ScrollableRows;
            Rectangle bounds = tableElement.ViewElement.ScrollableRows.ControlBoundingRectangle;
            
            for (int index = 0; index < scrollableRows.Children.Count; index++)
            {
                GridVirtualizedRowElement virtualizedRow = scrollableRows.Children[index] as GridVirtualizedRowElement;
                
                if (virtualizedRow != null)
                {
                    VirtualizedColumnContainer scrollableColumns = virtualizedRow.ScrollableColumns;
                    bounds.X = this.GridViewElement.RightToLeft ? virtualizedRow.RightPinnedColumns.ControlBoundingRectangle.Right
                               : virtualizedRow.LeftPinnedColumns.ControlBoundingRectangle.Right;
                    bounds.Width = scrollableColumns.ControlBoundingRectangle.Width;
                    
                    break;
                }
            }
            
            return bounds;
        }
        
        public override bool OnMouseMove(MouseEventArgs e)
        {
            Point currentLocation = e.Location;
            
            GridRowElement currentRow = this.RootGridBehavior.RowAtPoint;
            
            if (currentRow == null)
            {
                this.GridViewElement.TableElement.GetType().GetProperty("HoveredRow", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(this.GridViewElement.TableElement, null);
            }
            
            if (e.Button == MouseButtons.None)
            {
                return this.ShowSizeNSCursort(currentLocation);
            }
            
            if (e.Button != MouseButtons.Left)
            {
                this.ResetControlCursor();
                
                return false;
            }
            
            GridRowElement rowToResize = typeof(GridRowBehavior).GetField("rowToResize", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(this) as GridRowElement;
            
            if (rowToResize != null)
            {
                this.ResizeRow(currentLocation);
                
                return true;
            }
            
            GridCellElement currentCell = this.RootGridBehavior.CellAtPoint;
            Point mouseDownLocation = (Point)typeof(GridRowBehavior).GetField("mouseDownLocation", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(this);
            GridRowElement row = this.GetRowAtPoint(mouseDownLocation);
            bool result = false;
            
            if (currentCell != null && currentCell.ViewTemplate != null && !currentCell.ViewTemplate.AllowRowReorder && row != null)
            {
                result = this.ProcessMouseSelection(currentLocation, currentCell);
            }
            
            if ((currentCell == null || currentCell.ColumnInfo == null || currentCell.ColumnInfo.IsPinned || currentCell.RowInfo.IsPinned) &&
                this.MasterTemplate.MultiSelect && mouseDownLocation != currentLocation)
            {
                typeof(GridRowBehavior).GetField("mouseMoveLocation", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(this, currentLocation);
                System.Windows.Forms.Timer scrollTimer = typeof(GridRowBehavior).GetField("scrollTimer", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(this) as System.Windows.Forms.Timer;
                
                if (!scrollTimer.Enabled)
                {
                    scrollTimer.Enabled = true;
                }
                
                result = false;
            }
            
            return result;
        }
    }
    
    public class MyGridDataRowBehavior : GridDataRowBehavior
    {
        protected override bool ProcessMouseSelection(Point mousePosition, GridCellElement currentCell)
        {
            if (this.RootGridBehavior.LockedBehavior != this)
            {
                this.GridControl.Capture = true;
                this.RootGridBehavior.LockBehavior(this);
            }
            
            bool result = this.DoMouseSelection(currentCell, mousePosition);
            
            return result;
        }
        
        private bool DoMouseSelection(GridCellElement currentCell, Point currentLocation)
        {
            if (!this.MasterTemplate.MultiSelect || this.GridViewElement.Template.AllowRowReorder)
            {
                return false;
            }
            
            Point mouseDownLocation = (Point)typeof(GridRowBehavior).GetField("mouseDownLocation", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(this);
            Rectangle rect = new Rectangle(mouseDownLocation.X - SystemInformation.DragSize.Width / 2, mouseDownLocation.Y - SystemInformation.DragSize.Height / 2,
                SystemInformation.DragSize.Width, SystemInformation.DragSize.Height);
            
            if (rect.Contains(currentLocation))
            {
                return false;
            }
            
            GridTableElement tableElement = this.GridViewElement.CurrentView as GridTableElement;
            
            if (tableElement == null)
            {
                return false;
            }
            
            bool selectionStartedOnAPinnedColumn = (bool)typeof(GridRowBehavior).GetField("selectionStartedOnAPinnedColumn", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(this);
            bool mouseDownOnLeftPinnedColumn = (bool)typeof(GridRowBehavior).GetField("mouseDownOnLeftPinnedColumn", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(this);
            bool mouseDownOnRightPinnedColumn = (bool)typeof(GridRowBehavior).GetField("mouseDownOnRightPinnedColumn", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(this);
            bool selectionStartedOnAPinnedRow = (bool)typeof(GridRowBehavior).GetField("selectionStartedOnAPinnedRow", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(this);
            bool mouseDownOnTopPinnedRow = (bool)typeof(GridRowBehavior).GetField("mouseDownOnTopPinnedRow", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(this);
            bool mouseDownOnBottomPinnedRow = (bool)typeof(GridRowBehavior).GetField("mouseDownOnBottomPinnedRow", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(this);
            
            if (selectionStartedOnAPinnedColumn && this.GetViewportBounds(tableElement).Contains(currentLocation))
            {
                if (mouseDownOnLeftPinnedColumn)
                {
                    tableElement.HScrollBar.Value = tableElement.HScrollBar.Minimum;
                    mouseDownOnLeftPinnedColumn = false;
                }
                
                if (mouseDownOnRightPinnedColumn)
                {
                    tableElement.HScrollBar.Value = tableElement.HScrollBar.Maximum - tableElement.HScrollBar.LargeChange + 1;
                    mouseDownOnRightPinnedColumn = false;
                }
                
                selectionStartedOnAPinnedColumn = false;
            }
            
            if (selectionStartedOnAPinnedRow && this.GetViewportBounds(tableElement).Contains(currentLocation))
            {
                if (mouseDownOnTopPinnedRow)
                {
                    tableElement.VScrollBar.Value = tableElement.VScrollBar.Minimum;
                    mouseDownOnTopPinnedRow = false;
                }
                
                if (mouseDownOnBottomPinnedRow)
                {
                    tableElement.VScrollBar.Value = tableElement.VScrollBar.Maximum - tableElement.VScrollBar.LargeChange + 1;
                    mouseDownOnBottomPinnedRow = false;
                }
                
                selectionStartedOnAPinnedRow = false;
            }
            
            if (currentCell.RowInfo is GridViewDataRowInfo)
            {
                if (this.MasterTemplate.SelectionMode == GridViewSelectionMode.FullRowSelect)
                {
                    typeof(GridHierarchyRowBehavior).GetMethod("DoMultiFullRowSelect", BindingFlags.Instance | BindingFlags.NonPublic).Invoke(this, new object[] { currentCell, currentLocation });
                }
                else
                {
                    this.DoMultiCellSelect(currentCell, currentLocation);
                }
            }
            
            return true;
        }
        
        private GridRowElement GetFirstScrollableRowElement(GridTableElement tableElement)
        {
            if (tableElement.ViewElement.ScrollableRows.Children.Count < 1)
            {
                return null;
            }
            
            return (GridRowElement)tableElement.ViewElement.ScrollableRows.Children[0];
        }
        
        private GridViewColumn GetFirstScrollableColumn(GridTableElement tableElement)
        {
            GridRowElement rowElement = this.GetFirstScrollableRowElement(tableElement);
            
            if (rowElement == null)
            {
                return null;
            }
            
            int counter = 0;
            
            while (counter < rowElement.VisualCells.Count)
            {
                if (!rowElement.VisualCells[counter].IsPinned && rowElement.VisualCells[counter].ColumnInfo is GridViewDataColumn)
                {
                    return rowElement.VisualCells[counter].ColumnInfo;
                }
                
                counter++;
            }
            
            return null;
        }
        
        private int GetRowIndex(GridViewRowInfo rowInfo)
        {
            List<GridViewRowInfo> orderedRows = typeof(GridRowBehavior).GetField("orderedRows", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(this) as List<GridViewRowInfo>;
            
            return orderedRows.IndexOf(rowInfo);
        }
        
        private void DoMultiCellSelect(GridCellElement currentCell, Point currentLocation)
        {
            #region GridViewSelection
            
            int rowUnderMouseIndex = this.GetRowIndex(this.RootGridBehavior.RowAtPoint.RowInfo);
            int columnUnderMouseIndex = 0;
            
            GridTableElement tableElement = this.GridViewElement.CurrentView as GridTableElement;
            GridViewColumn col = this.RootGridBehavior.CellAtPoint.ColumnInfo;
            
            if (this.RootGridBehavior.CellAtPoint.ColumnInfo is GridViewRowHeaderColumn)
            {
                col = this.GetFirstScrollableColumn(tableElement);
            }
            
            List<GridViewRowInfo> orderedRows = typeof(GridRowBehavior).GetField("orderedRows", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(this) as List<GridViewRowInfo>;
            List<GridViewColumn> orderedColumns = typeof(GridRowBehavior).GetField("orderedColumns", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(this) as List<GridViewColumn>;
            
            if (col != null)
            {
                columnUnderMouseIndex = orderedColumns.IndexOf(col);
            }

            List<GridViewRowInfo> rows = new List<GridViewRowInfo>();
            
            int anchorRowIndex = (int)typeof(GridRowBehavior).GetField("anchorRowIndex", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(this);
            int startIndex = Math.Min(anchorRowIndex, rowUnderMouseIndex);
            int endIndex = Math.Max(anchorRowIndex, rowUnderMouseIndex);
            
            for (int i = startIndex; i < endIndex; i++)
            {
                if (i < 0)
                {
                    continue;
                }
                if (orderedRows.Count > i)
                {
                    rows.Add(orderedRows[i]);
                }
            }
            
            int anchorColumnIndex = (int)typeof(GridRowBehavior).GetField("anchorColumnIndex", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(this);
            int columnLeft = Math.Min(anchorColumnIndex, columnUnderMouseIndex);
            int columnRight = Math.Max(anchorColumnIndex, columnUnderMouseIndex);
            
            GridViewSelectionCancelEventArgs cancelArgs = new GridViewSelectionCancelEventArgs(rows, columnLeft, columnRight);
            this.MasterTemplate.EventDispatcher.RaiseEvent<GridViewSelectionCancelEventArgs>(EventDispatcher.SelectionChanging, this, cancelArgs);
            
            if (cancelArgs.Cancel)
            {
                return;
            }

            #endregion

            bool isProcessedShiftOrControl = this.IsPressedShift || this.IsPressedControl;
                
            ObservableCollection<GridViewCellInfo> SelectedCells = typeof(GridViewSelectedCellsCollection).GetProperty("ObservableItems",
                BindingFlags.Instance | BindingFlags.NonPublic).GetValue(this.MasterTemplate.SelectedCells) as ObservableCollection<GridViewCellInfo>;
            
            SelectedCells.BeginUpdate();
            this.GridViewElement.CurrentView.BeginUpdate();
            
            int count = this.MasterTemplate.SelectedCells.Count;
            bool notifyUpdates = this.ProcessCellSelection(rowUnderMouseIndex, columnUnderMouseIndex);
            
            if (isProcessedShiftOrControl)
            {
                notifyUpdates = count != this.MasterTemplate.SelectedCells.Count;
            }
            
            this.GridViewElement.CurrentView.EndUpdate(false);
            SelectedCells.EndUpdate(notifyUpdates);
        }
        
        private bool ProcessCellSelection(int rowUnderMouseIndex, int columnUnderMouseIndex)
        {
            int currentRowIndex = (int)typeof(GridRowBehavior).GetField("currentRowIndex", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(this);
            int anchorRowIndex = (int)typeof(GridRowBehavior).GetField("anchorRowIndex", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(this);
            int currentColumnIndex = (int)typeof(GridRowBehavior).GetField("currentColumnIndex", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(this);
            int anchorColumnIndex = (int)typeof(GridRowBehavior).GetField("anchorColumnIndex", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(this);
            
            if ((rowUnderMouseIndex == currentRowIndex && columnUnderMouseIndex == currentColumnIndex) || (rowUnderMouseIndex < 0 || columnUnderMouseIndex < 0))
            {
                return false;
            }
                                           
            bool verticalDirectionChange = (rowUnderMouseIndex < currentRowIndex && currentRowIndex > anchorRowIndex && rowUnderMouseIndex < anchorRowIndex) ||
                                           (rowUnderMouseIndex > currentRowIndex && currentRowIndex < anchorRowIndex && rowUnderMouseIndex > anchorRowIndex);
                                             
            bool horizontalDirectionChange = (columnUnderMouseIndex < currentColumnIndex && currentColumnIndex > anchorColumnIndex && columnUnderMouseIndex < anchorColumnIndex) ||
                                             (columnUnderMouseIndex > currentColumnIndex && currentColumnIndex < anchorColumnIndex && columnUnderMouseIndex > anchorColumnIndex);
            
            List<GridViewRowInfo> orderedRows = typeof(GridRowBehavior).GetField("orderedRows", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(this) as List<GridViewRowInfo>;
            List<GridViewColumn> orderedColumns = typeof(GridRowBehavior).GetField("orderedColumns", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(this) as List<GridViewColumn>;
            
            if (verticalDirectionChange || horizontalDirectionChange)
            {
                int rowStartIndex = Math.Min(anchorRowIndex, currentRowIndex);
                int rowEndIndex = Math.Max(anchorRowIndex, currentRowIndex);
                int colStartIndex = Math.Min(anchorColumnIndex, currentColumnIndex);
                int colEndIndex = Math.Max(anchorColumnIndex, currentColumnIndex);
                
                for (int i = rowStartIndex; i <= rowEndIndex; i++)
                {
                    for (int j = colStartIndex; j <= colEndIndex; j++)
                    {
                        GridViewCellInfo cell = orderedRows[i].Cells[orderedColumns[j].Index];
                        
                        if (cell != null && cell.IsSelected)
                        {
                            cell.IsSelected = false;
                        }
                    }
                }
            }
            
            bool expandingSelectionUp = rowUnderMouseIndex < currentRowIndex && rowUnderMouseIndex < anchorRowIndex;
            bool expandingSelectionDown = rowUnderMouseIndex > currentRowIndex && rowUnderMouseIndex > anchorRowIndex;
            bool expandingSelectionLeft = columnUnderMouseIndex < currentColumnIndex && columnUnderMouseIndex < anchorColumnIndex;
            bool expandingSelectionRight = columnUnderMouseIndex > currentColumnIndex && columnUnderMouseIndex > anchorColumnIndex;
            
            if (expandingSelectionDown || expandingSelectionUp || expandingSelectionLeft || expandingSelectionRight)
            {
                int rowStartIndex = Math.Min(anchorRowIndex, rowUnderMouseIndex);
                int rowEndIndex = Math.Max(anchorRowIndex, rowUnderMouseIndex);
                int colStartIndex = Math.Min(anchorColumnIndex, columnUnderMouseIndex);
                int colEndIndex = Math.Max(anchorColumnIndex, columnUnderMouseIndex);
                
                for (int i = rowStartIndex; i <= rowEndIndex; i++)
                {
                    for (int j = colStartIndex; j <= colEndIndex; j++)
                    {
                        GridViewCellInfo cell = orderedRows[i].Cells[orderedColumns[j].Index];
                        
                        if (cell != null && !cell.IsSelected)
                        {
                            cell.IsSelected = true;
                        }
                    }
                }
            }
            else
            {
                bool shrinkingSelectionUp = rowUnderMouseIndex < currentRowIndex && rowUnderMouseIndex >= anchorRowIndex;
                bool shrinkingSelectionDown = rowUnderMouseIndex > currentRowIndex && rowUnderMouseIndex <= anchorRowIndex;
                bool shrinkingSelectionLeft = columnUnderMouseIndex < currentColumnIndex && columnUnderMouseIndex >= anchorColumnIndex;
                bool shrinkingSelectionRight = columnUnderMouseIndex > currentColumnIndex && columnUnderMouseIndex <= anchorColumnIndex;
                
                if (shrinkingSelectionUp || shrinkingSelectionDown)
                {
                    int rowStartIndex = Math.Min(currentRowIndex, rowUnderMouseIndex);
                    int rowEndIndex = Math.Max(currentRowIndex, rowUnderMouseIndex);
                    int colStartIndex = Math.Min(anchorColumnIndex, columnUnderMouseIndex);
                    int colEndIndex = Math.Max(anchorColumnIndex, columnUnderMouseIndex);
                    
                    if (shrinkingSelectionUp)
                    {
                        rowStartIndex += 1;
                    }
                    
                    if (shrinkingSelectionDown)
                    {
                        rowEndIndex -= 1;
                    }
                    
                    for (int i = rowStartIndex; i <= rowEndIndex; i++)
                    {
                        if (i != anchorRowIndex)
                        {
                            for (int j = colStartIndex; j <= colEndIndex; j++)
                            {
                                GridViewCellInfo cell = orderedRows[i].Cells[orderedColumns[j].Index];
                                
                                if (cell != null && cell.IsSelected)
                                {
                                    cell.IsSelected = false;
                                }
                            }
                        }
                    }
                }
                
                if (shrinkingSelectionLeft || shrinkingSelectionRight)
                {
                    int rowStartIndex = Math.Min(anchorRowIndex, rowUnderMouseIndex);
                    int rowEndIndex = Math.Max(anchorRowIndex, rowUnderMouseIndex);
                    int colStartIndex = Math.Min(currentColumnIndex, columnUnderMouseIndex);
                    int colEndIndex = Math.Max(currentColumnIndex, columnUnderMouseIndex);
                    
                    if (shrinkingSelectionLeft)
                    {
                        colStartIndex += 1;
                    }
                    
                    if (shrinkingSelectionRight)
                    {
                        colEndIndex -= 1;
                    }
                    
                    for (int i = rowStartIndex; i <= rowEndIndex; i++)
                    {
                        for (int j = colStartIndex; j <= colEndIndex; j++)
                        {
                            if (j != anchorColumnIndex)
                            {
                                GridViewCellInfo cell = orderedRows[i].Cells[orderedColumns[j].Index];
                                
                                if (cell != null && cell.IsSelected)
                                {
                                    cell.IsSelected = false;
                                }
                            }
                        }
                    }
                }
            }
            
            typeof(GridRowBehavior).GetField("currentRowIndex", BindingFlags.NonPublic | BindingFlags.Instance).SetValue(this, rowUnderMouseIndex);
            typeof(GridRowBehavior).GetField("currentColumnIndex", BindingFlags.NonPublic | BindingFlags.Instance).SetValue(this, columnUnderMouseIndex);
        
            return true;
        }
        
        private Rectangle GetViewportBounds(GridTableElement tableElement)
        {
            ScrollableRowsContainerElement scrollableRows = tableElement.ViewElement.ScrollableRows;
            Rectangle bounds = tableElement.ViewElement.ScrollableRows.ControlBoundingRectangle;
            
            for (int index = 0; index < scrollableRows.Children.Count; index++)
            {
                GridVirtualizedRowElement virtualizedRow = scrollableRows.Children[index] as GridVirtualizedRowElement;
                
                if (virtualizedRow != null)
                {
                    VirtualizedColumnContainer scrollableColumns = virtualizedRow.ScrollableColumns;
                    bounds.X = this.GridViewElement.RightToLeft ? virtualizedRow.RightPinnedColumns.ControlBoundingRectangle.Right
                               : virtualizedRow.LeftPinnedColumns.ControlBoundingRectangle.Right;
                    bounds.Width = scrollableColumns.ControlBoundingRectangle.Width;
                
                    break;
                }
            }
        
            return bounds;
        }
        
        public override bool OnMouseMove(MouseEventArgs e)
        {
            Point currentLocation = e.Location;

            GridRowElement currentRow = this.RootGridBehavior.RowAtPoint;
            
            if (currentRow == null)
            {
                this.GridViewElement.TableElement.GetType().GetProperty("HoveredRow", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(this.GridViewElement.TableElement, null);
            }
            
            if (e.Button == MouseButtons.None)
            {
                return this.ShowSizeNSCursort(currentLocation);
            }
            
            if (e.Button != MouseButtons.Left)
            {
                this.ResetControlCursor();
            
                return false;
            }

            GridRowElement rowToResize = typeof(GridRowBehavior).GetField("rowToResize", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(this) as GridRowElement;
            
            if (rowToResize != null)
            {
                this.ResizeRow(currentLocation);
            
                return true;
            }
            
            GridCellElement currentCell = this.RootGridBehavior.CellAtPoint;
            Point mouseDownLocation = (Point)typeof(GridRowBehavior).GetField("mouseDownLocation", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(this);
            GridRowElement row = this.GetRowAtPoint(mouseDownLocation);
            bool result = false;
            
            if (currentCell != null && currentCell.ViewTemplate != null && !currentCell.ViewTemplate.AllowRowReorder && row != null)
            {
                result = this.ProcessMouseSelection(currentLocation, currentCell);
            }
                
            if ((currentCell == null || currentCell.ColumnInfo == null || currentCell.ColumnInfo.IsPinned || currentCell.RowInfo.IsPinned) &&
                this.MasterTemplate.MultiSelect && mouseDownLocation != currentLocation)
            {
                typeof(GridRowBehavior).GetField("mouseMoveLocation", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(this, currentLocation);
                System.Windows.Forms.Timer scrollTimer = typeof(GridRowBehavior).GetField("scrollTimer", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(this) as System.Windows.Forms.Timer;
                
                if (!scrollTimer.Enabled)
                {
                    scrollTimer.Enabled = true;
                }
            
                result = false;
            }
        
            return result;
        }
}
Completed
Last Updated: 09 Sep 2015 11:12 by ADMIN
ADMIN
Created by: Dess | Tech Support Engineer, Principal
Comments: 0
Category: GridView
Type: Bug Report
0
Please refer to the attached gif file.
Completed
Last Updated: 17 Aug 2015 08:29 by ADMIN
To reproduce:
            this.radGridView1.AllowEditRow = false;
            this.radGridView1.AllowColumnHeaderContextMenu = true;
            this.radGridView1.AllowCellContextMenu = true;

Workaround: subscribe to the ContextMenuOpening event and hide the items. An alternative solution is to use RadGridView in read-only mode. 
Declined
Last Updated: 23 Sep 2015 08:43 by ADMIN
To reproduce: 

1. Add a grid to a form. 

2. Set its SplitMode to vertical or horizontal. 

3. Set its SynchronizeCurrentRowInSplitMode to false. 

You will notice that both grids are synchronized. 

Workaround: Add two RadgridViews in a RadSplitContainer with two split panels and use two separate data sources. 

For example: 

List<string> ds = new List<string>();

grid1.DataSource = ds; 

grid2.DataSource = ds.ToArray();
Completed
Last Updated: 06 Aug 2015 11:40 by ADMIN
To reproduce: 

1. Add a RadGridView, set ShowRowHeaderColumn to false, AutoSizeColumnsMode to Fill and Dock to Fill. 

2. Add 3 columns and 1 row. 

3. Start the application and click the leftmost cell, you will notice that the header will move with one pixel to the right. 

4. Click the rightmost cell and you will notice the header moving one pixel to the left
Completed
Last Updated: 10 Sep 2015 12:24 by ADMIN
To reproduce:
public Form1()
{
    InitializeComponent();
    DataTable dt = new DataTable();
    dt.Columns.Add(new DataColumn("Id", typeof(int)));
    dt.Columns.Add(new DataColumn("Name", typeof(string)));
    
    for (int i = 0; i < 50; i++)
    {
        dt.Rows.Add(i, "Item" + i);
    }
    radGridView1.DataSource = dt; 
  
    radGridView1.MasterTemplate.MultiSelect = true;
}

1. Load a grid with enough rows to make scrolling necessary to see the bottom row.
2. Drag a column header into the group area.
3. Move the vertical scroll bar down. It doesn't matter if you scroll all the way to the end or just barely move the vertical scroll bar, as long as it isn't all the way to the top.
4. Put the mouse on the "X" of the group descriptor. Hold the left mouse button and move the mouse.

Workaround: use custom row behavior:

            BaseGridBehavior gridBehavior = rgvTest.GridBehavior as BaseGridBehavior;
            gridBehavior.UnregisterBehavior(typeof(GridViewDataRowInfo));
            gridBehavior.RegisterBehavior(typeof(GridViewDataRowInfo), new CustomGridDataRowBehavior());

public class CustomGridDataRowBehavior : GridDataRowBehavior
{
    public CustomGridDataRowBehavior()
    {
        typeof(GridRowBehavior).GetField("orderedRows", System.Reflection.BindingFlags.NonPublic |
                                                        System.Reflection.BindingFlags.Instance).SetValue(this, new List<GridViewRowInfo>()) ;
    }

    public override bool OnMouseUp(MouseEventArgs e)
    {
        bool result = base.OnMouseUp(e);              
        typeof(GridRowBehavior).GetField("orderedRows", System.Reflection.BindingFlags.NonPublic |
                                                        System.Reflection.BindingFlags.Instance).SetValue(this, new List<GridViewRowInfo>()) ;
        return result;  
    }
}
Completed
Last Updated: 08 Sep 2015 11:51 by ADMIN
To reproduce:

private void Form1_Load(object sender, EventArgs e)
{
    // TODO: This line of code loads data into the 'nwindDataSet.Products' table. You can move, or remove it, as needed.
    this.productsTableAdapter.Fill(this.nwindDataSet.Products);
    // TODO: This line of code loads data into the 'nwindDataSet.Order_Details' table. You can move, or remove it, as needed.
    this.order_DetailsTableAdapter.Fill(this.nwindDataSet.Order_Details);
    // TODO: This line of code loads data into the 'nwindDataSet.Categories' table. You can move, or remove it, as needed.
    this.categoriesTableAdapter.Fill(this.nwindDataSet.Categories);
   
    radGridView1.DataSource = nwindDataSet.Categories;

    GridViewTemplate firstChildtemplate = new GridViewTemplate();
    firstChildtemplate.DataSource = nwindDataSet.Products;
    firstChildtemplate.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill;
    radGridView1.MasterTemplate.Templates.Add(firstChildtemplate);

    GridViewRelation relation = new GridViewRelation(radGridView1.MasterTemplate);
    relation.ChildTemplate = firstChildtemplate;
    relation.RelationName = "CategoriesProducts";
    relation.ParentColumnNames.Add("CategoryID");
    relation.ChildColumnNames.Add("CategoryID");
    radGridView1.Relations.Add(relation);

    GridViewTemplate secondChildtemplate = new GridViewTemplate();
    secondChildtemplate.DataSource = nwindDataSet.Order_Details;
    secondChildtemplate.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill;
    firstChildtemplate.Templates.Add(secondChildtemplate);

    GridViewRelation relation2 = new GridViewRelation(firstChildtemplate);
    relation2.ChildTemplate = secondChildtemplate;
    relation2.RelationName = "ProductsOrderDetails";
    relation2.ParentColumnNames.Add("ProductID");
    relation2.ChildColumnNames.Add("ProductID");
    radGridView1.Relations.Add(relation2);
    this.radGridView1.AutoSizeColumnsMode = Telerik.WinControls.UI.GridViewAutoSizeColumnsMode.Fill;
    this.radGridView1.MultiSelect = true;
    this.radGridView1.SelectionMode = Telerik.WinControls.UI.GridViewSelectionMode.CellSelect ;
}

Please refer to the attached gif file illustrating the error when performing multiple selection.

1. Workaround: use Shift + arrow keys to perform multiple selection.

2. Workaround: custom row behavior:

 BaseGridBehavior behavior = (BaseGridBehavior)this.radGridView1.GridBehavior;
behavior.UnregisterBehavior(typeof(GridViewHierarchyRowInfo));
behavior.RegisterBehavior(typeof(GridViewHierarchyRowInfo), new MyGridRowBehavior());


public class MyGridRowBehavior : GridHierarchyRowBehavior
{
    protected override bool ProcessMouseSelection(Point mousePosition, GridCellElement currentCell)
    {
        if (this.RootGridBehavior.LockedBehavior != this)
        {
            this.GridControl.Capture = true;
            this.RootGridBehavior.LockBehavior(this);
        }

        bool result = this.DoMouseSelection(currentCell, mousePosition);

        return result;
    }

    private bool DoMouseSelection(GridCellElement currentCell, Point currentLocation)
    {
        if (!this.MasterTemplate.MultiSelect || this.GridViewElement.Template.AllowRowReorder)
        {
            return false;
        }

        Point mouseDownLocation = (Point)typeof(GridRowBehavior).GetField("mouseDownLocation", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(this);
        Rectangle rect = new Rectangle(mouseDownLocation.X - SystemInformation.DragSize.Width / 2, mouseDownLocation.Y - SystemInformation.DragSize.Height / 2,
            SystemInformation.DragSize.Width, SystemInformation.DragSize.Height);

        if (rect.Contains(currentLocation))
        {
            return false;
        }

        GridTableElement tableElement = this.GridViewElement.CurrentView as GridTableElement;

        if (tableElement == null)
        {
            return false;
        }

        bool selectionStartedOnAPinnedColumn = (bool)typeof(GridRowBehavior).GetField("selectionStartedOnAPinnedColumn", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(this);
        bool mouseDownOnLeftPinnedColumn = (bool)typeof(GridRowBehavior).GetField("mouseDownOnLeftPinnedColumn", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(this);
        bool mouseDownOnRightPinnedColumn = (bool)typeof(GridRowBehavior).GetField("mouseDownOnRightPinnedColumn", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(this);
        bool selectionStartedOnAPinnedRow = (bool)typeof(GridRowBehavior).GetField("selectionStartedOnAPinnedRow", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(this);
        bool mouseDownOnTopPinnedRow = (bool)typeof(GridRowBehavior).GetField("mouseDownOnTopPinnedRow", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(this);
        bool mouseDownOnBottomPinnedRow = (bool)typeof(GridRowBehavior).GetField("mouseDownOnBottomPinnedRow", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(this);

        if (selectionStartedOnAPinnedColumn && this.GetViewportBounds(tableElement).Contains(currentLocation))
        {
            if (mouseDownOnLeftPinnedColumn)
            {
                tableElement.HScrollBar.Value = tableElement.HScrollBar.Minimum;
                mouseDownOnLeftPinnedColumn = false;
            }

            if (mouseDownOnRightPinnedColumn)
            {
                tableElement.HScrollBar.Value = tableElement.HScrollBar.Maximum - tableElement.HScrollBar.LargeChange + 1;
                mouseDownOnRightPinnedColumn = false;
            }

            selectionStartedOnAPinnedColumn = false;
        }

        if (selectionStartedOnAPinnedRow && this.GetViewportBounds(tableElement).Contains(currentLocation))
        {
            if (mouseDownOnTopPinnedRow)
            {
                tableElement.VScrollBar.Value = tableElement.VScrollBar.Minimum;
                mouseDownOnTopPinnedRow = false;
            }

            if (mouseDownOnBottomPinnedRow)
            {
                tableElement.VScrollBar.Value = tableElement.VScrollBar.Maximum - tableElement.VScrollBar.LargeChange + 1;
                mouseDownOnBottomPinnedRow = false;
            }

            selectionStartedOnAPinnedRow = false;
        }

        if (currentCell.RowInfo is GridViewDataRowInfo)
        {
            if (this.MasterTemplate.SelectionMode == GridViewSelectionMode.FullRowSelect)
            {
                typeof(GridHierarchyRowBehavior).GetMethod("DoMultiFullRowSelect", BindingFlags.Instance | BindingFlags.NonPublic).Invoke(this, new object[] { currentCell, currentLocation });
            }
            else
            {
                this.DoMultiCellSelect(currentCell, currentLocation);
            }
        }

        return true;
    }

    private GridRowElement GetFirstScrollableRowElement(GridTableElement tableElement)
    {
        if (tableElement.ViewElement.ScrollableRows.Children.Count < 1)
        {
            return null;
        }

        return (GridRowElement)tableElement.ViewElement.ScrollableRows.Children[0];
    }

    private GridViewColumn GetFirstScrollableColumn(GridTableElement tableElement)
    {
        GridRowElement rowElement = this.GetFirstScrollableRowElement(tableElement);

        if (rowElement == null)
        {
            return null;
        }

        int counter = 0;

        while (counter < rowElement.VisualCells.Count)
        {
            if (!rowElement.VisualCells[counter].IsPinned && rowElement.VisualCells[counter].ColumnInfo is GridViewDataColumn)
            {
                return rowElement.VisualCells[counter].ColumnInfo;
            }

            counter++;
        }

        return null;
    }

    private int GetRowIndex(GridViewRowInfo rowInfo)
    {
        List<GridViewRowInfo> orderedRows = typeof(GridRowBehavior).GetField("orderedRows", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(this) as List<GridViewRowInfo>;

        return orderedRows.IndexOf(rowInfo);
    }

    private void DoMultiCellSelect(GridCellElement currentCell, Point currentLocation)
    {
        #region GridViewSelection

        int rowUnderMouseIndex = this.GetRowIndex(this.RootGridBehavior.RowAtPoint.RowInfo);
        int columnUnderMouseIndex = 0;

        GridTableElement tableElement = this.GridViewElement.CurrentView as GridTableElement;
        GridViewColumn col = this.RootGridBehavior.CellAtPoint.ColumnInfo;

        if (this.RootGridBehavior.CellAtPoint.ColumnInfo is GridViewRowHeaderColumn)
        {
            col = this.GetFirstScrollableColumn(tableElement);
        }

        List<GridViewRowInfo> orderedRows = typeof(GridRowBehavior).GetField("orderedRows", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(this) as List<GridViewRowInfo>;
        List<GridViewColumn> orderedColumns = typeof(GridRowBehavior).GetField("orderedColumns", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(this) as List<GridViewColumn>;

        if (col != null)
        {
            columnUnderMouseIndex = orderedColumns.IndexOf(col);
        }

        List<GridViewRowInfo> rows = new List<GridViewRowInfo>();

        int anchorRowIndex = (int)typeof(GridRowBehavior).GetField("anchorRowIndex", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(this);
        int startIndex = Math.Min(anchorRowIndex, rowUnderMouseIndex);
        int endIndex = Math.Max(anchorRowIndex, rowUnderMouseIndex);

        for (int i = startIndex; i < endIndex; i++)
        {
            if (i < 0)
            {
                continue;
            }
            if (this.GridViewElement.Template.ChildRows.Count > i)
            {
                rows.Add(orderedRows[i]);
            }
        }

        int anchorColumnIndex = (int)typeof(GridRowBehavior).GetField("anchorColumnIndex", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(this);
        int columnLeft = Math.Min(anchorColumnIndex, columnUnderMouseIndex);
        int columnRight = Math.Max(anchorColumnIndex, columnUnderMouseIndex);

        GridViewSelectionCancelEventArgs cancelArgs = new GridViewSelectionCancelEventArgs(rows, columnLeft, columnRight);
        this.MasterTemplate.EventDispatcher.RaiseEvent<GridViewSelectionCancelEventArgs>(EventDispatcher.SelectionChanging, this, cancelArgs);

        if (cancelArgs.Cancel)
        {
            return;
        }

        #endregion

        bool isProcessedShiftOrControl = this.IsPressedShift || this.IsPressedControl;

        ObservableCollection<GridViewCellInfo> SelectedCells = typeof(GridViewSelectedCellsCollection).GetProperty("ObservableItems",
            BindingFlags.Instance | BindingFlags.NonPublic).GetValue(this.MasterTemplate.SelectedCells) as ObservableCollection<GridViewCellInfo>;
        
        SelectedCells.BeginUpdate();
        this.GridViewElement.CurrentView.BeginUpdate();

        int count = this.MasterTemplate.SelectedCells.Count;
        bool notifyUpdates = this.ProcessCellSelection(rowUnderMouseIndex, columnUnderMouseIndex);

        if (isProcessedShiftOrControl)
        {
            notifyUpdates = count != this.MasterTemplate.SelectedCells.Count;
        }

        this.GridViewElement.CurrentView.EndUpdate(false);
        SelectedCells.EndUpdate(notifyUpdates);
    }

    private bool ProcessCellSelection(int rowUnderMouseIndex, int columnUnderMouseIndex)
    {
        int currentRowIndex = (int)typeof(GridRowBehavior).GetField("currentRowIndex", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(this);
        int anchorRowIndex = (int)typeof(GridRowBehavior).GetField("anchorRowIndex", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(this);
        int currentColumnIndex = (int)typeof(GridRowBehavior).GetField("currentColumnIndex", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(this);
        int anchorColumnIndex = (int)typeof(GridRowBehavior).GetField("anchorColumnIndex", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(this);

        if ((rowUnderMouseIndex == currentRowIndex && columnUnderMouseIndex == currentColumnIndex) || (rowUnderMouseIndex < 0 || columnUnderMouseIndex < 0))
        {
            return false;
        }

        bool verticalDirectionChange = (rowUnderMouseIndex < currentRowIndex && currentRowIndex > anchorRowIndex && rowUnderMouseIndex < anchorRowIndex) ||
                                    (rowUnderMouseIndex > currentRowIndex && currentRowIndex < anchorRowIndex && rowUnderMouseIndex > anchorRowIndex);

        bool horizontalDirectionChange = (columnUnderMouseIndex < currentColumnIndex && currentColumnIndex > anchorColumnIndex && columnUnderMouseIndex < anchorColumnIndex) ||
                                        (columnUnderMouseIndex > currentColumnIndex && currentColumnIndex < anchorColumnIndex && columnUnderMouseIndex > anchorColumnIndex);

        List<GridViewRowInfo> orderedRows = typeof(GridRowBehavior).GetField("orderedRows", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(this) as List<GridViewRowInfo>;
        List<GridViewColumn> orderedColumns = typeof(GridRowBehavior).GetField("orderedColumns", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(this) as List<GridViewColumn>;

        if (verticalDirectionChange || horizontalDirectionChange)
        {
            int rowStartIndex = Math.Min(anchorRowIndex, currentRowIndex);
            int rowEndIndex = Math.Max(anchorRowIndex, currentRowIndex);
            int colStartIndex = Math.Min(anchorColumnIndex, currentColumnIndex);
            int colEndIndex = Math.Max(anchorColumnIndex, currentColumnIndex);

            for (int i = rowStartIndex; i <= rowEndIndex; i++)
            {
                for (int j = colStartIndex; j <= colEndIndex; j++)
                {
                    GridViewCellInfo cell = orderedRows[i].Cells[orderedColumns[j].Index];

                    if (cell != null && cell.IsSelected)
                    {
                        cell.IsSelected = false;
                    }
                }
            }
        }

        bool expandingSelectionUp = rowUnderMouseIndex < currentRowIndex && rowUnderMouseIndex < anchorRowIndex;
        bool expandingSelectionDown = rowUnderMouseIndex > currentRowIndex && rowUnderMouseIndex > anchorRowIndex;
        bool expandingSelectionLeft = columnUnderMouseIndex < currentColumnIndex && columnUnderMouseIndex < anchorColumnIndex;
        bool expandingSelectionRight = columnUnderMouseIndex > currentColumnIndex && columnUnderMouseIndex > anchorColumnIndex;

        if (expandingSelectionDown || expandingSelectionUp || expandingSelectionLeft || expandingSelectionRight)
        {
            int rowStartIndex = Math.Min(anchorRowIndex, rowUnderMouseIndex);
            int rowEndIndex = Math.Max(anchorRowIndex, rowUnderMouseIndex);
            int colStartIndex = Math.Min(anchorColumnIndex, columnUnderMouseIndex);
            int colEndIndex = Math.Max(anchorColumnIndex, columnUnderMouseIndex);

            for (int i = rowStartIndex; i <= rowEndIndex; i++)
            {
                for (int j = colStartIndex; j <= colEndIndex; j++)
                {
                    GridViewCellInfo cell = orderedRows[i].Cells[orderedColumns[j].Index];

                    if (cell != null && !cell.IsSelected)
                    {
                        cell.IsSelected = true;
                    }
                }
            }
        }
        else
        {
            bool shrinkingSelectionUp = rowUnderMouseIndex < currentRowIndex && rowUnderMouseIndex >= anchorRowIndex;
            bool shrinkingSelectionDown = rowUnderMouseIndex > currentRowIndex && rowUnderMouseIndex <= anchorRowIndex;
            bool shrinkingSelectionLeft = columnUnderMouseIndex < currentColumnIndex && columnUnderMouseIndex >= anchorColumnIndex;
            bool shrinkingSelectionRight = columnUnderMouseIndex > currentColumnIndex && columnUnderMouseIndex <= anchorColumnIndex;

            if (shrinkingSelectionUp || shrinkingSelectionDown)
            {
                int rowStartIndex = Math.Min(currentRowIndex, rowUnderMouseIndex);
                int rowEndIndex = Math.Max(currentRowIndex, rowUnderMouseIndex);
                int colStartIndex = Math.Min(anchorColumnIndex, columnUnderMouseIndex);
                int colEndIndex = Math.Max(anchorColumnIndex, columnUnderMouseIndex);

                if (shrinkingSelectionUp)
                {
                    rowStartIndex += 1;
                }

                if (shrinkingSelectionDown)
                {
                    rowEndIndex -= 1;
                }

                for (int i = rowStartIndex; i <= rowEndIndex; i++)
                {
                    if (i != anchorRowIndex)
                    {
                        for (int j = colStartIndex; j <= colEndIndex; j++)
                        {
                            GridViewCellInfo cell = orderedRows[i].Cells[orderedColumns[j].Index];

                            if (cell != null && cell.IsSelected)
                            {
                                cell.IsSelected = false;
                            }
                        }
                    }
                }
            }

            if (shrinkingSelectionLeft || shrinkingSelectionRight)
            {
                int rowStartIndex = Math.Min(anchorRowIndex, rowUnderMouseIndex);
                int rowEndIndex = Math.Max(anchorRowIndex, rowUnderMouseIndex);
                int colStartIndex = Math.Min(currentColumnIndex, columnUnderMouseIndex);
                int colEndIndex = Math.Max(currentColumnIndex, columnUnderMouseIndex);

                if (shrinkingSelectionLeft)
                {
                    colStartIndex += 1;
                }

                if (shrinkingSelectionRight)
                {
                    colEndIndex -= 1;
                }

                for (int i = rowStartIndex; i <= rowEndIndex; i++)
                {
                    for (int j = colStartIndex; j <= colEndIndex; j++)
                    {
                        if (j != anchorColumnIndex)
                        {
                            GridViewCellInfo cell = orderedRows[i].Cells[orderedColumns[j].Index];

                            if (cell != null && cell.IsSelected)
                            {
                                cell.IsSelected = false;
                            }
                        }
                    }
                }
            }
        }

        typeof(GridRowBehavior).GetField("currentRowIndex", BindingFlags.NonPublic | BindingFlags.Instance).SetValue(this, rowUnderMouseIndex);
        typeof(GridRowBehavior).GetField("currentColumnIndex", BindingFlags.NonPublic | BindingFlags.Instance).SetValue(this, columnUnderMouseIndex);

        return true;
    }

    private Rectangle GetViewportBounds(GridTableElement tableElement)
    {
        ScrollableRowsContainerElement scrollableRows = tableElement.ViewElement.ScrollableRows;
        Rectangle bounds = tableElement.ViewElement.ScrollableRows.ControlBoundingRectangle;

        for (int index = 0; index < scrollableRows.Children.Count; index++)
        {
            GridVirtualizedRowElement virtualizedRow = scrollableRows.Children[index] as GridVirtualizedRowElement;

            if (virtualizedRow != null)
            {
                VirtualizedColumnContainer scrollableColumns = virtualizedRow.ScrollableColumns;
                bounds.X = this.GridViewElement.RightToLeft ? virtualizedRow.RightPinnedColumns.ControlBoundingRectangle.Right
                           : virtualizedRow.LeftPinnedColumns.ControlBoundingRectangle.Right;
                bounds.Width = scrollableColumns.ControlBoundingRectangle.Width;

                break;
            }
        }

        return bounds;
    }
}
Completed
Last Updated: 09 Dec 2015 15:49 by ADMIN
To reproduce : add a GridViewMultiComboBoxColumn and use the following code snippet:

Private Sub RadGridView1_CellEditorInitialized(sender As Object, e As GridViewCellEventArgs) Handles RadGridView1.CellEditorInitialized
    Dim multiComboElement As RadMultiColumnComboBoxElement = TryCast(Me.RadGridView1.ActiveEditor, RadMultiColumnComboBoxElement)
    If multiComboElement IsNot Nothing Then
        multiComboElement.AutoFilter = True
        If multiComboElement.EditorControl.MasterTemplate.FilterDescriptors.Count = 0 Then
            Dim autoFilter As New FilterDescriptor
            autoFilter.PropertyName = multiComboElement.DisplayMember
            autoFilter.Operator = FilterOperator.StartsWith
            multiComboElement.EditorControl.MasterTemplate.FilterDescriptors.Add(autoFilter)
            multiComboElement.SelectedIndex = -1
            multiComboElement.DropDownHeight = 200
            multiComboElement.DropDownWidth = 800
            multiComboElement.EditorControl.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill             
        End If
    End If
    
End Sub

The attached gif file illustrates the behavior.
Completed
Last Updated: 17 Dec 2015 16:40 by ADMIN
GridViewMultiComboBoxColumn accepts only valid values according to the specified ValueMember. By entering "A" in the RadMultiColumnComboBoxElement editor in the filter cell, you can not filter the main RadGridView with all cells that starts with "A" as "A" is not a valid value according to the GridViewMultiComboBoxColumn.ValueMember property.  

Workaround: The ContextMenuOpening can be used to hide the irrelevant filter members
Completed
Last Updated: 26 Oct 2015 15:34 by ADMIN
ADMIN
Created by: Dess | Tech Support Engineer, Principal
Comments: 0
Category: GridView
Type: Feature Request
0
If you select a row and click with the right mouse button on the header row column, the context menu with Cut, Copy, Paste is shown. If you click the Cut item, it  will cut only a single cell. However, if you Copy , the entire row will be copied.

Workaround:

public class CustomGrid : RadGridView
{
    protected override RadGridViewElement CreateGridViewElement(
    {
        return new CustomRadGridViewElement();
    }

    public override string ThemeClassName
    {
        get
        {
            return typeof(RadGridView).FullName;
        }
    }
}

public class CustomRadGridViewElement : RadGridViewElement
{
    protected override MasterGridViewTemplate CreateTemplate()
    {
        return new CustomMasterGridViewTemplate();
    }

    protected override Type ThemeEffectiveType   
    {
        get  
        {
            return typeof(RadGridViewElement);   
        }
    }
}

public class CustomMasterGridViewTemplate : MasterGridViewTempla
{
    public override void Cut()
    {
        this.BeginRowCopy();
        this.Copy();
        this.EndRowCopy();
        foreach (GridViewRowInfo row in this.SelectedRows)
        {
            foreach (GridViewCellInfo cell in row.Cells)
            {
                cell.Value = null;
            }
        }
    }
}
Completed
Last Updated: 12 Oct 2015 12:27 by ADMIN
workaround: in the handler of the Load event explicitly set the scroll bar value to 0
 this.radGridView1.TableElement.VScrollBar.Value = 0;
Completed
Last Updated: 16 Oct 2015 07:04 by ADMIN
To reproduce:
- Create a hierarchy  and set the UseScrollbarsInHierarchy property to true.
- Scroll by pressing the thumb in the child template.
-  The CellClick event is fired when the mouse is released.

Workaround:
void radGridView1_CellClick(object sender, GridViewCellEventArgs e)
{
    if (e.Column != null)
    {
        Console.WriteLine("CellClick");
    }
}
Completed
Last Updated: 12 Oct 2015 14:08 by ADMIN
To reproduce:
- Add self-reference hierarchy  and set a checkbox column as expander column - show the column at runtime upon button click.
- You will notice that the layout is not updated properly.
- If the column is small the checkboxes appear in the next cell.

Workaround:
Update the layout when the column is made visible:
 this.gridViewParameter.TableElement.UpdateView();

Set the ClipDrawing property of the checkbox cells to true:
 void gridViewParameter_CellFormatting(object sender, CellFormattingEventArgs e)
{
    if (e.CellElement is GridCheckBoxCellElement)
    {
        e.CellElement.ClipDrawing = true;
    }
    else
    {
        e.CellElement.ResetValue(LightVisualElement.ClipDrawingProperty, Telerik.WinControls.ValueResetFlags.Local);
    }
}

 
Declined
Last Updated: 23 Jul 2015 13:47 by ADMIN
Steps to reproduce:

1. Add a GridViewDateTimeColumn to a grid.

2. Add rows where one or more rows should contain null as the columns value.

3. Sort the grid by the date time column. 



WORKAROUND:

Create a custom RadGridDateTimeConverter and assign it as the column's date type converter:

public class CustomRadGridDateTimeConverter : RadGridDateTimeConverter
{
    public CustomRadGridDateTimeConverter(GridViewDateTimeColumn column)
        : base(column)
    { }

    public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destinationType)
    {
        if (destinationType == typeof(DateTime) && value == null)
        {
            return DateTime.MinValue;
        }

        return base.ConvertTo(context, culture, value, destinationType);
    }
}



this.radGridView1.Columns["DateTime"].DataTypeConverter = new CustomRadGridDateTimeConverter(this.radGridView1.Columns["DateTime"] as GridViewDateTimeColumn);
Declined
Last Updated: 20 Oct 2015 14:28 by ADMIN
To reproduce:
protected override void OnLoad(EventArgs e)
{
    this.radGridView1.AllowAddNewRow = false;
    this.radGridView1.TableElement.RowHeight = 40;

    this.radGridView1.MasterTemplate.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill;        
    GridViewTextBoxColumn id = new GridViewTextBoxColumn("ID");
    id.IsVisible = false;
    GridViewTextBoxColumn parentID = new GridViewTextBoxColumn("ParentID");
    parentID.IsVisible = false;
    GridViewTextBoxColumn name = new GridViewTextBoxColumn("Name");
    GridViewDateTimeColumn date = new GridViewDateTimeColumn("Date");
    GridViewTextBoxColumn type = new GridViewTextBoxColumn("Type");
    GridViewTextBoxColumn size = new GridViewTextBoxColumn("Size");
    size.FormatString = "{0} MB";
    radGridView1.Columns.AddRange(new GridViewDataColumn[]
    {
        id,
        parentID,
        name,
        date,
        type,
        size
    });

    this.radGridView1.Relations.AddSelfReference(this.radGridView1.MasterTemplate, "ID", "ParentID");

    radGridView1.CellValueChanged += radGridView1_CellValueChanged;
    fillData();
}



void radGridView1_CellValueChanged(object sender, GridViewCellEventArgs e)
{
    fillData();
}

private void fillData()
{     
    radGridView1.Rows.Clear();
   
    radGridView1.Rows.Add(1, null, "Program Files", DateTime.Now.AddDays(-100), "Folder", 5120);
    radGridView1.Rows.Add(2, 1, "Visual Studio 2010", DateTime.Now.AddDays(-100), "Folder", 3220);
    radGridView1.Rows.Add(3, 2, "bin", DateTime.Now.AddDays(-100), "Folder", 3220);
    radGridView1.Rows.Add(4, 2, "READEME.txt", DateTime.Now.AddDays(-100), "Text Document", 3);
    radGridView1.Rows.Add(100, null, "Test.txt", DateTime.Now.AddDays(-10), "Text File", 0);

    radGridView1.Rows.Add(5, 1, "Telerik RadControls", DateTime.Now.AddDays(-10), "Folder", 3120);
    radGridView1.Rows.Add(6, 5, "Telerik UI for Winforms", DateTime.Now.AddDays(-10), "Folder", 101);
    radGridView1.Rows.Add(7, 5, "Telerik UI for Silverlight", DateTime.Now.AddDays(-10), "Folder", 123);
    radGridView1.Rows.Add(8, 5, "Telerik UI for WPF", DateTime.Now.AddDays(-10), "Folder", 221);
    radGridView1.Rows.Add(9, 5, "Telerik UI for ASP.NET AJAX", DateTime.Now.AddDays(-10), "Folder", 121);

    radGridView1.Rows.Add(10, 1, "Microsoft Office 2010", DateTime.Now.AddDays(-120), "Folder", 1230);
    radGridView1.Rows.Add(11, 10, "Microsoft Word 2010", DateTime.Now.AddDays(-120), "Folder", 1230);
    radGridView1.Rows.Add(12, 10, "Microsoft Excel 2010", DateTime.Now.AddDays(-120), "Folder", 1230);
    radGridView1.Rows.Add(13, 10, "Microsoft Powerpoint 2010", DateTime.Now.AddDays(-120), "Folder", 1230);

    radGridView1.Rows.Add(14, 1, "Debug Diagnostic Tools v1.0", DateTime.Now.AddDays(-400), "Folder", 2120);
    radGridView1.Rows.Add(15, 1, "Designer's 3D Tools", DateTime.Now.AddDays(-500), "Folder", 1120);
    radGridView1.Rows.Add(16, 1, "Communication", DateTime.Now.AddDays(-700), "Folder", 120);
}

Then start the application edit a value and click another cell.

Workaround:
- Enclose the rows addition within Begin/End update block.
Completed
Last Updated: 23 Jul 2015 13:08 by ADMIN