Gridview içindeki Textbox’dan veri okuma
5 Şubat 2022 / 10:02
Burak
Merhabalar,
Gridview içindeki textboxlardan veri okumak isterseniz herhangi bir event’a aşağıdaki kodları yazabilirsiniz.
1 2 3 4 5 6 7 8 |
foreach (GridViewRow row in Gridview1.Rows) { if (row.RowType == DataControlRowType.DataRow) { TextBox textBox = row.FindControl("TextBox1") as TextBox; sonuc_ltr.Text += textBox.Text; } } |
Ayrıca ek olarak ” RowUpdating ” eventında aşağıdaki koduda kullanabilirsiniz.
1 2 |
GridViewRow row = urunler_gv.Rows[e.RowIndex]; string id = ((TextBox)row.Cells[2].Controls[0]).Text; |
Etiketler: Get Value of TextBox inside the GridView, Gridview içindeki bileşene erişme, Gridview textbox okuma
Bu Yazılarıda Okuyabilirsiniz...
Bir cevap yazın