protected void Page_Load(object sender, EventArgs e) { DataTable dt = new tbl_SubTitleTableAdapter().GetData(); for (int i = 0; i < dt.Rows.Count; i++) { SubTitle = SubTitle + dt.Rows[i]["SB_Title"].ToString() + " "; } }
protected void GridView1_RowEditing(object sender, GridViewEditEventArgs e) { int ID = int.Parse(((Label)(GridView1.Rows[e.NewEditIndex].FindControl("lblID"))).Text); DataTable dt = new tbl_SubTitleTableAdapter().GetDataBySubTitle_ID(ID); if (dt.Rows.Count > 0) { TextTitle.Text = dt.Rows[0]["Sb_Title"].ToString(); } LblHidden.ToolTip = ID.ToString(); GridView1.SelectedIndex = e.NewEditIndex; }