This is a migrated thread and some comments may be shown as answers.

Data gets lost when I perform postback on grid

6 Answers 164 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Hugo Aristizabal
Top achievements
Rank 2
Hugo Aristizabal asked on 08 Jul 2010, 05:12 PM
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.

6 Answers, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 12 Jul 2010, 08:50 AM
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
0
Reza
Top achievements
Rank 1
answered on 07 Jul 2012, 07:50 AM
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 .
0
JJ
Top achievements
Rank 2
answered on 24 Jul 2014, 08:00 AM
Answer?
0
TRA
Top achievements
Rank 1
answered on 08 Oct 2014, 05:43 PM
Is there still no answer for this?  I am having the same problem.
0
Pavlina
Telerik team
answered on 13 Oct 2014, 06:23 PM
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.

 
0
Arash
Top achievements
Rank 1
answered on 07 Feb 2017, 12:41 PM

When I reorder grid columns , then data is lost and I need to refresh the page again or rebind 

 

any solutions?

Tags
Grid
Asked by
Hugo Aristizabal
Top achievements
Rank 2
Answers by
Pavlina
Telerik team
Reza
Top achievements
Rank 1
JJ
Top achievements
Rank 2
TRA
Top achievements
Rank 1
Arash
Top achievements
Rank 1
Share this question
or