Beispiel #1
0
        protected void BindGridWithSort()
        {
            recordId = Convert.ToInt32(ddlLkLookupViewname.SelectedValue.ToString() == "" || ddlLkLookupViewname.SelectedValue.ToString() == "NA" ? "0" : ddlLkLookupViewname.SelectedValue.ToString());

            DataTable dt = new DataTable();

            if (ddlLkLookupViewname.SelectedIndex == 0)
            {
                dt = LookupMaintenanceData.GetLkLookupDetails(0, cbActiveOnly.Checked);
            }
            else
            {
                dt = LookupMaintenanceData.GetLkLookupDetails(recordId, cbActiveOnly.Checked);
            }

            SortDireaction = CommonHelper.GridSorting(gvLookup, dt, SortExpression, SortDireaction != "" ? ViewState["SortDireaction"].ToString() : SortDireaction);
        }
Beispiel #2
0
        protected void BindLookupMaintenance()
        {
            try
            {
                recordId = Convert.ToInt32(ddlLkLookupViewname.SelectedValue.ToString() == "" || ddlLkLookupViewname.SelectedValue.ToString() == "NA" ? "0" : ddlLkLookupViewname.SelectedValue.ToString());
                if (ddlLkLookupViewname.SelectedIndex == 0 || recordId == 0)
                {
                    gvLookup.DataSource = LookupMaintenanceData.GetLkLookupDetails(0, cbActiveOnly.Checked);
                }
                else
                {
                    gvLookup.DataSource = LookupMaintenanceData.GetLkLookupDetails(recordId, cbActiveOnly.Checked);
                }

                gvLookup.DataBind();
            }
            catch (Exception ex)
            {
                lblErrorMsg.Text = ex.Message;
            }
        }