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

Custom trackbar editor value changed

5 Answers 18 Views
PropertyGrid
This is a migrated thread and some comments may be shown as answers.
Valery
Top achievements
Rank 1
Veteran
Valery asked on 03 Oct 2018, 04:55 AM

I override the BaseInputEditor with a trackbar editor (using code from Telerik website).

But when I change the position of the trackbar, the PropertyValueChanged event does not occur (radPropertyGrid)

What am I doing wrong?

5 Answers, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 03 Oct 2018, 09:44 AM
Hello Valery,

I was not able to reproduce the observed behavior on my end. For convenience, I prepared a small sample, based on the information that you provided so far and attached it to this thread. Could you please check it and let me know how it differs from your real setup? 

I am looking forward to your reply.

Regards,
Dimitar
Progress Telerik
Get quickly onboard and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Valery
Top achievements
Rank 1
Veteran
answered on 03 Oct 2018, 10:09 AM

I tried your example: if you move the trackball with the mouse, the event RadPropertyGrid1_PropertyValueChanged does not occur (message "PropertyChanged" is not shown).

Only when I turn to another item, this event occurs. I need this event to occur as the trackball moves

0
Dimitar
Telerik team
answered on 03 Oct 2018, 11:44 AM
Hello Valery,

The ValueChanged event should be fired changing the value in the editor. However, it does not fire when using a custom editor. This is why I have logged this issue on our Feedback Portal. You can track its progress, subscribe to status changes and add your comment to it here. I have also updated your Telerik Points.

Here is how to raise the event as a workaround: 
void TrackBarEditor_ValueChanged(object sender, EventArgs e)
{
    PropertyGridItemElement owner = this.OwnerElement as PropertyGridItemElement;
 
    if (owner != null)
    {
        var method = owner.PropertyTableElement.GetType().GetMethod("OnValueChanged", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance);
        method.Invoke(owner.PropertyTableElement, new object[] { this, EventArgs.Empty });
 
    }
}

Should you have any other questions do not hesitate to ask.

Regards,
Dimitar
Progress Telerik
Get quickly onboard and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Valery
Top achievements
Rank 1
Veteran
answered on 03 Oct 2018, 12:54 PM

This solution does not work for me.
I found my workaround:

 

private void TrackBarEditor_ValueChanged(object sender, EventArgs e)
{
if (!(this.OwnerElement is PropertyGridItemElement owner)) return;
if (!(owner.Data is PropertyGridItem data)) return;
data.Value = Value;
}

0
Dimitar
Telerik team
answered on 04 Oct 2018, 06:39 AM
Hello Valery,

This a valid solution and I cannot see a reason not to use it.

Do not hesitate to contact us if you have other questions.

Regards,
Dimitar
Progress Telerik
Get quickly onboard and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
PropertyGrid
Asked by
Valery
Top achievements
Rank 1
Veteran
Answers by
Dimitar
Telerik team
Valery
Top achievements
Rank 1
Veteran
Share this question
or