Radgrid: Pager does not getting refreshed on item deletion..

8 posts, 0 answers
  1. Rekha
    Rekha avatar
    3 posts
    Member since:
    Oct 2008

    Posted 23 Dec 2008 Link to this post

    Hello,

    I am using DeleteCommand of radGrid to delete items from grid. Item gets removed on deletion but paging does not getting refreshed. Initailally my grid was containing 2 pages. I deleted all items from second page, still pager shows 2 page count.

    Here is the code,

    <

     

    telerik:RadGrid ID="RadGrid1" runat="server" AllowFilteringByColumn="True" AllowPaging="True"

     

     

    AllowSorting="True" AutoGenerateColumns="False" GridLines="Vertical" OnNeedDataSource="RadGrid1_NeedDataSource"

     

     

    OnItemDataBound="RadGrid1_ItemDataBound" Skin="WebBlue" AllowMultiRowEdit="True"

     

     

    OnDeleteCommand="RadGrid1_DeleteCommand" OnUpdateCommand="RadGrid1_UpdateCommand"

     

     

    OnItemCreated="RadGrid1_ItemCreated" Width="1200px" AutoGenerateEditColumn="True"

     

     

    OnItemCommand="RadGrid1_ItemCommand" AllowMultiRowSelection="True" AutoGenerateDeleteColumn="True"

     

     

    PageSize="22" AllowAutomaticDeletes="True" OnPageIndexChanged="RadGrid1_PageIndexChanged">

     

     

    <ExportSettings ExportOnlyData="True" IgnorePaging="True" OpenInNewWindow="True">

     

     

     

    <Pdf AllowAdd="false" AllowCopy="true" AllowModify="true" AllowPrinting="true" Author="Anonymous"

     

     

    Keywords="None" PageBottomMargin="1in" PageLeftMargin="10px" PageRightMargin="10px"

     

     

    PageTopMargin="1in" PageTitle="Admin Report" Subject="RadGrid Export" Title="RadGrid export"

     

     

    PaperSize="A4" PageWidth="800px" />

     

     

    </ExportSettings>

     

     

    <PagerStyle HorizontalAlign="Left" Mode="Slider" />

     

     

    <MasterTableView DataKeyNames="Fadder_ID,Referance_Id">

     

     

    <RowIndicatorColumn Visible="False">

     

     

    <HeaderStyle Width="20px"></HeaderStyle>

     

     

    </RowIndicatorColumn>

     

     

    <ExpandCollapseColumn Visible="False" Resizable="False">

     

     

    <HeaderStyle Width="20px"></HeaderStyle>

     

     

    </ExpandCollapseColumn>

     

     

    <Columns>

     

     

    <telerik:GridTemplateColumn UniqueName="Template1" HeaderText="ID" AllowFiltering="false">

     

     

    <HeaderStyle HorizontalAlign="Center" Width="20px" />

     

     

    <ItemTemplate>

     

    <%# this.RadGrid1.CurrentPageIndex * this.RadGrid1.PageSize + Container.ItemIndex + 1%>

     

     

    </ItemTemplate>

     

     

    </telerik:GridTemplateColumn>

     

     

    <telerik:GridBoundColumn DataField="Name" HeaderText="Avsender" UniqueName="FedderName"

     

     

    ReadOnly="True">

     

     

    <HeaderStyle HorizontalAlign="Center" Width="150px" />

     

     

    <ItemStyle HorizontalAlign="Left" />

     

     

    </telerik:GridBoundColumn>

     

    </

     

    Columns>

     

     

     

     

     

    <EditFormSettings>

     

     

     

     

     

    <PopUpSettings ScrollBars="None"></PopUpSettings>

     

     

     

     

     

    </EditFormSettings>

     

     

     

     

     

    </MasterTableView>

     

     

     

     

     

    <GroupingSettings CaseSensitive="False" />

     

     

     

     

     

    </telerik:RadGrid>

     

  2. Yavor
    Admin
    Yavor avatar
    11 posts

    Posted 29 Dec 2008 Link to this post

    Hi Rekha,

    Can you please also provide the code to populate the grid with data, as well as the code, which is used to actually delete a record?

    Kind regards,
    Yavor
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Rekha
    Rekha avatar
    3 posts
    Member since:
    Oct 2008

    Posted 01 Jan 2009 Link to this post

     

     

    protected

     

    void RadGrid1_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)

     

    {

    bindbride();

    }

     

    public void bindbride()

     

    {

    strConnection =

    ConfigurationSettings.AppSettings["MyConnection"];

     

     

    SqlConnection sqlConn;

     

     

    SqlCommand sqlCmdComapany;

     

    sqlConn =

    new SqlConnection(strConnection);

     

     

    string query = @"SELECT Fadder_Master.Fadder_ID, Fadder_Master.Name, Fadder_Master.Fadder_number, Fadder_Master.Mail_Id,

     

    Fadder_Master.Aktive_Status,Fadder_Master.Comments, Referance.Referance_Id,

    Referance.Fadder_number AS Fadder_number, Referance.Referred_name, Referance.Referred_mail,

    Referance.Aktive_Status AS Aktive_Status, Bilde.BildeName,

    Refered_mail_login =

    Case when Refered_mail_login = 1 then 'Confirmed'

    when Refered_mail_login = 0 then 'Unconfirmed' END

    FROM Fadder_Master LEFT OUTER JOIN

    Bilde ON Fadder_Master.Fadder_ID = Bilde.Fadder_ID RIGHT OUTER JOIN

    Referance ON Fadder_Master.Fadder_ID = Referance.Fadder_number

    WHERE (Referance.Aktive_Status = 0)

    group by Fadder_Master.Fadder_ID,Fadder_Master.Name, Fadder_Master.Fadder_number, Fadder_Master.Mail_Id,

    Fadder_Master.Aktive_Status,Fadder_Master.Comments, Referance.Referance_Id,Referance.Fadder_number,

    Referance.Referred_name, Referance.Referred_mail,

    Referance.Aktive_Status, Bilde.BildeName,Referance.Refered_mail_login

    ORDER BY Fadder_Master.Name"

     

    ;

     

     

    SqlConnection myConnection = new SqlConnection(strConnection);

     

     

    SqlDataAdapter ad = new SqlDataAdapter(query, myConnection);

     

    ds =

    new DataSet();

     

    ad.Fill(ds,

    "Categories");

     

    RadGrid1.DataSource = ds;

    SetRelavantFilters(RadGrid1);

    Label1.Text =

    "";

     

    Label1.Text =

    " Totalt resultat: " + "<b>" + ds.Tables[0].Rows.Count.ToString() + "</b>";

     

     

    if(ds.Tables[0].Rows.Count>0)

     

    {

    LinkButton1.Enabled =

    true;

     

    LinkButton2.Enabled =

    true;

     

    }

     

    else

     

     

     

     

    {

    LinkButton1.Enabled =

    false;

     

    LinkButton2.Enabled =

    false;

     

    }

    }

     

    protected

     

    void RadGrid1_DeleteCommand(object source, GridCommandEventArgs e)

     

    {

     

    GridEditableItem editedItem = e.Item as GridEditableItem;

     

     

    string Fadder_ID = editedItem.OwnerTableView.DataKeyValues[editedItem.ItemIndex]["Fadder_ID"].ToString();

     

     

    string Referance_Id = editedItem.OwnerTableView.DataKeyValues[editedItem.ItemIndex]["Referance_Id"].ToString();

     

    strConnection =

    ConfigurationSettings.AppSettings["MyConnection"];

     

     

    SqlConnection sqlConn;

     

     

    SqlCommand sqlCmdParticipants, sqlCmdComapany = null;

     

    sqlConn =

    new SqlConnection(strConnection);

     

     

    string Command = "update Referance set Aktive_status = 1 where Referance_Id='" + Referance_Id + "'";

     

    sqlCmdComapany =

    new SqlCommand(Command, sqlConn);

     

    sqlConn.Open();

    sqlCmdComapany.ExecuteNonQuery();

    sqlCmdComapany.Dispose();

    sqlConn.Close();

    }

  5. Rekha
    Rekha avatar
    3 posts
    Member since:
    Oct 2008

    Posted 01 Jan 2009 Link to this post

    One of my collegue is also facing problem in pager refreshing:

    http://cid-a38ba1c013b5d908.skydrive.live.com/self.aspx/ForForum/screen%20snaps%20for%20pager%20problem.JPG

    Above link is the snapshot of following problem description.
    Page is having 5 option button where we are displaying the radgid ibt the radajaxpannel on clicking on the SHOW button. Here at firt time the pageer in footer of the RadGrid show appropriate values but if we change the option button on the top to fetch the next report and when clicking on the SHOW buttton the data and the internal count on the table for row come ok, but the Previous result of the paging is displayed on the Radgrid.

    This above Problem observed  when the records of the search is higher than the previous less record the higher figure remain in the Paging though the next display result is having the less count of rows. Also if the next result is carring higher rows count then it will get display in the paging.
    Note:
    1. in some option result we are hiding and displaying the columns by visiable property.
    2. Is this the problem due to the Pannel is not full portback or any thing else.
    3. Also internally we are using static datatable but the dat in the table comes on though we are passing the Rows count to a custom usercontrol on top of the grid to display.

  6. Yavor
    Admin
    Yavor avatar
    11 posts

    Posted 07 Jan 2009 Link to this post

    Hello Rekha,

    I reviewed the code, and it looks correct.
    At this point, if the issue persists, please open a formal support ticket, where you can attach files, and send us a small working project, which demonstrates your logic, as well as the unwanted behavior.
    I will debug it locally, and get back to you with additional information.

    Sincerely yours,
    Yavor
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  7. Pravin
    Pravin avatar
    1 posts
    Member since:
    May 2007

    Posted 01 Jan 2010 Link to this post

    Hi Rekha

    Did you get any solution for this problem

    http://cid-a38ba1c013b5d908.skydrive.live.com/self.aspx/ForForum/screen%20snaps%20for%20pager%20problem.JPG

    I am facing the same problem.Please help its urgent.
  8. Yosief
    Yosief avatar
    26 posts
    Member since:
    Mar 2008

    Posted 18 Aug 2010 Link to this post


    Hello Ivor

    I have a similar problem to Rekha's where the paging of a RadGrid is not refreshing. If, for example, the first search returns 15 records and the second search 5 records, I see '... page 1 of 2...' in the second search which is incorrect info caused by the paging section of the grid not refreshing.

    Please help as soon as possible. Thank you!
    Yosief Kesete
  9. Iana Tsolova
    Admin
    Iana Tsolova avatar
    3388 posts

    Posted 20 Aug 2010 Link to this post

    Hi Yosief,

    Can you confirm that the delete procedure finished properly in your case?
    Also, are you using custom paging? Any additional information on your setup might help us to find the source of the problem in your case.

    Greetings,
    Iana
    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
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017