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

ProgressBarElement Click event not work

8 Answers 29 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Hadilionson
Top achievements
Rank 1
Hadilionson asked on 07 Jan 2014, 04:25 PM
hi sir/madam

I have a problem with using Progressbarelement in gridview; according your trainmen we can add progressbar to cells by cellformatting but when I create a click event for the Progressbarelement ; it's not fire; also I check MousDown and ...

But when use radbuttonelement there is no problem and fire well;

private void radGridView1_CellFormatting(object sender, CellFormattingEventArgs e)
    {
    .
    .
    .
 
    RadProgressBarElement ProgressBarOne = new RadProgressBarElement();
    ProgressBarOne.Click += new EventHandler(ProgressBarOne_Click);
    .
    .
    }
    void ProgressBarOne_Click(object sender, EventArgs e)
    {
        MessageBox.Show("somethings");
    }


thank you for helping

8 Answers, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 08 Jan 2014, 03:41 PM
Hi Hadilionson,

Your question has already been answered in the other thread you've opened. 

We kindly ask you to use just one support channel to contact us. Posting the same questions numerous times slows down our response time because we will need to review and address two or more tickets instead of one. Moreover threads are handled according to license and time of posting, so if it is an urgent problem, we suggest you use a support ticket, which would be handled before a forum thread.

However I am including the answer here in order the community to benefit from it:
Better approach for this case will be to use custom ProgressBarColumn. Then you can either subscribe to the Click event in the ProgressBarCellElement class or use the grid's CellClicked event to execute you code when such cell is clicked (you can use this event also when you are adding the progress bar element in CellFormatting event). Sample implementation of this approach is available in the attached project.

Thank you for your understanding.

Regards,
Dimitar
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WINFORMS.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Hadilionson
Top achievements
Rank 1
answered on 09 Jan 2014, 07:14 AM
Thank you very much for helping; I am sorry about the problem; unfortunately when I  saw have created two posts; I couldn't find how to deleted it; 

I use Visual Studio 2010 and can't open the attached solution; but I will apply your benefit link;

best regards
hadi
0
Dimitar
Telerik team
answered on 09 Jan 2014, 01:02 PM
Hello Hadilionson,

Thank you for writing back.

Although you should be able to open the project with Visual Studio 2010 without any problems, you can open the project file rather the solution one instead (see attached screenshot) or you can use one of the solutions provided in the following discussion: c# - Visual Studio 2012 project won't open in 2010 

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

Regards,
Dimitar
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WINFORMS.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Hadilionson
Top achievements
Rank 1
answered on 09 Jan 2014, 02:10 PM
thank you;
I open your solution; but when I click on any of the progressbar column cell don't fire; unless click on the margin of cell that isn't overlapped by progressbarelement. that don't vary with adding progressbar in cellformatting

best regards
hadi
0
Dimitar
Telerik team
answered on 10 Jan 2014, 11:35 AM
Hi Hadilionson,

Thank you for writing back.

This is working as expected on my side (see attached video). This is why I kindly ask you to specify what is the exact version of our controls that you are using.

Thank you in advance for your patience and cooperation. 

Regards,
Dimitar
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WINFORMS.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Hadilionson
Top achievements
Rank 1
answered on 11 Jan 2014, 05:57 AM
Yes; you are right; but it doesn't work in my PC; the rad version is Q1 2011 and visual studio 2010
0
Dimitar
Telerik team
answered on 13 Jan 2014, 03:10 PM
Hello Hadilionson,

Thank you for writing back.

I can confirm that the previous solution does not behave as expected with the version of our controls that you have specified. I have recreated the sample project where I am have subscribed to the RadProgressBarElement TextElement click event in order to achieve the same effect with this version:
protected override void CreateChildElements()
{
    base.CreateChildElements();
 
    radProgressBarElement = new RadProgressBarElement();
    radProgressBarElement.TextElement.Click += radProgressBarElement_Click;
 
    this.Children.Add(radProgressBarElement);
}
 
void radProgressBarElement_Click(object sender, EventArgs e)
{
    if (this.RowIndex >= 0)
    {
        RadMessageBox.Show(string.Format("Row {0} clicked", this.RowIndex));
    }
}

Also I have attached the complete project.

Please let me know if there is something else I can help you with. 

Regards,
Dimitar
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WINFORMS.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Hadilionson
Top achievements
Rank 1
answered on 14 Jan 2014, 05:59 AM
thank you very much; your new solution works well
Best Regards
Tags
GridView
Asked by
Hadilionson
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Hadilionson
Top achievements
Rank 1
Share this question
or