我目前在 ASP.NET VB 中有一个 Gridview,您可以在其中选择一行,然后将数据传输到下一页以供输入。我的问题是有一种简单的方法可以在某人在同一天输入该行的信息后突出显示该行。因此,如果有人今天为某人输入数据,那么明天突出显示将在下一个日历日消失。我很感激任何帮助。
这是我目前拥有的。
Public Sub Get_GV()
' Fills Gridview with data selected from dropdown-area
DSADT.SelectParameters("Area").DefaultValue = DDArea.SelectedValue
Dim dv As DataView = DSconnect.Select(DataSourceSelectArguments.Empty)
GridView1.DataSource = dv
GridView1.DataBind()
End Sub
Private Sub GridView1_RowCreated(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GridView1.RowCreated
' Allows you to "select"/Highlight a row without a select button
If e.Row.RowType = DataControlRowType.DataRow Then
e.Row.Attributes("onmouseover") = "this.style.cursor='pointer';this.style.backgroundColor = '#87CEFF';"
e.Row.Attributes("onmouseout") = "this.style.textDecoration='none';this.style.backgroundColor = '#FFFFFF';"
e.Row.Attributes("OnClick") = Me.Page.ClientScript.GetPostBackClientHyperlink(Me.GridView1, "Select$" & e.Row.RowIndex)
End If
End Sub
Protected Sub GridView1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles GridView1.SelectedIndexChanged
Dim sb As New System.Text.StringBuilder()
'Submits data to next page
Response.Redirect("RoundingEntry.aspx?Room=" & GridView1.SelectedRow.Cells(1).Text & "&Name=" & GridView1.SelectedRow.Cells(2).Text & "&Rounder=" & DDRounder.SelectedValue & "&Area=" & DDArea.SelectedValue)
End Sub