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

RadAutoCompleteBox in ItemTemplate

1 Answer 55 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Joslyn
Top achievements
Rank 1
Joslyn asked on 22 Nov 2013, 12:24 PM
Hi
i have a RadAutoCompleteBox in ItemTemplate of my template column. According to the value selected in it, I want to change the text of another boundColumn. How to achieve this?

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 22 Nov 2013, 12:40 PM
Hi Joslyn,

Please try the following code snippet.

ASPX:
<telerik:GridTemplateColumn>
    <ItemTemplate>
        <telerik:RadAutoCompleteBox ID="RadAutoCompleteBox" runat="server" AutoPostBack="true"
            DataSourceID="SqlDataSource2" DataTextField="ShipCountry" DataValueField="ShipCountry"
            OnEntryAdded="RadAutoCompleteBox_EntryAdded">
        </telerik:RadAutoCompleteBox>
    </ItemTemplate>
</telerik:GridTemplateColumn>

C#:
protected void RadAutoCompleteBox_EntryAdded(object sender, AutoCompleteEntryEventArgs e)
    {
        RadAutoCompleteBox autocompletebox = (RadAutoCompleteBox)sender;
        GridDataItem data = (GridDataItem)autocompletebox.NamingContainer;
        string val = autocompletebox.Text;
        data["ColumnUniqueName"].Text = "Your Required Text";      
    }

Thanks,
Princy
Tags
Grid
Asked by
Joslyn
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or