开发者

How to access "textChanged" event from text box that added to telerik Rad Grid?

Hi There Do you know how to access textboxes textChanged event added to a radgrid that are bound but are used to trap any row related 开发者_如何学Goinput a user typed in to the textbox for that column. I need to access this data server side when a postback occurs. Your thoughts are greatly appreciated Thanking you


Being in a RadGrid really doesn't change much. Set AutoPostBack="true" on the TextBox, and create an OnTextChanged event handler:

<telerik:RadGrid ID="RadGrid1" runat="server">                                                                
    <MasterTableView AutoGenerateColumns="false">      
        <Columns>
            <telerik:GridTemplateColumn>
                <ItemTemplate>
                    <asp:TextBox ID="TextBox1" runat="server" AutoPostBack="true" OnTextChanged="TextBox1_TextChanged" />
                </ItemTemplate>
            </telerik:GridTemplateColumn>
        </Columns>
    </MasterTableView>
</telerik:RadGrid>

In code-behind:

protected void TextBox1_TextChanged(object sender, EventArgs e)
{
    TextBox txt = sender as TextBox;
    if (txt != null)
    {
        //some logic here
    }
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜