PDA

View Full Version : سوال: پيمايش در سطرهاي يك گريد



mohitlog
دوشنبه 06 اردیبهشت 1389, 23:11 عصر
سلام

چجوری میشه توی for each در vb.net سطر های گرید را پیمایش کرد؟



foreach (GridViewRow dr in GridView1.Rows)
foreach (TableCell cel in dr.Cells)
Response.Write(dr.Cells[0].ToString




یک چیزی مثل بالا توی asp.net

sahele_sheni
سه شنبه 07 اردیبهشت 1389, 07:52 صبح
For dr_counter As Integer = 0 To DataGridView1.Rows.Count-1
MsgBox(DataGridView1.Rows(dr_counter).Cells(0).Val ue)
MsgBox(DataGridView1.Rows(dr_counter).Cells(1).Val ue)
MsgBox(DataGridView1.Rows(dr_counter).Cells(2).Val ue)
Next

موفق باشید

mohitlog
سه شنبه 07 اردیبهشت 1389, 21:14 عصر
حالا اگر توی هر سطر گرید یک کنترل ( مثلا تکست باکس ) داتشه باشم چطور میتونم محتویاتی رو که کاربر وارد کرده رو بخونم؟