background. I want to be able to hide or gray out a Select button for people that are Not employees. For employees the button should work and select them.
I have a select button I added using GridView tasks, Edit columns, but did not know how to hide it or gray it or other wise.
whihc aal works fine except I can't figure out how to name the button to hide it in the GridView3_RowDataBound procedure.
So I added another select button. but I found the only way to detect that button push was in the gridview_rowCommand.
So I have this code to try and get the row index but when pressing the new button there is no e.commandargument (get error) can't convert to string
If I use the original Select button there is a e.commandargument but I need to name the button for this code to work in the HTML markup?
Or maybe in the Gridview tasks?
So any ides how to gray it out or hide it.
hope all this makes sense.
TIA
I have a select button I added using GridView tasks, Edit columns, but did not know how to hide it or gray it or other wise.
whihc aal works fine except I can't figure out how to name the button to hide it in the GridView3_RowDataBound procedure.
So I added another select button. but I found the only way to detect that button push was in the gridview_rowCommand.
So I have this code to try and get the row index but when pressing the new button there is no e.commandargument (get error) can't convert to string
Code:
Private Sub GridView3_RowCommand(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewCommandEventArgs) Handles GridView3.RowCommand
[highlight #FCE94F]Dim index As Integer = Convert.ToInt32(e.CommandArgument)[/highlight] ' Error: Input string was not in a correct format.
Dim row As GridViewRow = GridView3.Rows(index)
Session("EnterpriseID") = HttpUtility.HtmlDecode(GridView3.Rows(index).Cells(2).Text)
...
' this code hides the second select button , which is named btnSelect, but how can I name the original Select button in the HTML markup?
Private Sub GridView3_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GridView3.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
If (DataBinder.Eval(e.Row.DataItem, "LegacyPersonType") <> "Employee") Then
e.Row.ForeColor = Drawing.Color.Black
e.Row.BackColor = Drawing.Color.Yellow ' This will make row back color yellow
e.Row.FindControl("btnSelect").Visible = False
Else
e.Row.ForeColor = Drawing.Color.Black
e.Row.BackColor = Drawing.Color.White ' the normal employees make white
End If
End If
Or maybe in the Gridview tasks?
So any ides how to gray it out or hide it.
hope all this makes sense.
TIA