我在网格中放了两个文本字段。一个是日历,在文本字段之外我放了日历按钮。这是问题所在:
网格线包含600行。例如,如果我在选择日历图像后选择第200或第300行,它将向上移动...这意味着光标位置将移动到第1到第50行。我该如何解决?因此,如果我选择100 200处的图像,它将向上移动到另一侧,然后选择日期。
这是我点击图片按钮时的代码:
Protected Sub ImageButton1_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs)
Dim Cnt, Rowcnt As Integer
Rowcnt = Gridview1.Rows.Count
Dim rowindex As Integer = Convert.ToInt32(Gridview1.SelectedRow)
Dim gvr As GridViewRow = Gridview1.Rows(rowindex)
Dim btnEdit As ImageButton = TryCast(sender, ImageButton)
Dim row As GridViewRow = DirectCast(btnEdit.NamingContainer, GridViewRow)
Dim introwindex As Integer
introwindex = row.RowIndex
For Cnt = 0 To Rowcnt
If (Cnt = introwindex) Then
cal1 = DirectCast(Gridview1.Rows(Cnt).FindControl(("Calendar1")), Calendar)
cal1.Visible = True
Exit For
End If
Next
End Sub