Data gets lost when I perform postback on grid

6 posts, 0 answers
  1. Hugo Aristizabal
    Hugo Aristizabal avatar
    22 posts
    Member since:
    Jan 2010

    Posted 08 Jul 2010 Link to this post

    Hi.

    I have a RadGrid on an ASP.NET page. When I do something that requieres a postback directly on the grid, like changing the page size, or browsing to a new page in the grid, my data gets lost and my grid becomes empty. Here's my markup:

    <telerik:RadGrid ID="ReporteGridView" runat="server" AllowPaging="True" PageSize="20"
        AllowAutomaticInserts="false" AllowSorting="True" ShowStatusBar="true" Width="880px">
        <ExportSettings ExportOnlyData="true" IgnorePaging="true" OpenInNewWindow="true" />
        <MasterTableView NoMasterRecordsText="No hay registros para mostrar" ShowHeadersWhenNoRecords="True"
            PageSize="20" CommandItemDisplay="None" Width="100%">
            <PagerStyle FirstPageToolTip="Primera página" LastPageToolTip="Ultima página" NextPagesToolTip="Página siguiente"
                PageSizeLabelText="Tamaño página" PrevPagesToolTip="Página anterior" />
            <RowIndicatorColumn>
                <HeaderStyle Width="20px"></HeaderStyle>
            </RowIndicatorColumn>
            <ExpandCollapseColumn>
                <HeaderStyle Width="20px"></HeaderStyle>
            </ExpandCollapseColumn>
        </MasterTableView>
        <ClientSettings>
            <Scrolling AllowScroll="true" UseStaticHeaders="True"></Scrolling>
        </ClientSettings>
    </telerik:RadGrid>

    I'm binding my grid to a DataTable at runtime. Is there something I'm missing?

    Thanks.

  2. Pavlina
    Admin
    Pavlina avatar
    5329 posts
    Member since:
    Sep 2012

    Posted 12 Jul 2010 Link to this post

    Hello Hugo,

    Could you please confirm that you are not binding the RadGrid control through simple data-binding calling DataBind()? You may take a look at the following article on suggested way to populate RadGrid when using CRUD operations:
    Advanced Data-binding (using NeedDataSource event)
       
    I hope this helps.

    Sincerely yours,
    Pavlina
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

  3. DevCraft Release
  4. Reza
    Reza avatar
    4 posts
    Member since:
    Jun 2012

    Posted 07 Jul 2012 Link to this post

    hi guys,
    i have same problem too, consider that i have a radiobuttonList on my radgrid, when a postback accure in radgrid , its value just gone and it returns the default value when page was loded. please help ...
    ohhh , i bind my data on NeedDatasource Event with setting radgrid data source on a list. here is my code :

    protected void RadGridCustomized1_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
            {
                HSECourseEOList list = Session[cachedEntity] as HSECourseEOList;
                RadGrid1.DataSource = list;
            }

    thanks .

  5. JJ
    JJ avatar
    20 posts
    Member since:
    Jul 2014

    Posted 24 Jul Link to this post

    Answer?

  6. LB
    LB avatar
    7 posts
    Member since:
    Aug 2008

    Posted 08 Oct Link to this post

    Is there still no answer for this?  I am having the same problem.

  7. Pavlina
    Admin
    Pavlina avatar
    5329 posts
    Member since:
    Sep 2012

    Posted 13 Oct Link to this post

    Hello,

    Could you send us the problematic code along with the related code behind so we can examine it?

    Regards,
    Pavlina
    Telerik

     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     

Back to Top
DevCraft Release