title: Telerik RadGrid Visible Property Not Working as Expected
body: <p>I have two image buttons that hide and show a radgrid depending on what the client wants to see. When a button is clicked, the grid.visible property is set to true or false. The problem is that when I click the button the first time, the page posts back and does not work. Then I click a couple more times, and it shows only a horizontal line (I assume it is the grid not databound). I click a few more times and the grid shows and hides perfectly. However, when the user navigates away from the page and then comes back to this page, I get the same problem.</p>
  
  <p>Any help would be appreciated.</p>
  
  <p>.aspx<br>
          
                  
                  
                  
              </p>
  
  <pre><code>        &lt;div class="RegistrationHistoryGrid" &gt;
              &lt;telerik:RadGrid ID="rgRegistrationHistory" Width="100%"  ShowHeader="true" AutoGenerateColumns="false" OnSelectedIndexChanged="rgRegistrationHistory_SelectedIndexChanged" AllowCustomPaging="true" AllowSorting="True" AllowPaging="True" PageSize="10" runat="server" Gridlines="None" CellSpacing="0" onneeddatasource="rgRegistrationHistory_OnNeedDataSource" &gt;
                  &lt;ClientSettings AllowColumnsReorder="True" ReorderColumnsOnClient="True" EnableRowHoverStyle="true" EnablePostBackOnRowClick="true"&gt;
                      &lt;Selecting AllowRowSelect="True" /&gt;
                  &lt;/ClientSettings&gt;
                  &lt;MasterTableView Width="100%" Summary="RadGrid table" DataKeyNames="ClientID, LastName, FirstName, Gender,DateOfBirth,Address"&gt;
                  &lt;Columns&gt;
                      &lt;telerik:GridBoundColumn HeaderText="Period" Reorderable="false" UniqueName="Period"  DataField="Period"/&gt;
                      &lt;telerik:GridBoundColumn HeaderText="Plate" Reorderable="false" UniqueName="Plate"  DataField="Plate"/&gt;
                      &lt;telerik:GridBoundColumn HeaderText="Comment" Reorderable="false" UniqueName="Comment"  DataField="Comment"/&gt;
                          &lt;/Columns&gt;
                  &lt;SortExpressions&gt;
                      &lt;telerik:GridSortExpression FieldName="LastName" SortOrder="Ascending" /&gt;
                  &lt;/SortExpressions&gt;
              &lt;/MasterTableView&gt;
                  &lt;PagerStyle Mode="NextPrevAndNumeric" /&gt;
                  &lt;FilterMenu EnableImageSprites="False"&gt;&lt;/FilterMenu&gt;
                  &lt;HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default"&gt;&lt;/HeaderContextMenu&gt;
                  &lt;/telerik:RadGrid&gt;
          &lt;/div&gt;
  </code></pre>
  
  <p>.cs</p>
  
  <pre><code>protected void rgRegistrationHistory_OnNeedDataSource(object sender, GridNeedDataSourceEventArgs e)
  {
      List&lt;int&gt; fakeList = new List&lt;int&gt;();
      rgRegistrationHistory.DataSource = fakeList;
  }
  
  protected void imgChevronClosed_Click(object sender, ImageClickEventArgs e)
  {
      imgChevronOpen.Visible = true;
      imgChevronClosed.Visible = false;
      rgRegistrationHistory.Visible = false;
  
  }
  protected void imgChevronOpen_Click(object sender, ImageClickEventArgs e)
  {
      imgChevronOpen.Visible = false;
      imgChevronClosed.Visible = true;
      rgRegistrationHistory.Visible = true;
  }
  </code></pre>