예제 #1
0
        //Button to load data from Web, parse it to db and show it in GridView
        protected void btnFill_Click(object sender, EventArgs e)
        {
            DataOperation operation = new DataOperation();
            operation.ParseData();
            FillFilters();

            gvMain.DataSource = operation.ReadData();
            gvMain.DataBind();
        }
예제 #2
0
        //This method is used for display GridView in multipage mode
        protected void gvMain_PageIndexChanging(object sender, GridViewPageEventArgs e)
        {
            DataOperation table = new DataOperation();
            gvMain.DataSource = table.ReadData();

            gvMain.PageIndex = e.NewPageIndex;
            gvMain.DataBind();
        }
예제 #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                //Writing filters default value "Any" to session
                for (int i = 0; i < AMOUNT_OF_FILTERS; i++)
                {
                    Session[i.ToString()] = "Any";
                }

                //Writing calendar value to session
                DateTime dateToday = DateTime.Today;
                Session[CALENDAR] = dateToday.Day + DOT + dateToday.Month + DOT + dateToday.Year;

                FillFilters();
            }

            //Filling GridView
            DataOperation operation = new DataOperation();
            gvMain.DataSource = operation.ReadData();
            gvMain.DataBind();
        }
예제 #4
0
        //This method is used to sort GridView
        protected void gvMain_OnSorting(object sender, GridViewSortEventArgs e)
        {
            DataOperation table = new DataOperation();
            DataTable dataTable = table.ReadData();
            DataView dataView = new DataView(dataTable);

            dataView.Sort = e.SortExpression;
            gvMain.DataSource = dataView;
            gvMain.DataBind();
        }