C1 Community
ComponentOne Community is a free source for developers and help authors to collaborate and communicate.

Textbox in an Edit template of a C1WebGrid

rated by 0 users
This post has 1 Reply | 0 Followers

Not Ranked
Posts 3
drjmr Posted: Tue, Jun 23 2009 8:35 AM

I'm using an asp:TextBox in an EditItem template of a C1Webgrid and would like to tie a Client-side event handler to it to evaluate the user input when they are finished entering text.  When I try to tie a client-side event handler to the textbox, I cannot from the server side as it doesn't yet exist.  I tried trapping the Editing event, but the textbox still doesn't exist at that point.

Is it possible to tie a client-side event handler to an asp:Textbox in an Edit template of a C1WebGrid?

 <C1WebGrid:C1TemplateColumn...

                            <EditItemTemplate>
                                <asp:TextBox ID="txtHoursE" runat="server"
                                    OnTextChanged="txtHoursE_TextChanged" AutoPostBack="true"
                                    Text='<%# Bind("Something") %>' CausesValidation="True"></asp:TextBox>
                            </EditItemTemplate>

</C1WebGrid:C1TemplateColumn>

Top 10 Contributor
Posts 1,102
Hi,
 
the client side event handler can be attached like this
 
<EditItemTemplate>
    <asp:TextBox runat="server" ID="textBox1" onchange="alert('onchange')" />
</EditItemTemplate>
Then you should implement a function that will validate input using JavaScript.
 
Regards,
Sergey.
<drjmr> wrote: news:219240@10.0.1.98...

I'm using an asp:TextBox in an EditItem template of a C1Webgrid and would like to tie a Client-side event handler to it to evaluate the user input when they are finished entering text.  When I try to tie a client-side event handler to the textbox, I cannot from the server side as it doesn't yet exist.  I tried trapping the Editing event, but the textbox still doesn't exist at that point.

Is it possible to tie a client-side event handler to an asp:Textbox in an Edit template of a C1WebGrid?

 <C1WebGrid:C1TemplateColumn...

                            <EditItemTemplate>
                                <asp:TextBox ID="txtHoursE" runat="server"
                                    OnTextChanged="txtHoursE_TextChanged" AutoPostBack="true"
                                    Text='<%# Bind("Something") %>' CausesValidation="True"></asp:TextBox>
                            </EditItemTemplate>

</C1WebGrid:C1TemplateColumn>



http://helpcentral.componentone.com/cs/forums/p/79642/219240.aspx#219240

Page 1 of 1 (2 items) | RSS
Contact ComponentOne: 1.800.858.2739 ©1987-2010 ComponentOne LLC All Rights Reserved.