Пример #1
0
    protected void btnbind_Click(object sender, ImageClickEventArgs e)
    {
        if (ddlOption.SelectedIndex != 0)
        {
            string condition = string.Empty;
            if (ddlOption.SelectedIndex == 1)
            {
                condition = "convert(" + ddlFieldName.SelectedValue + ",System.String)='" + txtValue.Text.Trim() + "'";
            }
            else if (ddlOption.SelectedIndex == 2)
            {
                condition = "convert(" + ddlFieldName.SelectedValue + ",System.String) Like '" + txtValue.Text.Trim() + "%'";
            }
            else
            {
                condition = "convert(" + ddlFieldName.SelectedValue + ",System.String) like '%" + txtValue.Text.Trim() + "%'";
            }
            DataView view = new DataView((DataTable)Session["DtProduct"], condition, "", DataViewRowState.CurrentRows);

            lblTotalRecord.Text = Resources.Attendance.Total_Records + " : " + (view.ToTable()).Rows.Count.ToString() + "";

            GridProduct.DataSource = view.ToTable();
            GridProduct.DataBind();
            Session["DtFilter"] = view.ToTable();

            btnbind.Focus();
        }
    }
 protected void GridProduct_PageIndexChanging(object sender, GridViewPageEventArgs e)
 {
     GridProduct.PageIndex  = e.NewPageIndex;
     GridProduct.DataSource = (DataTable)Session["DtFilter"];
     GridProduct.DataBind();
     AllPageCode();
     GridProduct.BottomPagerRow.Focus();
 }
Пример #3
0
    private void FillProductGrid()
    {
        DataTable dtproduct = ObjInvProductMaster.GetProductMasterTrueAll(StrCompId.ToString());

        GridProduct.DataSource = dtproduct;
        GridProduct.DataBind();
        Session["DtFilter"]  = dtproduct;
        Session["DtProduct"] = dtproduct;
        lblTotalRecord.Text  = Resources.Attendance.Total_Records + " : " + dtproduct.Rows.Count;
    }
    private void FillProductGrid()
    {
        DataTable dtproduct = new DataView(ObjInvProductMaster.GetProductMasterTrueAll(StrCompId.ToString()), "ItemType='A' or ItemType='K' ", "", DataViewRowState.CurrentRows).ToTable();

        GridProduct.DataSource = dtproduct;
        GridProduct.DataBind();
        Session["DtProduct"] = dtproduct;
        Session["DtFilter"]  = dtproduct;
        lblTotalRecord.Text  = Resources.Attendance.Total_Records + " : " + dtproduct.Rows.Count;
        AllPageCode();
    }
Пример #5
0
 protected void DetailsView1_itemUpdated(object sender, DetailsViewUpdatedEventArgs e)
 {
     GridProduct.DataBind();
 }
Пример #6
0
 protected void GridProduct_PageIndexChanging(object sender, GridViewPageEventArgs e)
 {
     GridProduct.DataSource = (DataTable)Session["DtFilter"];
     GridProduct.DataBind();
     GridProduct.Focus();
 }