RadButton element Not firing for the First Time

4 posts, 0 answers
  1. Nagaraju
    Nagaraju avatar
    5 posts
    Member since:
    Jan 2012

    Posted 24 Jan 2012 Link to this post

    Hi, My requirement is to display the button in the Grid.So in the cellformatting i have added the below code to display button in the cell of the Grid.

    RadButtonElement

     

     

    radButtonElement = new RadButtonElement();

     

    radButtonElement .Click +=

     

    new EventHandler(radButtonElement _Click);

     

    e.CellElement.Children.Add(radButtonElement );

    The problem i am facing is when the Grid is getting filled it is displaying the Button in the Grid.But when i click on it for the first time it is not firing the radButtonElement _Click event. When i click second time it is firing.

    Could you suggest me how to fire the click element for the first time only.

  2. Ivan Petrov
    Admin
    Ivan Petrov avatar
    705 posts

    Posted 27 Jan 2012 Link to this post

    Hello Nagaraju,

    Thank you for writing.

    If you want to have a column with buttons, I would suggest that you use the GridViewCommandColumn. Its purpose is exactly to show a column with buttons and make it easy to handle the button click event. 

    I hope this will be useful for you. Should you have further questions I would be glad to assist.

    Kind regards,
    Ivan Petrov
    the Telerik team

    SP1 of Q3’11 of RadControls for WinForms is available for download (see what's new).

  3. Nagaraju
    Nagaraju avatar
    5 posts
    Member since:
    Jan 2012

    Posted 27 Jan 2012 Link to this post

    Hai Ivan,

    I have to display buttons in the columns based on the condition. For example in a column "X" if the cell value contains greater than 10 then i need to dsiplay a button beside the value in the cell. I dont want entire cell to be a button. Simlilary in other column "Y" if the value is greater than 100 i need to display the button beside the value in the cell.Lastly i need to display imagebutton in the column "Z". So i used  RadButtonElement, and RadImageButtonElement
    I am able to display the button but i need to click on the button twice to make the button fire.
    I hope U got the requirement. Can i do the same using the  GridViewCommandColumn


    Thanks
    Nagaraju.
  4. Ivan Petrov
    Admin
    Ivan Petrov avatar
    705 posts

    Posted 01 Feb 2012 Link to this post

    Hi Nagaraju,

    Thank you for your reply.

    The GridViewCommandColumn only contains a button and does not display text next to it. To achieve your scenario, you will have to create a custom column with custom cells. You can read more on that topic on our online documentation under - Creating custom cells. I have also attached a sample project which demonstrates this for your case.

    If you have any question on the example or the article, do not hesitate to write back. 

    Kind regards,
    Ivan Petrov
    the Telerik team

    SP1 of Q3’11 of RadControls for WinForms is available for download (see what's new).

Back to Top