M
Mel
I have a gridview that is bound to a datatable. Some rows require a
selection be chosen from a drop-down box, called "Pitch", other rows
do not require a pitch selection. How do I hide the drop-down for
those particular rows? An example would be greatly appreciated.
'My Example Code (using asp.net 2.0, vb.net, Visual Studio 2005 Pro)
Dim dt As DataTable
dt = New DataTable
dt.Columns.Add("Part Description", GetType(String))
dt.Columns.Add("Pitch", GetType(String))
Dim strUnivPartsSQL As String = "SELECT * FROM [Parts] ORDER BY [SN];"
Dim recStdParts As System.Data.OleDb.OleDbDataReader
Dim cmdPart As New System.Data.OleDb.OleDbCommand(strUnivPartsSQL,
conStdParts)
conStdParts.Open()
recStdParts = cmdPart.ExecuteReader()
Do While recStdParts.Read()
If recStdParts("Pitch") = True Then 'this part requires a pitch
selection
dt.Rows.Add(New String() {recStdParts("Part
Description").ToString, "4:12"}) 'set default pitch to 4:12
Else 'no pitch selection is necessary, HOW DO I HIDE THE PITCH DROP-
DOWN BOX? THIS CODE DOES NOT WORK, IT STILL SHOWS THE DROP-DOWN BOX.
dt.Rows.Add(New String() {recStdParts("Part
Description").ToString, Nothing})
End If
Loop
recStdParts.Close()
conStdParts.Close()
conStdParts.Dispose()
UpdatePanel2.Update()
selection be chosen from a drop-down box, called "Pitch", other rows
do not require a pitch selection. How do I hide the drop-down for
those particular rows? An example would be greatly appreciated.
'My Example Code (using asp.net 2.0, vb.net, Visual Studio 2005 Pro)
Dim dt As DataTable
dt = New DataTable
dt.Columns.Add("Part Description", GetType(String))
dt.Columns.Add("Pitch", GetType(String))
Dim strUnivPartsSQL As String = "SELECT * FROM [Parts] ORDER BY [SN];"
Dim recStdParts As System.Data.OleDb.OleDbDataReader
Dim cmdPart As New System.Data.OleDb.OleDbCommand(strUnivPartsSQL,
conStdParts)
conStdParts.Open()
recStdParts = cmdPart.ExecuteReader()
Do While recStdParts.Read()
If recStdParts("Pitch") = True Then 'this part requires a pitch
selection
dt.Rows.Add(New String() {recStdParts("Part
Description").ToString, "4:12"}) 'set default pitch to 4:12
Else 'no pitch selection is necessary, HOW DO I HIDE THE PITCH DROP-
DOWN BOX? THIS CODE DOES NOT WORK, IT STILL SHOWS THE DROP-DOWN BOX.
dt.Rows.Add(New String() {recStdParts("Part
Description").ToString, Nothing})
End If
Loop
recStdParts.Close()
conStdParts.Close()
conStdParts.Dispose()
UpdatePanel2.Update()