Problem with visibility command on button

3 posts, 0 answers
  1. Carina
    Carina avatar
    41 posts
    Member since:
    Nov 2012

    Posted 21 Jan 2013 Link to this post

    So I have a radgrid on a form. right before the radgrid aspx code starts, I have set the row property of visible = false (ex:
    <tr runat="server" id="rw1" visible="false">
    On my code behind (using VB.NET) I have set the btnShowGrid_Click event to this:
    rw1.visible = true
    btnHideGrid.visible = true
    The problem I am encountering is that I press this button for the first time on the form and it will only show the row, so I have to click it again to show the radgrid.
    When I click on the "Hide Grid" button, the row and grid hide, and then I click the "Show Grid" button again and everything is displayed, I dont need to click on it again.
    Why is this happening?

    By the way the radgrid visible property is set to true not false.
  2. Danail Vasilev
    Danail Vasilev avatar
    1502 posts

    Posted 23 Jan 2013 Link to this post

    Hi Carina,

    I was not able to reproduce your issue, as I do not have enough information about your case - which event handlers do you use and how, is your grid databound and how, etc. Nevertheless I have attached my VS test pages in the archive. Could you compare your actual page with mine and try to find the difference that is causing this problem? If you still cannot resolve the problem could you try to reproduce the issue with my sample, and if it is related to our products then send it back to us, so we can inspect it locally?

    What I can suggest as additional troubleshooting steps are the following:
    - make sure the grid is properly databound when you make it visible. If it does not have a proper datasource it cannot show data
    - if you are showing the control during an AJAX request the problem could be that it cannot register its skins (stylesheets go in the head section and it is not updated during a partial postbak). In that case you can try setting the grid's EnableAjaxSkinRendering property to true before making it visible.

    All the best,
    Danail Vasilev
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  3. Carina
    Carina avatar
    41 posts
    Member since:
    Nov 2012

    Posted 05 Feb 2013 Link to this post

    Thank you! 
    I had to do the Databind() in the pageload and it got fixed :)
Back to Top