Hi ,
I am trying to access the EditItemTemplate's text box control id(tbEntityID) in javascript to assign a new value to it. I searched many forums solution and tried many way, but no luck for me. following is the code snippet what i've followed.
Please help me to sort out this problem.
ASPX
C#
JavaScript
Thanks in Advance
Bharani
I am trying to access the EditItemTemplate's text box control id(tbEntityID) in javascript to assign a new value to it. I searched many forums solution and tried many way, but no luck for me. following is the code snippet what i've followed.
Please help me to sort out this problem.
ASPX
| <telerik:GridTemplateColumn HeaderText="Client Id" UniqueName="txtEntityId" EditFormColumnIndex="0" DataField="EntityID"> |
| <ItemTemplate> |
| <asp:Label runat="server" ID="lblEntityID" Text='<%# Eval("EntityID", "{0:C}") %>'></asp:Label> |
| </ItemTemplate> |
| <EditItemTemplate> |
| <asp:TextBox runat="server" ID="tbEntityID" Text='<%# Bind("EntityID") %>'></asp:TextBox> |
| </EditItemTemplate> |
| </telerik:GridTemplateColumn> |
C#
| protected void GrdBPOClients_OnItemDataBound(object sender, GridItemEventArgs e) |
| { |
| if (e.Item is GridEditableItem && e.Item.IsInEditMode) |
| { |
| GridEditableItem editedItem = (GridEditableItem)e.Item; |
| System.Web.UI.WebControls.TextBox textbx = (System.Web.UI.WebControls.TextBox)editedItem.FindControl("tbEntityID"); |
| } |
| } |
JavaScript
| function OnClientEntityClose(oWnd, oArg) |
| { |
| //get the transferred arguments |
| var arg = oArg.get_argument(); |
| if (arg) { |
| if (arg.NewEntityId!= '') |
| document.getElementById('textbx').value = arg.NewEntityId; } |
| } |
Thanks in Advance
Bharani