Completed
Last Updated: 24 Jan 2018 11:08 by ADMIN
To reproduce:
- Enable the paging and add 1000 rows.
- Press Ctrl + End
- An exception is thrown.

Workaround:

radVirtualGrid1.VirtualGridElement.InputBehavior = new MyBehavior(radVirtualGrid1.VirtualGridElement);

class MyBehavior : VirtualGridInputBehavior
{
    public MyBehavior(RadVirtualGridElement element) : base(element)
    {

    }
    protected override bool HandleEndKey(KeyEventArgs keys)
    {
        this.GridElement.PageIndex = this.GridElement.TotalPages - 1;
      
        return true;
        //return base.HandleEndKey(keys);
    }
}
Completed
Last Updated: 20 Sep 2016 06:48 by ADMIN
ADMIN
Created by: Dess | Tech Support Engineer, Principal
Comments: 0
Category: VirtualGrid
Type: Bug Report
1
To reproduce:

public Form1()
{
    InitializeComponent();

    this.radVirtualGrid1.ColumnCount = 5;
    this.radVirtualGrid1.RowCount = 20;
    this.radVirtualGrid1.CellValueNeeded += radVirtualGrid1_CellValueNeeded;
}

private void radVirtualGrid1_CellValueNeeded(object sender, Telerik.WinControls.UI.VirtualGridCellValueNeededEventArgs e)
{
    e.Value = "Data" + e.RowIndex + "." + e.ColumnIndex;
}

Workaround: use a custom ScrollableVirtualCellsContainer:

public Form1()
{
    InitializeComponent();
    this.radVirtualGrid1.CreateRowElement += radVirtualGrid1_CreateRowElement;
    this.radVirtualGrid1.ColumnCount = 5;
    this.radVirtualGrid1.RowCount = 20;
    this.radVirtualGrid1.CellValueNeeded += radVirtualGrid1_CellValueNeeded;
}

private void radVirtualGrid1_CreateRowElement(object sender, VirtualGridCreateRowEventArgs e)
{
    e.RowElement = new CustomVirtualGridRowElement();
}

private void radVirtualGrid1_CellValueNeeded(object sender, Telerik.WinControls.UI.VirtualGridCellValueNeededEventArgs e)
{
    e.Value = "Data" + e.RowIndex + "." + e.ColumnIndex;
}

public class CustomVirtualGridRowElement : VirtualGridRowElement
{
    public CustomVirtualGridRowElement()
        : base()
    {
        FieldInfo fi = typeof(VirtualGridRowElement).GetField("scrollableColumns", BindingFlags.NonPublic | BindingFlags.Instance);
        ScrollableVirtualCellsContainer scrollableColumns = fi.GetValue(this) as ScrollableVirtualCellsContainer;
        CustomScrollableVirtualCellsContainer newScrollableColumns = new CustomScrollableVirtualCellsContainer();
        FieldInfo fi2 = typeof(ScrollableVirtualCellsContainer).GetField("rowElement", BindingFlags.NonPublic | BindingFlags.Instance);
        fi2.SetValue(newScrollableColumns, this);
        this.Children.Remove(scrollableColumns);
        this.Children.Insert(1, newScrollableColumns);
    }
}

public class CustomScrollableVirtualCellsContainer : ScrollableVirtualCellsContainer
{
    protected override SizeF MeasureElementCore(RadElement element, SizeF availableSize)
    {
        int scrollOffset = 0;

        if (this.RowElement.TableElement.ColumnScroller.ScrollMode == ItemScrollerScrollModes.Discrete)
        {
            for (int i = 0; i < this.RowElement.TableElement.ColumnScroller.Scrollbar.Value; i++)
            {
                scrollOffset += this.RowElement.TableElement.ColumnScroller.GetScrollHeight(
                    this.RowElement.TableElement.ViewInfo.ColumnsViewState.GetItemSize(i));
            }
        }
        else
        {
            scrollOffset = this.RowElement.TableElement.HScrollBar.Value;
        }

        VirtualGridCellElement cellElement = element as VirtualGridCellElement;

        int itemOffset = this.RowElement.ViewInfo.ColumnsViewState.GetItemOffset(cellElement.Data);
        int itemWidth = this.RowElement.ViewInfo.ColumnsViewState.GetItemSize(cellElement.Data);

        element.Measure(availableSize);

        if (itemOffset + itemWidth > scrollOffset && itemOffset < scrollOffset)
        {
            return new SizeF((itemOffset + itemWidth) - scrollOffset, element.DesiredSize.Height);
        }

        return element.DesiredSize;
    }
}
Completed
Last Updated: 10 Jan 2017 13:50 by ADMIN
To reproduce:
private void RadVirtualGrid1_EditorRequired(object sender, Telerik.WinControls.UI.VirtualGridEditorRequiredEventArgs e)
{
    switch (e.ColumnIndex)
    {
        case 1:
            {
                VirtualGridTextBoxControlEditor editor = new VirtualGridTextBoxControlEditor();
                editor.CharacterCasing = CharacterCasing.Upper;
                e.Editor = editor;
            }
            break;
    }
}

- Open the editor and try using the backspace or the arrow keys. 

Workaround:
class MyGrid : RadVirtualGrid
{
    protected override void OnKeyDown(KeyEventArgs e)
    {
        base.OnKeyDown(e);

        if (this.ActiveEditor is VirtualGridTextBoxControlEditor)
        {
            var editor = this.ActiveEditor as VirtualGridTextBoxControlEditor;
            var element =   editor.EditorElement as RadTextBoxControlElement;
            element.InputHandler.ProcessKeyDown(e);
        }
    }
    protected override void OnKeyUp(KeyEventArgs e)
    {
        base.OnKeyUp(e);

        if (this.ActiveEditor is VirtualGridTextBoxControlEditor)
        {
            var editor = this.ActiveEditor as VirtualGridTextBoxControlEditor;
            var element = editor.EditorElement as RadTextBoxControlElement;
            element.InputHandler.ProcessKeyUp(e);
        }
    }
}
Completed
Last Updated: 27 Dec 2016 11:02 by ADMIN
To reproduce: use the following code snippet and try to select another cell.

public RadForm1()
{
    InitializeComponent();

    this.radVirtualGrid1.RowCount = 30;
    this.radVirtualGrid1.ColumnCount = 5;
    this.radVirtualGrid1.CellValueNeeded += radVirtualGrid1_CellValueNeeded;
      
    this.radVirtualGrid1.CurrentCellChanging += radVirtualGrid1_CurrentCellChanging;
}

private void radVirtualGrid1_CurrentCellChanging(object sender, Telerik.WinControls.UI.VirtualGridCellInfoCancelEventArgs e)
{
    e.Cancel = true;
}

private void radVirtualGrid1_CellValueNeeded(object sender, Telerik.WinControls.UI.VirtualGridCellValueNeededEventArgs e)
{
    e.Value = e.RowIndex + "." + e.ColumnIndex;
}

Workaround:

public class CustomVirtualGrid : RadVirtualGrid
{
    public override string ThemeClassName  
    { 
        get 
        { 
            return typeof(RadVirtualGrid).FullName;  
        }
    }

    protected override void OnMouseDown(MouseEventArgs e)
    {
        if (e.Button == System.Windows.Forms.MouseButtons.Left)
        {
            return;
        }
        base.OnMouseDown(e);
    }
}

Completed
Last Updated: 04 Jan 2017 19:15 by ADMIN
ADMIN
Created by: Dess | Tech Support Engineer, Principal
Comments: 0
Category: VirtualGrid
Type: Bug Report
1
To reproduce: use the following code snippet and follow the steps:
public RadForm1()
{
    InitializeComponent();

    this.radVirtualGrid1.RowCount = 10;
    this.radVirtualGrid1.ColumnCount = 5;
    this.radVirtualGrid1.CellValueNeeded+=radVirtualGrid1_CellValueNeeded;
}

private void radVirtualGrid1_CellValueNeeded(object sender, Telerik.WinControls.UI.VirtualGridCellValueNeededEventArgs e)
{
    e.Value = e.RowIndex + "." + e.ColumnIndex;
}

1. Pin (left or right) 1st column
2. Scroll horizontally (to not display 2nd column)
3. Unpin 1st column
4. Scroll horizontally to display 1st column
=> 1st column is hidden, the only way to make it visible is to resize a column or the entire window

Workaround: 

 private void radVirtualGrid1_ContextMenuOpening(object sender, Telerik.WinControls.UI.VirtualGridContextMenuOpeningEventArgs e)
 {
     foreach (RadItem item in e.ContextMenu.Items)
     {
         if (item.Text == 
             RadVirtualGridLocalizationProvider.CurrentProvider.GetLocalizedString(RadVirtualGridStringId.PinMenuItem))
         {
             foreach (RadMenuItem subItem in ((RadMenuItem)item).Items)
             {
                 if (subItem.Text == 
                     RadVirtualGridLocalizationProvider.CurrentProvider.GetLocalizedString(RadVirtualGridStringId.UnpinColumnMenuItem))
                 {
                     subItem.Click-=subItem_Click;
                     subItem.Click+=subItem_Click;
                 }
             }
         }
     }
 }

 private void subItem_Click(object sender, EventArgs e)
 {
      this.radVirtualGrid1.MasterViewInfo.SetColumnWidth(0, this.radVirtualGrid1.MasterViewInfo.GetColumnWidth(0));
 }
Completed
Last Updated: 27 Dec 2016 16:18 by ADMIN
To reproduce:
- Change the editor to VirtualGridDropDownListEditor
- Press alpha-numeric key when the grid is not in edit mode.

Workaround:
 radVirtualGrid1.VirtualGridElement.InputBehavior = new MyBehavior(radVirtualGrid1.VirtualGridElement);

class MyBehavior : VirtualGridInputBehavior
{
    public MyBehavior(RadVirtualGridElement element) : base(element)
    {

    }
    protected override bool HandleAlphaNumericKey(KeyPressEventArgs keys)
    {
        if (!this.GridElement.IsInEditMode &&
            (this.GridElement.BeginEditMode == RadVirtualGridBeginEditMode.BeginEditOnKeystroke ||
             this.GridElement.BeginEditMode == RadVirtualGridBeginEditMode.BeginEditOnKeystrokeOrF2))
        {
            //this.GridElement.HideContextMenu();
            this.GridElement.BeginEdit();
            if (this.GridElement.ActiveEditor is VirtualGridDropDownListEditor)
            {
                string symbol = keys.KeyChar.ToString();
                var editor = this.GridElement.ActiveEditor as VirtualGridDropDownListEditor;
                var element = editor.EditorElement as RadDropDownListEditorElement;

                if ((element.AutoCompleteMode & AutoCompleteMode.Append) == AutoCompleteMode.Append)
                {
                    int index = element.AutoCompleteAppend.FindShortestString(symbol);

                    if (index == -1)
                    {
                        element.EditableElementText = symbol;
                        element.EditableElement.SelectionStart = 1;
                        element.EditableElement.SelectionLength = 0;

                        return true;
                    }
                }
               
            }
            return false;
        }

        return base.HandleAlphaNumericKey(keys);
    }
}
Completed
Last Updated: 28 Jul 2016 05:52 by ADMIN
To reproduce:
public RadForm1()
{
    InitializeComponent();
    radVirtualGrid1.CellValueNeeded += RadVirtualGrid1_CellValueNeeded;
    radVirtualGrid1.ColumnCount = 20;
    radVirtualGrid1.RowCount = 1000;
    radVirtualGrid1.AutoSizeColumnsMode = Telerik.WinControls.UI.VirtualGridAutoSizeColumnsMode.Fill;
}

private void RadVirtualGrid1_CellValueNeeded(object sender, Telerik.WinControls.UI.VirtualGridCellValueNeededEventArgs e)
{
    e.Value = string.Format("Col {0} Row{1}", e.ColumnIndex, e.RowIndex);
}

- Press and hold the down key, you will notice that the selection freezes after some time and is updated after the key is released.  
Completed
Last Updated: 27 Mar 2023 06:39 by ADMIN
Release R1 2023 SP1
When a CUT operation is executed the control is not visually synchronized with the data cell values.
Unplanned
Last Updated: 16 May 2019 05:55 by ADMIN

Hello, we have found another small bug of the RadVirtualGrid control.

When paging is enabled on child view, one of the component of the paging panel overlap whit is parent.

I attach source code and screenshot.

 

Thanks in advance.

 

Unplanned
Last Updated: 16 Jan 2023 11:40 by ADMIN

RadVirtualGridElement.Paste does not support pasting into new rows.

I want to override RadVirtualGridElement.Paste to allow to to paste into new rows. Except when I do so, the methods to retrieve information from the clipboard (GetHtmlData/GetTextData/GetCsvData ) are private.

So now I have one request, two solutions:

  • Make GetHtmlData/GetTextData/GetCsvData  protected so I can call them when I override Paste.
  • Or split up the Paste method into two sub-methods:
    • One sub-method to retrieve the information from the clipboard which will result in a list of list of strings (like: GetClipboardData())
    • The second sub-method to do the actually Paste the list of list of strings into the grid (like: Paste(List<List<string>> data)). Of course this sub-method must be virtual.

 

Unplanned
Last Updated: 14 Feb 2024 10:54 by Bert
When the user clicks an already selected row while pressing the Ctrl key, the row should be removed from the current selection.
Unplanned
Last Updated: 11 Mar 2024 11:28 by Bert
radVirtualGrid1.VirtualGridElement.SetColumnPinPosition(0, PinnedColumnPosition.Left);
radVirtualGrid1.VirtualGridElement.SetColumnPinPosition(2, PinnedColumnPosition.Left);
Unplanned
Last Updated: 11 Mar 2024 11:51 by ADMIN
The EnsureRowVisible() method does not calculate the correct position of the scroll for a child view row in the hierarchy view.
Unplanned
Last Updated: 03 Apr 2024 08:17 by ADMIN

The problem also occurs, if you just start the form. For example, on 175% (without drag).

 

Unplanned
Last Updated: 05 Apr 2024 10:36 by ADMIN

This behavior is observed when the VisualStudio2022Light theme is applied. For example, this is not observed in the Fluent theme.

Duplicated
Last Updated: 13 Mar 2023 14:19 by ADMIN
Created by: Martin
Comments: 3
Category: VirtualGrid
Type: Bug Report
1

I was trying to move the NewRow to the bottom of the RadVirtualGrid. I learned that this is not possible. During my attempts I ran into a bug:

Reproduction steps:

  1. Create a Grid
  2. Set RowCount to (at least) 1.
  3. Pin the NewRow to the bottom: Grid.TableElement.TableElement.SetRowPinPosition(RadVirtualGrid.NewRowIndex, PinnedRowPosition.Bottom);

Expected behavior:

  • Or an exception occurs, telling me only "normal" rows can be pinned.
  • Or nothing changes.
  • Or the NewRow is moved to the bottom (what I was hoping for)

Observed behavior:

  • The NewRow is shown at the top of the grid as well as the bottom of the grid. But only the one at the top is usable:
Unplanned
Last Updated: 06 Mar 2023 08:06 by ADMIN

I was trying to move the NewRow to the bottom of the RadVirtualGrid. This is also supported by its big brother RadGridView. I have now learned that this is not supported by RadVirtualGrid.

Hereby my request: Please support this!

I've created a Harmony patch (which works for me); it might help you if you decide to support it:

	static class MoveNewRowToBottom
	{
		[HarmonyPatch(typeof(VirtualGridTableElement), "InvalidatePinnedRows")]
		static class VirtualGridTableElement_InvalidatePinnedRows
		{
			static private bool _isInvalidating;

			static private bool Prefix(VirtualGridTableElement __instance)
			{
				if (_isInvalidating)
					return false;
				_isInvalidating = true;

				__instance.ViewElement.TopPinnedRows.DisposeChildren();
				__instance.ViewElement.BottomPinnedRows.DisposeChildren();

				var viewInfo = __instance.ViewInfo;
				var rowsViewState = __instance.RowsViewState;
				var topPinnedItems = rowsViewState.TopPinnedItems;
				var bottomPinnedItems = rowsViewState.BottomPinnedItems;

				if (viewInfo.ShowFilterRow)
					if (!topPinnedItems.Contains(RadVirtualGrid.FilterRowIndex) && !bottomPinnedItems.Contains(RadVirtualGrid.FilterRowIndex))
						rowsViewState.SetPinPosition(RadVirtualGrid.FilterRowIndex, PinnedRowPosition.Top);

				if (viewInfo.ShowNewRow)
					if (!topPinnedItems.Contains(RadVirtualGrid.NewRowIndex) && !bottomPinnedItems.Contains(RadVirtualGrid.NewRowIndex))
						rowsViewState.SetPinPosition(RadVirtualGrid.NewRowIndex, PinnedRowPosition.Top);

				if (viewInfo.ShowHeaderRow)
					if (!topPinnedItems.Contains(RadVirtualGrid.HeaderRowIndex) && !bottomPinnedItems.Contains(RadVirtualGrid.HeaderRowIndex))
						rowsViewState.SetPinPosition(RadVirtualGrid.HeaderRowIndex, PinnedRowPosition.Top);

				var elementProvider = __instance.RowScroller.ElementProvider;

				var topPinnedRows = __instance.ViewElement.TopPinnedRows;
				foreach (int topPinnedRow in topPinnedItems.SortTopRowIndexes())
				{
					VirtualGridRowElement pinnedRow = (VirtualGridRowElement)elementProvider.GetElement(topPinnedRow, null);
					topPinnedRows.Children.Add(pinnedRow);
					pinnedRow.Attach(topPinnedRow, null);
				}

				var bottomPinnedRows = __instance.ViewElement.BottomPinnedRows;
				foreach (int bottomPinnedRow in bottomPinnedItems.SortBottomRowIndexes())
				{
					VirtualGridRowElement pinnedRow = (VirtualGridRowElement)elementProvider.GetElement(bottomPinnedRow, null);
					bottomPinnedRows.Children.Add(pinnedRow);
					pinnedRow.Attach(bottomPinnedRow, null);
				}

				_isInvalidating = false;
				return false;
            }
		}

		static private IEnumerable<int> SortTopRowIndexes(this ReadOnlyCollection<int> topRowIndexes)
		{
			var specialRowIndex = topRowIndexes.Where(index => index < 0).ToList();
			if (specialRowIndex.Contains(RadVirtualGrid.HeaderRowIndex))
				yield return RadVirtualGrid.HeaderRowIndex;
			if (specialRowIndex.Contains(RadVirtualGrid.NewRowIndex))
				yield return RadVirtualGrid.NewRowIndex;
			if (specialRowIndex.Contains(RadVirtualGrid.FilterRowIndex))
				yield return RadVirtualGrid.FilterRowIndex;
			foreach (var index in topRowIndexes.Where(index => index >= 0))
				yield return index;
		}

		static private IEnumerable<int> SortBottomRowIndexes(this ReadOnlyCollection<int> bottomRowIndexes)
		{
			foreach (var index in bottomRowIndexes.Where(index => index >= 0))
				yield return index;
			var specialRowIndex = bottomRowIndexes.Where(index => index < 0).ToList();
			if (specialRowIndex.Contains(RadVirtualGrid.FilterRowIndex))
				yield return RadVirtualGrid.FilterRowIndex;
			if (specialRowIndex.Contains(RadVirtualGrid.NewRowIndex))
				yield return RadVirtualGrid.NewRowIndex;
			if (specialRowIndex.Contains(RadVirtualGrid.HeaderRowIndex))
				yield return RadVirtualGrid.HeaderRowIndex;
		}
	}

Unplanned
Last Updated: 01 Mar 2023 11:11 by ADMIN

Repro-steps

  • Create a RadVirtualGrid en fill it with random data.
  • Allow the grid to select multiple rows.
  • Select all rows
  • Right click on a cell, a context menu appears...

Observed behavior

First, lets compare this with when you right click on a record selector (the cell before a row starts, sometimes with an arrow). In that case only that row gets selected, so you visually see what the context menu is about. When you right click on a cell, the selection does not change so the context remains unclear. In my printscreen above it is hard to see on which cell I clicked.

Second, the actions in the context menu target multiple targets or contexts. Copy and Paste target the whole selection. Clear and Edit target the cell, Delete Row targets the row which I clicked on, but which is not visible. 

In this case, the user actually wanted to right click and delete ALL rows, which is not part of the context menu. Instead he clicked on Delete Row and he was unaware of what he had actually deleted.

Expected bevahior

  • Or, when you right click on a cell, the cell gets highlighted, so you know where you have clicked
  • Or, the rows gets highlighted (like your pressed on the record selector)
  • Or, the cell gets highlighted
  • And/or, the context menu offers an action to Delete All Rows.

 

Declined
Last Updated: 15 Sep 2023 10:54 by ADMIN

Repro steps:

  1. Create a RadVirtualGrid
  2. Give it a DateTime column
  3. Make sure the editor (VirtualGridDateTimeEditor) accepts dutch formats for dates (dd-MM-yyyy)
  4. Add a row with value: 30-11-2023

  5. Double click on the value and try to change it my literally typing: "31-12-2023"

Observed behavior:

  • A field with the value 01-12-2023

    (this happens as soon as you type "31")
  • The user needs to first enter the month, then the day to correct this.

Expected behavior:

  • A field with the value: 31-12-2023

Observation / suggestion:

  • The controle tries to validate and correct EVERY input, even when the input is not finished yet. Everybody knows "31-11-2023" is an incorrect value. But during changing it, this should not matter. The scope at that point should be: Making the user happy by accepting the input. When the user leaves the field, or enters the last digit, validation should take place. Or, if halfway entering the value, the totale date is invalid, do not change it and wait for the user to complete.