please tell me on this
<asp:GridView ID="gvDataBig" CssClass="mGrid" AlternatingRowStyle-CssClass="alt" DataKeyNames="SH_ID" Width="100%" Height="100%" runat="server" AutoGenerateColumns="False" >
<HeaderStyle />
<AlternatingRowStyle />
<columns>
<asp:BoundField DataField="SH_TIMEBAND" HeaderText="Timeband" ItemStyle-HorizontalAlign="Left" ItemStyle-Wrap="true" HeaderStyle-HorizontalAlign="Center" />
<asp:BoundField DataField="SH_NAME" HeaderText="ProgramName" ItemStyle-HorizontalAlign="Left" ItemStyle-Wrap="true" />
<asp:TemplateField HeaderText="dd" ItemStyle-Width="25px">
<ItemTemplate>
<asp:DropDownList ID="cmbShowName" Width="225px" AutoPostBack="True" OnSelectedIndexChanged="DropDown_SelectedIndexChanged" runat="server" CssClass="form-control">
</asp:DropDownList>
</ItemTemplate>
</asp:TemplateField>
</columns>
</asp:GridView>
Protected Sub gvDataBig_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles gvDataBig.RowDataBound
Select Case e.Row.RowType
Case DataControlRowType.DataRow
'e.Row.Attributes.Add("onclick", Page.ClientScript.GetPostBackEventReference(sender, "Select$" + e.Row.RowIndex.ToString))
Dim cmbShowName As DropDownList
cmbShowName = CType(e.Row.FindControl("cmbShowName"), DropDownList)
If myConnection.State = ConnectionState.Closed Then
myConnection.Open()
End If
SQL = "SELECT * FROM TICKER_SHOWNAME WHERE SH_TYPE='DATA_ENTRY' ORDER BY SH_NAME"
myCommand = New SqlCommand(SQL, myConnection)
myReader = myCommand.ExecuteReader()
Dim newListItem As ListItem
Do While myReader.Read()
newListItem = New ListItem
newListItem.Text = myReader.GetValue(myReader.GetOrdinal("SH_NAME"))
newListItem.Value = myReader.GetValue(myReader.GetOrdinal("SH_NAME"))
cmbShowName.Items.Add(newListItem)
Loop
myReader.Close()
Dim d As DataRowView = e.Row.DataItem()
'Dim statusCell As TableCell = e.Row.Cells(10)
'If d("RP_ACTIVE").ToString = "True" Then
' chkActive.Checked = True
' e.Row.Cells(1).Font.Bold = True
' e.Row.Cells(2).Font.Bold = True
' e.Row.Cells(3).Font.Bold = True
' e.Row.Cells(0).BackColor = Drawing.Color.LightGreen
' e.Row.Cells(1).BackColor = Drawing.Color.LightGreen
' e.Row.Cells(2).BackColor = Drawing.Color.LightGreen
' e.Row.Cells(3).BackColor = Drawing.Color.LightGreen
' iCountActive = iCountActive + 1
'Else
' chkActive.Checked = False
' e.Row.Cells(1).Font.Bold = False
' e.Row.Cells(2).Font.Bold = False
' e.Row.Cells(3).Font.Bold = False
'End If
End Select
End Sub
Public Sub DropDown_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs)
Dim ddllist As DropDownList = CType(sender, DropDownList)
Dim cell As TableCell = CType(ddllist.Parent, TableCell)
Dim item As DataGridItem = CType(cell.Parent, DataGridItem)
Dim ddlType As DropDownList = CType(item.Cells(0).FindControl("cmbShowName"), DropDownList)
Dim abcd As String = ""
abcd = ddlType.SelectedItem.Text & " - " & ddlType.SelectedItem.Value
abcd = cmbShowName.FindControl.text
If myConnection.State = ConnectionState.Closed Then
myConnection.Open()
End If
If myBKPConnection.State = ConnectionState.Closed Then
myBKPConnection.Open()
End If
Try
myCommand = New SqlCommand
myCommand.Connection = myConnection
Catch ex As Exception
End Try
Try
myBKPCommand = New SqlCommand
myBKPCommand.Connection = myBKPConnection
Catch ex As Exception
End Try
'cmbShowName.SelectedItem.Text()
'txtSky_A.Text = cmbShowName.SelectedItem.Text
SQL = "UPDATE TICKER_SHOWNAME SET SH_NAME='" & fixQuotes(ddlType.SelectedItem.Text) & "' WHERE SH_NAME='" & ddlType.SelectedItem.Text & "'"
Try
myCommand.CommandText = SQL
myCommand.ExecuteNonQuery()
Catch ex As Exception
End Try
Try
myBKPCommand.CommandText = SQL
myBKPCommand.ExecuteNonQuery()
Catch ex As Exception
End Try
End Sub