hi guys, I have a datagrid.Its 1st column is ClientType.On clicking each cell in the first column i.e ClientType,that value is shown in textbox named txtClientType.For that i used the following code.
Private Sub dtGridsearch_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs) Handles dtGridsearch.ItemDataBound
Dim lt As ListItemType = e.Item.ItemType
If lt = ListItemType.Item Or lt = ListItemType.AlternatingItem Then
Dim currentCell As TableCell = CType(e.Item.Controls(0), TableCell)
dtGridsearch.Columns(0).InitializeCell(currentCell, 0, ListItemType.Item)
Dim s As New System.Web.UI.WebControls.Style
s.CssClass = "Hyp"
Dim str As String = CType(e.Item.DataItem, DataRowView).Row(1)
currentCell.ApplyStyle(s)
currentCell.Attributes.Add("OnClick", "javascript:PassBack('" & CType(e.Item.DataItem, DataRowView).Row(0) & "','" & str.Trim & "');")
End If
End Sub
In javascript i used following code to bind value to textbox function PassBack(FieldId,FieldValue) {
document.getElementById(txtClientType).value = FieldValue;
}
The above codes are working in IE.But in chrome when i click cell in datagrid corresponding value is not coming in textbox.Iam using VS2008.What may be the reason?Can anybody help?