This is a migrated thread and some comments may be shown as answers.

Custom RadGrid and skins / Special key press catch

2 Answers 118 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Court Philippe
Top achievements
Rank 1
Court Philippe asked on 23 Feb 2010, 11:54 AM

Hello,

I have togive a custom behaviour to a RadGridView on the Delete or Up/Down key press.

Unfortunately, the RadGrid KeyPress doesn’t risen by the special keys.

So the only way I find to catch those keys press is to override the IsInputkey function so tomake my own control witch extends from the telerik radGrid.

public class CtrlRadGrid : Telerik.WinControls.UI.RadGridView

    {

        public CtrlRadGrid()

            :base(){}

        public delegate void InputKeyEvent(Keys keyData);

        public event InputKeyEvent InputKeyOccurs = null;

        protected override bool IsInputKey(KeyskeyData)

        {

            if (InputKeyOccurs != null)

            {

InputKeyOccurs(keyData);

            }

            return base.IsInputKey(keyData);

        }

}

All works great, my event is raised by all the keys, and all the grid keep isfunctionality… except the skin…

I think that there must be a control on the name of the class…

So is there a simple way to apply the skin on my own control witch extends from radGrid?

Is there a simple way to catch the keyPress from special keys?

2 Answers, 1 is accepted

Sort by
0
Accepted
Jack
Telerik team
answered on 24 Feb 2010, 07:53 AM
Hi Court Philippe,

Yes, you have to override ThemeClassName property in this case. Please consider the sample below:

public class CtrlRadGrid : RadGridView
{
    public override string ThemeClassName
    {
        get { return typeof(RadGridView).FullName; }
        set {}
    }
}


All the best,
Jack
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Court Philippe
Top achievements
Rank 1
answered on 24 Feb 2010, 08:01 AM
Problem solved.
Thank you.

Philippe Court.
Tags
GridView
Asked by
Court Philippe
Top achievements
Rank 1
Answers by
Jack
Telerik team
Court Philippe
Top achievements
Rank 1
Share this question
or