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"; //} }
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; }
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; }