title: Why is the Telerik RadGrid disappearing on PostBack?
body: <p>The Telerik DLL version for our project is 2012.3.1016.40</p>
  
  <p>We are using a Telerik RadGrid in one of our ASP.NET pages.  We bind the Telerik RadGrid to an ASP.NET DataTable Object.
  We also have an ASP.NET Button that Closes the page if it gets clicked.</p>
  
  <p>We invoke REST-based Web Service Methods, and populate an ASP.NET DataTable Object with the data returned.</p>
  
  <p>We bind the ASP.NET DataTable Object to a Telerik RadGrid.</p>
  
  <p>The ASP.NET DataTable Object is populated using OnNeedDataSource method.</p>
  
  <pre><code>protected void commentRadGrid_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
  {
          try
          {
  
               // The ViewStateThreadedDiscussion has a Type of ASP.NET DataTable.
               // Blah Blah Code That Populates the ViewStateThreadedDiscussion DataTable Blah Blah
  
               commentRadGrid.DataSource = new string[] { };
  
              if (ViewStateThreadedDiscussion == null)
              {
                  // Extremely Important to use empty string double quotes if
                  // the threadedDiscussionWithinDataTable DataTable is null because
                  // Telerik only works properly if you assign the Telerik RadGrid DataSource
                  // to an empty string with double quotes when we have a DataTable variable that is null.
                  // Never assign null to the Telerik RadGrid DataSource because Telerik DLL throws Error.
  
                 commentRadGrid.DataSource = "";
              }
              else
              {
                  commentRadGrid.DataSource = ViewStateThreadedDiscussion;
              }
  
  
  
          } // end of try
          catch (Exception ex)
          {
              log4NetInstance.Error(ex.Message);
              log4NetInstance.Error(ex.StackTrace);
              log4NetInstance.Error(ex.ToString());
          } // end of catch (Exception ex)
      } // end of protected void SharedWithRadGrid_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
  </code></pre>
  
  <p>I have a Telerik RadButton with an OnClick method specified.  Within the Telerik RadButton OnClick method, I invoke a Rebind on the Telerik RadGrid.  Here is the Telerik RadButton OnClick Method code:</p>
  
  <pre><code> protected void OlderCommentsButton_Click(object sender, EventArgs e)
      {
          try
          {
  
              commentRadGrid.Rebind();
          }
          catch (Exception ex)
          {
              log4NetInstance.Error(ex.Message);
              log4NetInstance.Error(ex.StackTrace);
              log4NetInstance.Error(ex.ToString());
          } // end of catch (Exception ex)
      } // end of protected void OlderCommentsButton_Click(object sender, EventArgs e)
  </code></pre>
  
  <p>Here is my declaration and configuration for Telerik RadGrid:</p>
  
  <pre><code>&lt;telerik:RadGrid runat="server" Width="60%" ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left" ItemStyle-VerticalAlign="Top"  HeaderStyle-Width="60%" ID="commentRadGrid" AllowFilteringByColumn="true" AutoGenerateColumns="false"
      AllowPaging="true" OnPageIndexChanged="commentRadGrid_PageIndexChanged"  OnNeedDataSource="commentRadGrid_NeedDataSource" PageSize="100" Skin="Default" AllowSorting="true" AutoPostBack="true" ShowStatusBar="true" AllowCustomPaging="True"
      GridLines="none"&gt;
  </code></pre>
  
  <p>I have Visual Studio 2012, and I run the application in debug mode with break points.  I used the "Add Watch" feature provided by Visual Studio 2012 on various variables like the ViewStateThreadedDiscussion ASP.NET DataTable, and the Telerik RadGrid DataSource property.  Everything seems to populated with the proper values even on Post Back.</p>
  
  <p>However, when the ASPX page loads on PostBack the
  Telerik RadGrid disappears.</p>
  
  <p>Why is the Telerik RadGrid disappearing on PostBack?</p>