Grid disappearing after Postback

2 posts, 0 answers
    THADDEUS avatar
    4 posts
    Member since:
    Apr 2016

    Posted 17 Aug 2016 Link to this post

    I am using a grid with a combobox and a button to save the checked values from the Grid..

    When I click the save button the Grid no longer shows up after post back.

    I am using the [radgridHardware_NeedDataSource[ and the functionality was working fine when I used the AutoGenerateColumns=true, but once I changed to use the GridBoundColumn the Grid does not work....  

    I have tried all the suggestions on a google search (please see below)   Any help would be really appreciated


    radgridHardware.DataSource = Nothing






    <div id="leftPanel">
    <telerik:RadGrid ID="radgridHardware" runat="server" AllowMultiRowSelection="true"
    AllowSorting="True" GridLines="None" AutoGenerateColumns="false"
    AllowPaging="True" Skin="Sunset"
    <telerik:GridClientSelectColumn UniqueName="hardwareSelectColumn" HeaderText="Assign"></telerik:GridClientSelectColumn>
    <telerik:GridBoundColumn DataField="RawID" Visible="true" HeaderText="ID" UniqueName="RawID"></telerik:GridBoundColumn>
    <telerik:GridBoundColumn DataField="Vendor" Visible="true" HeaderText="Vendor" UniqueName="Vendor"></telerik:GridBoundColumn>
    <telerik:GridBoundColumn DataField="Model" Visible="true" HeaderText="Model" UniqueName="Model"></telerik:GridBoundColumn>
    <telerik:GridBoundColumn DataField="Product" Visible="true" HeaderText="Product" UniqueName="Product"></telerik:GridBoundColumn>
    <PagerStyle Mode="NumericPages"></PagerStyle>
    <ClientSettings EnableRowHoverStyle="true">
    <Selecting AllowRowSelect="True"></Selecting>


  2. Viktor Tachev
    Viktor Tachev avatar
    2495 posts

    Posted 22 Aug 2016 Link to this post


    I examined the provided code and noticed that you are using DataBind() to bind the grid. Note that this method is used only for simple data binding. As the name implies this type of binding is suitable only for the most simple scenarios.

    It is recommended to use the NeedDataSource event to provide data for RadGrid. The grid will raise the event automatically when it needs to retrieve its data. Thus, you would not need to manually provide the data.

    Check out the following resources that illustrate how you can bind the grid via NeedDataSource. Give the approach a try and see how it works for you.

    Viktor Tachev
    Telerik by Progress
    Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Back to Top