コード例 #1
0
        private void FillDataInGrid()
        {
            string             Status         = ddlStatus.SelectedValue;
            MediaTypes         media_type_obj = new MediaTypes();
            List <Media_Types> lst            = media_type_obj.GetListByStatus(Status);

            //if (lst.Rows.Count > 0)
            //{
            GridView1.DataSource = lst;
            GridView1.DataBind();

            //}
            //else
            //{
            //    dt.Rows.Add(dt.NewRow());
            //    GridView1.DataSource = dt;
            //    GridView1.DataBind();

            //    int TotalColumns = GridView1.Rows[0].Cells.Count;
            //    GridView1.Rows[0].Cells.Clear();
            //    GridView1.Rows[0].Cells.Add(new TableCell());
            //    GridView1.Rows[0].Cells[0].ColumnSpan = TotalColumns;
            //    GridView1.Rows[0].Cells[0].Text = "No Record Found";
            //}
        }
コード例 #2
0
        protected void PopulateMediaTypeList2DDL()
        {
            MediaTypes         media_type_obj = new MediaTypes();
            List <Media_Types> lst            = media_type_obj.GetListByStatus("1");

            ddlMediaTypeList.Items.Clear();
            ddlMediaTypeList.DataSource     = lst;
            ddlMediaTypeList.DataTextField  = "TypeName";
            ddlMediaTypeList.DataValueField = "TypeId";
            ddlMediaTypeList.DataBind();
            ddlMediaTypeList.AutoPostBack = true;
        }
コード例 #3
0
        protected void PopulateMediaTypeList2DDL(string selected_value)
        {
            MediaTypes         media_type_obj = new MediaTypes();
            List <Media_Types> lst            = media_type_obj.GetListByStatus("1");

            ddlMediaTypeList.Items.Clear();
            ddlMediaTypeList.DataSource     = lst;
            ddlMediaTypeList.DataTextField  = "TypeName";
            ddlMediaTypeList.DataValueField = "TypeId";
            ddlMediaTypeList.DataBind();
            ddlMediaTypeList.SelectedValue = selected_value;
            ddlMediaTypeList.Enabled       = false;
        }