I'm working on about grid and when I click on a row of it the text box controls in a panel under the grid have to fill with the selected row values. I'm doing this on the client side and using onClientSelect property of grid view. I'm getting the values when I click on the row but couldn't assign them to controls. Please look the code and let me know
<%@ Register Assembly="obout_Grid_NET" Namespace="Obout.Grid" TagPrefix="cc1" %>
<%@ Register Assembly="obout_Interface" Namespace="Obout.Interface" TagPrefix="cc2" %>
<%@ Register TagPrefix="igg" Namespace="HR" Assembly="HR" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<script type="text/javascript">
function OnRecordFillPanel(arrSelectedRecords) {
for (var i = 0; i < arrSelectedRecords.length; i++) {
var record = arrSelectedRecords[i];
$("#ernType").text = record.EARNCDE;//**problem comes here cannot assign value to textbox.**
}
}
function addNewRec() {
$('#ernType').val('');//**and also cannot clear the value here**
}
</script>
<div >
<div>
<ISS:ISSOGrid ID="grd_EarningCodeTable" runat="server" Width="100%" OnClientSelect="OnRecordFillPanel"
AllowMultiRecordSelection="false" AutoGenerateColumns="false">
<Columns>
<cc1:Column ID="col_ErnType" DataField="EARNCDE" HeaderText="Earning Code" runat="server"
HeaderAlign="Left" Align="Left" Width="20%" />
<cc1:Column ID="col_Desc" DataField="DESCRIPTION" HeaderText="Description" runat="server"
HeaderAlign="Left" Align="Left" Width="25%" />
</ISS:ISSOGrid>
</div>
<div>
<asp:Panel ID="pnl_details" runat="server" Height="214px">
<div id="Div1" class = "showdetails" visible = "true" runat ="server" style="padding : 20px;">
<div style ="padding: 6px; width: 882px;">
<label>Earnings Type: </label>
<asp:TextBox ID = "ernType" runat ="server"></asp:TextBox>
</div>
<div style ="padding: 6px; width: 467px;">
<label>Description: </label>
<asp:TextBox ID = "desc" runat ="server" Width="300px"></asp:TextBox>
</div>
<div style ="padding: 6px;">
<asp:Button ID="btn_new" runat="server" Text="New" OnClientClick="javascript:addNewRec();" />
</asp:Panel>
</div>
</div>
</asp:Panel>
</div>
</div>
</asp:Content>