Populate RadToolBarDropDown Text

2 posts, 1 answers
  1. Robert
    Robert  avatar
    68 posts
    Member since:
    Feb 2009

    Posted 10 Feb 2012 Link to this post

    I'm working with the RadToolBarDropDown control, and the goal is to populate the text of the RadToolBarDropDown dynamically in C#;

    The RadToolBarDropDown is encapsulated in a RadToolBar;

    Is it best to place the below code in a "if (!IsPostBack)" section : 

    RadToolBarDropDown rbViewReport = (RadToolBarDropDown)RadToolBar4.FindItemByText("Please Select");
    rbViewReport.Text = RetrievedValueConfirm;
  2. Answer
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 13 Feb 2012 Link to this post


    Best approach is using "if (!IsPostBack)" in page load. The main advantage of this is it gets a value indicating whether the page is being loaded in response to a client postback, or if it is being loaded and accessed for the first time. Otherwise it will execute the same code in every postback.

  3. DevCraft R3 2016 release webinar banner
Back to Top