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.

 

Unplanned
Last Updated: 13 Feb 2023 07:32 by ADMIN
Created by: Martin
Comments: 6
Category: VirtualGrid
Type: Bug Report
3

Repro-steps:

  1. Use the code beneath.
  2. Run this form.
  3. 20 records are shown, the "AddNewRow" is shown.
  4. Select all records.
  5. Press <delete>
  6. 0 records are shown (as expected), the "AddNewRow" is invisible (unexpected).
  7. Close the program.
  8. Modify LoadTable(true) to LoadTable(false). Records will not be created..
  9. Run this form.
  10. 0 records are shown (as expected), the "AddNewRow" is invisible (unexpected).

Expected behavior:

  • Even when the dataTable or view has no rows, we should still be able to add new rows.

Observed behavior:

  • When datatable/view is empty, no new records are allowed to enter.

Please observe that Grid.UserAddedRow is not handled, but since we cannot even see the AddNewRow, it is not required for this bug.


	public partial class TestForm: Form
	{
		private readonly DataView _view;

		public TestForm()
		{
			InitializeComponent();

			_view = new DataView(LoadTable(true));
			_grid.ColumnCount = _view.Table.Columns.Count;
			_grid.RowCount = _view.Count;
			_grid.AllowAddNewRow = true;
			_grid.SelectionMode = VirtualGridSelectionMode.FullRowSelect;
		}

		static private DataTable LoadTable(bool fill)
		{
			var table = new DataTable();
			table.Columns.Add("Number", typeof(int));
			
			if (fill)
				for(int i = 0; i < 20; i++)
					table.Rows.Add(i);
			
			return table;
		}


		#region Windows Form Designer generated code

		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{
			this._grid = new Telerik.WinControls.UI.RadVirtualGrid();
			((System.ComponentModel.ISupportInitialize)(this._grid)).BeginInit();
			this.SuspendLayout();
			// 
			// _grid
			// 
			this._grid.Dock = System.Windows.Forms.DockStyle.Fill;
			this._grid.Location = new System.Drawing.Point(0, 0);
			this._grid.MultiSelect = true;
			this._grid.Name = "_grid";
			this._grid.SelectionMode = Telerik.WinControls.UI.VirtualGridSelectionMode.FullRowSelect;
			this._grid.Size = new System.Drawing.Size(800, 450);
			this._grid.TabIndex = 0;
			this._grid.CellValueNeeded += new Telerik.WinControls.UI.VirtualGridCellValueNeededEventHandler(this._grid_CellValueNeeded);
			this._grid.UserDeletedRow += new Telerik.WinControls.UI.VirtualGridRowsEventHandler(this._grid_UserDeletedRow);
			// 
			// TestForm
			// 
			this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
			this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
			this.ClientSize = new System.Drawing.Size(800, 450);
			this.Controls.Add(this._grid);
			this.Name = "TestForm";
			this.Text = "TestForm";
			((System.ComponentModel.ISupportInitialize)(this._grid)).EndInit();
			this.ResumeLayout(false);

		}

		#endregion

		private Telerik.WinControls.UI.RadVirtualGrid _grid;

		private void _grid_CellValueNeeded(object sender, Telerik.WinControls.UI.VirtualGridCellValueNeededEventArgs e)
		{
			if (e.ColumnIndex < 0)
				return;

			if (e.RowIndex < 0)
			{
				e.FieldName = _view.Table.Columns[e.ColumnIndex].ColumnName;
				if (e.RowIndex == RadVirtualGrid.HeaderRowIndex)
					e.Value = e.FieldName;
			}
			else if (e.RowIndex < _view.Count)
			{
				e.Value = _view[e.RowIndex][e.ColumnIndex];
			}
		}

		private void _grid_UserDeletedRow(object sender, Telerik.WinControls.UI.VirtualGridRowsEventArgs e)
		{
			var rowIndexes = e.RowIndices.Distinct().OrderByDescending(i => i).ToList(); // Off topic: I have seen duplicate row indexes in this row collection. And unsorted. Is that by design?
			if (rowIndexes.Count == _view.Count)
			{
				_view.Table.Rows.Clear();
			}
			else
			{
				foreach(var index in rowIndexes)
					_view[index].Delete();
			}

			_grid.RowCount = _view.Count;
		}
	}

Unplanned
Last Updated: 10 Feb 2023 11:26 by ADMIN
Created by: Martin
Comments: 3
Category: VirtualGrid
Type: Feature Request
2

RadVirtualGrid does not support (nullable) booleans out of the box. 

There are several pages to work around this issues, like:

In my humble opinion this should be supported by default. Why?

  • The standard System.Windows.Forms.GridView supports it.
  • The Telerik RadGridView supports it.
  • Many example code show how to use RadVirtualGrid in combination with a database. And many database systems support the boolean (or bit).
  • The RadVirtualGrid does support the datatype "Color". I hope you believe me when I say that a boolean is more commonly used than Color. (Again: Look inside a database)

In my mind I think of how a meeting would have been while designing the RadVirtualGrid.

  • The team: "Shall we support integers?" 
  • The product owner: "Yes!"
  • The team: "Shall we support strings?" 
  • The product owner: "Of course!"
  • The team: "Shall we support Colors?" 
  • The product owner: "That would be wonderful!"
  • The team: "Shall we support booleans?" 
  • The product owner: "Booleans? Nahh.... who needs booleans? Boolean are overrated!"

;-)

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: 16 Nov 2021 12:46 by ADMIN

Please refer to the attached sample project and the gif file. You will notice that when resizing the grid, in certain cases unnecessary horizontal scrollbar appears.

Completed
Last Updated: 07 Jun 2021 16:24 by ADMIN
Release R2 2021 SP1
I'm trying to save the layout of a VirtualGrid to retain the user's settings and I started setting up the custom serialization rules and was continually getting errors.
Completed
Last Updated: 06 Apr 2021 13:41 by ADMIN
Release R2 2021

When you have a RadVirtualGrid with hierarchy and after expanding a row if you right-click a cell in the child grid and select the "Copy" item, it doesn't copy the text of the cell I right-clicked, it copies the text of the first cell. 

Please test with the attached sample project.

Completed
Last Updated: 23 Feb 2021 10:37 by ADMIN
Release R1 2021 SP2
1.The editor overlapping other cells after editing.

2. The arrow, that is actually meant to open the DropDown, cannot be clicked. Only the cell under it is clicked instead.
Completed
Last Updated: 18 Feb 2021 12:21 by ADMIN
Release R1 2021 SP2

I have a RadVirtualGrid with hierarchical data. When I change the page, then expand a row, and then hit the tab key I get an ArgumentOutOfRangeException:

Value of '-3838' is not valid for 'Value'. 'Value' must be between 'Minimum' and 'Maximum'.
Parameter name: Value

 

Completed
Last Updated: 08 Feb 2021 13:53 by ADMIN
Release R1 2021 SP2

Hi,

I have a RadVirtualGrid. I add a filter descriptor and then fetch the filtered data from the data store. I then clear the filters and perform a different fetch from the store. However, when I click in the filter value textbox the text from the previous filter operation is still there even though I purposely call radVirtualGrid.FilterDescriptors.Clear() prior to fetching the data from the store.

The filter text doesn't display in the filter row for the column where the filter was entered until I click in the text edit area.

How do I get rid of the text from the previous filter?

thanks,

Mike

Declined
Last Updated: 27 Jan 2021 13:39 by ADMIN

dear sir ,

i have a problem keydown event does not fire in add new row ?

i want to move to the next cell when i hit Enter key after entering new value and when i reach the last cell of the add new row and type enter the new row will automatically added to the grid....

what's i have to do.....

please any suggest ? thx

Unplanned
Last Updated: 04 Jan 2021 15:45 by ADMIN
RadVirtualGrid shold automatically adjust the height of the visible cells/rows only. When you perform scrolling horizontally or vertically, the respective scrollbar will be adjusted. The scrollbar may shrink or enlarge considering the currently displayed data. Have in mind that when you have a horizontal scrollbar, the row's height will be calculated according to the content of the visible cells on the row. If you scroll horizontally and some of the cells on the row get hidden and others get visible, the row's height should be adjusted according to the content. Initially, this behavior may be confusing for the users, however since data is loaded on demand in RadVirtualGrid, you need to autosize the rows on demand as well. 
Unplanned
Last Updated: 19 Nov 2020 09:59 by ADMIN

Please run the attached sample project and navigate with the left/right arrows as it is demonstrated in the gif file.

Completed
Last Updated: 12 Jun 2020 16:00 by ADMIN
Release R2 2020 SP1

Please use the following code snippet and click the filter button for the first column in the virtual grid. You will notice that the default menu is shown:

        RadContextMenu menu = new RadContextMenu();
        public RadForm1()
        {
            InitializeComponent();
            RadDateTimePicker aDateTimePicker = new RadDateTimePicker();
            RadMenuItem theMenuItem = new RadMenuItem();
            theMenuItem.MinSize = new Size(200, 30);
            RadHostItem theHostItem = new RadHostItem(aDateTimePicker);
            theMenuItem.Children.Add(theHostItem); 
            menu.Items.Add(theMenuItem);
            this.radVirtualGrid1.RowCount = 50;
            this.radVirtualGrid1.ColumnCount = 5;
            this.radVirtualGrid1.CellValueNeeded+=radVirtualGrid1_CellValueNeeded;

            this.radVirtualGrid1.AllowFiltering = true;
            this.radVirtualGrid1.ContextMenuOpening+=radVirtualGrid1_ContextMenuOpening;
        }

        private void radVirtualGrid1_ContextMenuOpening(object sender, VirtualGridContextMenuOpeningEventArgs e)
        {
            int i;
            string theMenuItemText;

            if (e.RowIndex == -3 && e.ColumnIndex < 1)
            {
                e.ContextMenu = menu.DropDown; 
            }
        }

        private void radVirtualGrid1_CellValueNeeded(object sender, VirtualGridCellValueNeededEventArgs e)
        {
            e.Value = Guid.NewGuid().ToString();
        }

Completed
Last Updated: 21 Jan 2020 12:02 by ADMIN
Release R1 2019
ADMIN
Created by: Dess | Tech Support Engineer, Principal
Comments: 0
Category: VirtualGrid
Type: Bug Report
1
It is difficult to replicate the issue and it is not always reproduced. When using the splitter between columns[1] and columns[2]  to resize column[1] I found out that releasing the mouse button doesn't cause the splitter to be released, even when clicking on the grid. It seems to work ok once or twice but once it fails then keeps failing.

Workaround:
        private void radVirtualGrid1_MouseUp(object sender, MouseEventArgs e)
        {
            if (e.Button == System.Windows.Forms.MouseButtons.Left)
            {
                this.radVirtualGrid1.Cursor = Cursors.Default;
            }
        }
Completed
Last Updated: 03 Oct 2019 11:49 by ADMIN
Release R3 2019 SP1 (LIB 2019.3.1007)
Created by: n/a
Comments: 1
Category: VirtualGrid
Type: Bug Report
1

Hi,


I have a problem with the expansion of the last row.

After Row Expanding and Row Collapsing the last or second last row, the last row is not visible because it seems that there I some kind of lock on the scrollbar : it doesn’t scroll down neither with the mouse wheel nor with the button so it is not possible to move on the last row.

If instead you scroll up and then down the row became visible again.

In the attached example project.

 

Regards

 

 

 

Completed
Last Updated: 03 Oct 2019 11:47 by ADMIN
Release R3 2019 SP1 (LIB 2019.3.1007)
ADMIN
Created by: Dess | Tech Support Engineer, Principal
Comments: 0
Category: VirtualGrid
Type: Bug Report
5
To reproduce: open the VirtualGrid >> First Look example in QSF and follow the steps:

1) I have a virtual grid which has both vertical and horizontal scroll bars.

2) Scroll to the very bottom of the grid

3) Select the last row

4) Scroll all the way to the right

At this moment the selected row disappears from the view. While scrolling horizontally the vertical scrollbar jumps several rows above although it seems scrolled to the bottom. 
Completed
Last Updated: 03 Oct 2019 11:45 by ADMIN
Release R3 2019 SP1 (LIB 2019.3.1007)

To reproduce: 

Set the RowSpacing to 10. Press down until the last cell is selected. The view is not scrolled down. 

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.