In Development
Last Updated: 09 Sep 2025 08:23 by ADMIN
Riziq
Created on: 21 Aug 2025 11:58
Category: GridView
Type: Bug Report
1
RadGridView: The Control can't Lose Focus When the CommandColumn Cell is Selected
When a CommandColumn cell is focused and we try to focus an external control, the RadGridView can't lose focus. The internal code will force the control to focus the CommandColumn cell again.
4 comments
ADMIN
Hristo
Posted on: 09 Sep 2025 08:23

Hello Pawz,

We are already testing a fix candidate and if everything goes accroding to plan next week we will release a Preview version: Preview Release - Telerik UI for WinForms.

Please execuse us for the caused inconvenience.

Regards,
Hristo
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Pawz
Posted on: 09 Sep 2025 05:54

I'm also seeing this behavior, and it's even worse - as long as the command cell is focused, ALL other telerik controls stop working. You cannot click into text boxes, drop down lists will drop down but refuse to change, etc. 

This is requiring me to roll back to a previous version of the controls.

ADMIN
Dinko | Tech Support Engineer
Posted on: 01 Sep 2025 13:55

Hello,

I want to follow up on my previous reply. The suggested workaround will not work when the RadGridView is placed inside RadPageView. In this case, we can only replace the default GridCommandCellElement with a custom cell. Then we can set the IsCurrent property to false. 

public partial class UserControl1 : UserControl
{
    public UserControl1()
    {
        InitializeComponent();
        this.radGridView1.CreateCell += RadGridView1_CreateCell;
    }

    private void RadGridView1_CreateCell(object sender, GridViewCreateCellEventArgs e)
    {
        if (e.CellType == typeof(GridCommandCellElement))
        {
            e.CellElement = new CustomCommandCell(e.Column, e.Row);
        }
    }
}
public class CustomCommandCell : GridCommandCellElement
{
    public CustomCommandCell(GridViewColumn column, GridRowElement row) : base(column, row)
    {

    }

    protected override Type ThemeEffectiveType
    {
        get
        {
            return typeof(GridCommandCellElement);
        }
    }
    public override bool IsCurrent
    {
        get
        {
            return (bool)this.GetValue(IsCurrentProperty);
        }
        set
        {
            this.SetValue(IsCurrentProperty, false);
        }
    }
}

Regards,
Dinko | Tech Support Engineer
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

ADMIN
Dinko | Tech Support Engineer
Posted on: 21 Aug 2025 12:33

Hi Riziq,

Thank you for reporting this. As a workaround, we can create a custom GridCommandCellElement and override the IsCurrent property. Then we can set the default IsCurrentProperty value, thus skipping the logic inside the GridCommandCellElement IsCurrent property setter.

public class MYCommandColumn : GridViewCommandColumn
{
    public MYCommandColumn()
    {                
    }
    public MYCommandColumn(string fieldName) : base(fieldName)
    {
    }

    public override Type GetCellType(GridViewRowInfo row)
    {
        if (row is GridViewDataRowInfo)
        {
            return typeof(MyCommandCell);
        }
        return base.GetCellType(row);
    }
}

public class MyCommandCell : GridCommandCellElement
{
    public MyCommandCell(GridViewColumn column, GridRowElement row) : base(column, row)
    {
    }

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

    public override bool IsCompatible(GridViewColumn data, object context)
    {
        return data is MYCommandColumn && context is GridDataRowElement;
    }

    // Alternative implementation that bypasses GridCommandCellElement's IsCurrent setter
    public override bool IsCurrent
    {
        get
        {
            return (bool)this.GetValue(IsCurrentProperty);
        }
        set
        {
            this.SetValue(IsCurrentProperty, value);
        }
    }
}

Then we can add the custom column to the RadGridView and use it instead of the default GridViewCommandColumn.

MYCommandColumn myCommandColumn = new MYCommandColumn("Command");
this.radGridView1.MasterTemplate.Columns.Add(myCommandColumn);

Regards,
Dinko | Tech Support Engineer
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.