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;
}
}
Hi support,
I think I found an issue with the default behavior of Telerik UI for Winforms on a HighDPI PerMonitorV2 configuration.
The application works correctly and resizes well if moved between screen with different Font Scalings.
However, if the user changes the main screen to one with a different scaling, the application is strangely taking the change into account and would also not come back to its original state.
Attached is a GIF showing the problem and the project. The application on run on screen 3 being main display at 100% FontScale. If I pass Screen 1, the main display (which is 125% font scaled), the icons of the app are made larger (for no reason), going back to screen 1 being the main screen, will not restore the icon to the correct size, unless you make parts of the application being redrawn.
I've a more related question but it's more complex and I won't be able to provide a project for this, so I'm just trying here ;) In our real application (not this test one), when setting PerMonitorV2 mode, we need to have RadControl.EnableRadAutoScale set to false for the controls to resize correctly when changing monitors whereas this [test] application needs it to be let it set to true to kind of do the same thing ?! Any idea on where the difference can come from ?
Thanks & regards,
Benjamin Foucher
Repro-steps:
Expected behavior:
Observed behavior:
I traced the problem back to the method GridViewSleectedCellsCollection.IsSelected / GetHashCodeString.
internal bool IsSelected(GridViewRowInfo row, GridViewColumn column) => row != null && column is GridViewDataColumn && this.hashtable.Contains((object) this.GetHashCodeString(row, column));When a cell is selected with GridViewCellInfo.IsSelected = true, it checks if it has already been selected. It does so by calling GridViewSleectedCellsCollection.IsSelected. which checks if a HasCodeString is already in a hashtable. But, when another selected cell has the same HasCodeString, the result is (incorrectly) true, which will result in not added it to the collection of selected cells.
I guess that is can be easily fixed by changing:
private string GetHashCodeString(GridViewRowInfo row, GridViewColumn column)
{
int hashCode = row.GetHashCode();
string str1 = hashCode.ToString();
hashCode = column.GetHashCode();
string str2 = hashCode.ToString();
return str1 + str2;
}to:
private string GetHashCodeString(GridViewRowInfo row, GridViewColumn column)
{
int hashCode = row.GetHashCode();
string str1 = hashCode.ToString();
hashCode = column.GetHashCode();
string str2 = hashCode.ToString();
return str1 + "_" + str2;
}Since hashcodes 1 + 23 will result in the same string as hashcodes 12 + 3.
Making this change will reduce the problem significantly, but not entirely since hashCodes will never be unique.
Clients with perpetual license may observe the following warning when using UI.for.WinForms.AllControls.Net90 (v.2026.1.415):
Telerik and Kendo UI Licensing warning TKL403: Services associated with Telerik Document Processing Libraries version 2026.1.402.80 require a subscription or trial license. Please obtain a subscription license at https://prgress.co/3PwQMKZ
Telerik and Kendo UI Licensing warning TKL004: Unable to locate licenses for all products.
The AccessibleName property is not respected by the Windows Narrator.
Other controls that have the same behavior:
Use the following code snippet:
Sub New()
InitializeComponent()
Me.RadCheckedDropDownList1.ShowCheckAllItems = True
Me.RadCheckedDropDownList1.AutoSizeItems = True
For x = 1 To 20
Dim i As New DescriptionTextCheckedListDataItem
i.Value = x
i.Text = x.ToString()
i.DescriptionText = "abc def ghijkl mnop abc def ghijkl mnop" & x
Me.RadCheckedDropDownList1.Items.Add(i)
Next
End SubOpen the popup, scroll to the bottom and then back to the top.
Expected: The CheckAllItem is visible
Actual: The CheckAllItem is hidden
The issue exists with RadMenuItem as well!
Workaround:
public class CustomCommandBarButton : CommandBarButton
{
protected override void OnClick(EventArgs e)
{
MouseEventArgs args = e as MouseEventArgs;
if (args.Button == System.Windows.Forms.MouseButtons.Left)
{
base.OnClick(e);
}
}
protected override Type ThemeEffectiveType
{
get
{
return typeof(CommandBarButton);
}
}
}
Please run the attached sample project and navigate with the left/right arrows as it is demonstrated in the gif file.
This width is 6px by default and it doesn't offer convenient API for customizing it:
Workaround:
public class CustomRadDropDownList : RadDropDownList
{
protected override RadDropDownListElement CreateDropDownListElement()
{
return new CustomRadDropDownListElement();
}
public override string ThemeClassName
{
get
{
return typeof(RadDropDownList).FullName;
}
}
}
public class CustomRadDropDownListElement : RadDropDownListElement
{
protected override RadDropDownListArrowButtonElement CreateArrowButtonElement()
{
return new CustomRadDropDownListArrowButtonElement();
}
protected override Type ThemeEffectiveType
{
get
{
return typeof(RadDropDownListElement);
}
}
}
public class CustomRadDropDownListArrowButtonElement : RadDropDownListArrowButtonElement
{
protected override Type ThemeEffectiveType
{
get
{
return typeof(RadDropDownListArrowButtonElement);
}
}
protected override void OnClick(EventArgs e)
{
MouseEventArgs args = e as MouseEventArgs;
if (args.Button == System.Windows.Forms.MouseButtons.Left)
{
base.OnClick(e);
}
}
}
In the Visual Theme Builder (fresh installed Telerik UI for WinForms) you'll get an error because the directory "VbsRecoveryData" seems to be missing. Creating the directory before "package.Compress(path)" fixes this for me.
In this specific scenario, we have a menu with 2 menu items: &File and &Open. The mnemonic sign is set to the F and O letters. In the form, we have a TextBox control which is currently focused. The next step is to press the Alt key while the TextBox is focused. Pressing some other letter, D for example, the letter will be typed in the TextBox. This letter does not exist as a mnemonic, and the RadMenu will ignore it. The RadMenu remains in active mnemonic state.
Expected behavior: Using none mnemonic letter should not be accepted by any other control until this state is closed in the RadMenu.