private DataTable DT1() { DropDownList dropDownRepeat = new DropDownList(); DataTable dt = new DataTable(); dropDownRepeat.ID = "dlRepeat"; dropDownRepeat.AutoPostBack = true; //ListItem listItem = new ListItem(); //listItem.Text = "D"; //listItem.Value = "day"; //dropDownRepeat.Items.Insert(0, listItem); //listItem.Text = "M"; //listItem.Value = "month"; //dropDownRepeat.Items.Insert(1, listItem); //listItem.Text = "Y"; //listItem.Value = "year"; //dropDownRepeat.Items.Insert(2, listItem); dropDownRepeat.Items.Clear(); dropDownRepeat.DataTextField = "D"; dropDownRepeat.DataValueField = "dayly"; dropDownRepeat.DataTextField = "M"; dropDownRepeat.DataValueField = "month"; dropDownRepeat.DataTextField = "Y"; dropDownRepeat.DataValueField = "dayly"; if (!IsPostBack) { dropDownRepeat.SelectedIndex = 0; } dropDownRepeat.DataSource = dt; dropDownRepeat.DataBind(); dt.Columns.Add("Name"); dt.Columns.Add("Time"); dt.Columns.Add("Repeat"); DataRow dr = dt.NewRow(); dr["Name"] = "test1"; dr["Time"] = "test2"; dr["repeat"] = dropDownRepeat; dt.Rows.Add(dr); dr = dt.NewRow(); dr["Name"] = "test3"; dr["Time"] = "test4"; dr["Repeat"] = dropDownRepeat; dt.Rows.Add(dr); dtg.DataSource = dt; dtg.DataBind(); //GridView.DataSource = dt; //GridView.DataBind(); return dt; }
//*** CountryCode ***' DropDownList ddlCountryCode = (DropDownList)e.Row.FindControl("ddlEditCountryCode"); if ((ddlCountryCode != null)) { ddlCountryCode.DataSource = (DataTable)DataTableCountryCode(); ddlCountryCode.DataTextField = "CountryName"; ddlCountryCode.DataValueField = "CountryCode"; ddlCountryCode.DataBind(); ddlCountryCode.SelectedIndex = ddlCountryCode.Items.IndexOf(ddlCountryCode.Items.FindByValue((string)DataBinder.Eval(e.Row.DataItem, "CountryCode"))); }
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง