ProgressBarElement Click event not work

9 posts, 0 answers
  1. Hadilionson
    Hadilionson avatar
    7 posts
    Member since:
    Dec 2011

    Posted 07 Jan 2014 Link to this post

    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
  2. Dimitar
    Admin
    Dimitar avatar
    2951 posts

    Posted 08 Jan 2014 Link to this post

    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 >>
  3. Hadilionson
    Hadilionson avatar
    7 posts
    Member since:
    Dec 2011

    Posted 09 Jan 2014 Link to this post

    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
  4. Dimitar
    Admin
    Dimitar avatar
    2951 posts

    Posted 09 Jan 2014 Link to this post

    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 >>
  5. Hadilionson
    Hadilionson avatar
    7 posts
    Member since:
    Dec 2011

    Posted 09 Jan 2014 Link to this post

    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
  6. Dimitar
    Admin
    Dimitar avatar
    2951 posts

    Posted 10 Jan 2014 Link to this post

    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 >>
  7. Hadilionson
    Hadilionson avatar
    7 posts
    Member since:
    Dec 2011

    Posted 10 Jan 2014 Link to this post

    Yes; you are right; but it doesn't work in my PC; the rad version is Q1 2011 and visual studio 2010
  8. Dimitar
    Admin
    Dimitar avatar
    2951 posts

    Posted 13 Jan 2014 Link to this post

    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 >>
  9. Hadilionson
    Hadilionson avatar
    7 posts
    Member since:
    Dec 2011

    Posted 13 Jan 2014 Link to this post

    thank you very much; your new solution works well
    Best Regards
Back to Top