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(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.