예제 #1
0
    protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        Others.GridMouseOver(Session["ThemeChange"].ToString(), e);
        int Lower_Count = 0;

        LBL_GridStatus.Text = "Page(s): " + Convert.ToString(GridView1.PageIndex + 1) + "-" + GridView1.PageCount.ToString();
        if (GridView1.PageCount > 1)
        {
            DRP_LIST.Text = Convert.ToString(GridView1.PageIndex + 1);
        }

        if (GridView1.Rows.Count < 20)
        {
            LBL_RowStatus.Text = Convert.ToString((GridView1.PageIndex * Convert.ToInt16(Session["DEFAULT_ROWS"].ToString())) + GridView1.Rows.Count);
            Lower_Count        = ((GridView1.PageIndex * Convert.ToInt16(Session["DEFAULT_ROWS"].ToString())) + GridView1.Rows.Count) - (GridView1.Rows.Count + 1);
            Lower_Count        = Lower_Count + 2;
            LBL_RowStatus.Text = "Display Rows: " + Lower_Count.ToString() + "-" + LBL_RowStatus.Text;
        }
        else
        {
            LBL_RowStatus.Text = Convert.ToString((GridView1.PageIndex + 1) * Convert.ToInt16(GridView1.Rows.Count.ToString()));
            Lower_Count        = (GridView1.PageIndex + 1) * Convert.ToInt16(GridView1.Rows.Count.ToString()) - (GridView1.Rows.Count + 1);
            Lower_Count        = Lower_Count + 2;
            LBL_RowStatus.Text = "Display Rows: " + Lower_Count.ToString() + "-" + LBL_RowStatus.Text;
        }
        if (DRP_LIST.Items.Count == 0)
        {
            for (int A = 1; A <= GridView1.PageCount; A++)
            {
                DRP_LIST.Items.Add(A.ToString());
            }
        }
    }