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

HIde Paging from Create/Update screen

2 Answers 23 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Prachi
Top achievements
Rank 1
Prachi asked on 07 Aug 2012, 11:41 PM
Hi,

In my grid I have paging enabled but I want to hide the page numbers to be shown from Create/update screen.
In create/ Update screen I am already hiding the list of records as follows:
protected void rgTest_PreRender(object sender, System.EventArgs e)
       {
           //Hide All Rows on insert and Display the insert Form Only
           if (rgTest.MasterTableView.IsItemInserted)
           {
               foreach (GridItem item in rgTest.Items)
               {
                   item.Visible = false;
               }
           }
           //Hide All Rows on edit and Display the edit Form Only
           else if (rgTest.EditItems.Count > 0)
           {
               foreach (GridDataItem item inrgTest.MasterTableView.Items)
               {
                   if (item != rgTest.EditItems[0])
                   {
                       item.Visible = false;
                   }
               }
           }
       }

2 Answers, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 2
answered on 08 Aug 2012, 04:46 AM
Hi Prachi,

Try setting AllowPaging to 'false' while in edit and insert mode.

C#:
protected void rgTest_PreRender(object sender, System.EventArgs e)
{
    if (rgTest.MasterTableView.IsItemInserted)
    {
        rgTest.AllowPaging = false; //setting paging to false
        rgTest.Rebind();
        foreach (GridItem item in rgTest.Items)
        {
            item.Visible = false;
        }
    }
     
    else if (rgTest.EditItems.Count > 0)
    {
        rgTest.AllowPaging = false; //setting paging to false
        rgTest.Rebind();
        foreach (GridDataItem item inrgTest.MasterTableView.Items)
        {
            if (item != rgTest.EditItems[0])
            {
                item.Visible = false;
            }
        }
    }
    else
    {
        rgTest.AllowPaging = true; //setting paging to true in view mode
        rgTest.Rebind();
    }
}

Thanks,
Shinu.
0
Prachi
Top achievements
Rank 1
answered on 08 Aug 2012, 08:26 PM
Thanks Shinu.
This is working fine.

Tags
Grid
Asked by
Prachi
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Prachi
Top achievements
Rank 1
Share this question
or