This is a migrated thread and some comments may be shown as answers.

[Solved] Unable using <form> in <EditFormSettings> of RadGrid

3 Answers 76 Views
Grid
This is a migrated thread and some comments may be shown as answers.
huong nguyen
Top achievements
Rank 1
huong nguyen asked on 29 Jun 2009, 10:51 AM
Hi Telerik Suport Team,

I'm facing a problem of using <form> in UserControl page. This page is included in <EditFormSettings> like below :

<

 

telerik:RadGrid runat="server" ID="rgAgencyUsers" GridLines="None" DataKeyNames="AgencyUserID" DataSourceID="LinqDataSource1" >

 

<

 

MasterTableView DataKeyNames="AgencyUserID" AllowMultiColumnSorting="True" CommandItemDisplay="Top">

 

 

<

 

Columns>

 

 

.......
 </Columns>
<EditFormSettings UserControlName="Inc/EditUsers.ascx" EditFormType="WebUserControl">

 

 

<EditColumn UniqueName="EditCommandColumn1"></EditColumn>

 

 

 

</EditFormSettings>
</MasterTableView>

 

 

</

 

telerik:RadGrid>

 

 

 


In EditUsers.ascx, I'm trying to use <form> to let user perform insert/update action automatically just by pressing Enter key to submit form (No need to click on Insert/Update button). But it throws Exception that I can't use <form> tag. I've reviewed examples of how using RadGrid but finding no example that has that solution.

Please help me to solve this problem.

Thanks a lot,
Huong Nguyen.

 

 

 

 

3 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 30 Jun 2009, 07:36 AM
Hi,

This might be caused since you are having more than one server form tag. You could trigger the OnKeyPress client event  of the TextBox in the UserControl  where you could call the click event of the respective Update/Insert button.


ASPX:
 
<asp:TextBox ID="TextBox1" runat="server"  onKeyPress="doSomething(event);" ></asp:TextBox> 


JS:
 
function doSomething(e) 
 { 
    if (!e) var e = window.event; 
    if (e.keyCode==13) 
    { 
    alert('wqewqe'); 
       var lnk=document.getElementById("<%=LinkButton1.ClientID %>"); 
        lnk.click(); 
    } 

Shinu
0
huong nguyen
Top achievements
Rank 1
answered on 30 Jun 2009, 09:13 AM
Hi Shinu,

I don't have any form except one form of UserControl (it's used in <EditFormSettings> of RadGrid). Also in that UserControl page, I have multiple Textboxes, I don't think I have to add onKeyPress event for each textbox like that. Any suggestions please help.

Thanks a lot,
Huong Nguyen.
0
huong nguyen
Top achievements
Rank 1
answered on 01 Jul 2009, 09:24 AM
Oh, Nobody can help me?
Tags
Grid
Asked by
huong nguyen
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
huong nguyen
Top achievements
Rank 1
Share this question
or