Showing a combobox text in itemtemplatecolumn

2 posts, 0 answers
  1. Vaedan
    Vaedan avatar
    1 posts
    Member since:
    Feb 2014

    Posted 07 Feb 2014 Link to this post

    Hi,

    I'd like to display my combobox text that I change in the edit mode in the itemTemplate, in a disabled combobox or a label. Here's my aspx : 

    <telerik:GridTemplateColumn HeaderText="Catégorie Profil" SortExpression="catProfil" >
                           <ItemTemplate>
                               <telerik:RadComboBox ID="cbxCatProfilDisabled" runat="server" Enabled="false">
                               </telerik:RadComboBox>
                           </ItemTemplate>
                           <EditItemTemplate>
                               <telerik:RadComboBox ID="cbxCatProfil" runat="server">
                               </telerik:RadComboBox>
                           </EditItemTemplate>
    </telerik:GridTemplateColumn>

    I've tried many things, but no one work.
    Thanks for your help
  2. Hristo Valyavicharski
    Admin
    Hristo Valyavicharski avatar
    975 posts

    Posted 11 Feb 2014 Link to this post

    Hi Vaedan,

    Try to use Eval. For Example:

    <telerik:GridTemplateColumn HeaderText="Catégorie Profil" SortExpression="catProfil" >
                           <ItemTemplate>                         
     <%# DataBinder.Eval(Container.DataItem"City") %>
                           </ItemTemplate>
                           <EditItemTemplate>
                               <telerik:RadComboBox ID="cbxCatProfil" runat="server">
                               </telerik:RadComboBox>
                           </EditItemTemplate>
    </telerik:GridTemplateColumn>

    Also look at this post http://www.telerik.com/forums/radgrid---itemtemplate-vs-edititemtemplate

    Regards,
    Hristo Valyavicharski
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the UI for ASP.NET AJAX, subscribe to the blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top