Completed
Last Updated: 26 Oct 2015 15:34 by ADMIN
ADMIN
Dess | Tech Support Engineer, Principal
Created on: 30 Jul 2015 12:38
Category: GridView
Type: Feature Request
0
ADD. RadGridView - full row Cut operation
If you select a row and click with the right mouse button on the header row column, the context menu with Cut, Copy, Paste is shown. If you click the Cut item, it  will cut only a single cell. However, if you Copy , the entire row will be copied.

Workaround:

public class CustomGrid : RadGridView
{
    protected override RadGridViewElement CreateGridViewElement(
    {
        return new CustomRadGridViewElement();
    }

    public override string ThemeClassName
    {
        get
        {
            return typeof(RadGridView).FullName;
        }
    }
}

public class CustomRadGridViewElement : RadGridViewElement
{
    protected override MasterGridViewTemplate CreateTemplate()
    {
        return new CustomMasterGridViewTemplate();
    }

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

public class CustomMasterGridViewTemplate : MasterGridViewTempla
{
    public override void Cut()
    {
        this.BeginRowCopy();
        this.Copy();
        this.EndRowCopy();
        foreach (GridViewRowInfo row in this.SelectedRows)
        {
            foreach (GridViewCellInfo cell in row.Cells)
            {
                cell.Value = null;
            }
        }
    }
}
0 comments