Help with Data Binding using GridTemplatecolumn in RadGrid

4 posts, 0 answers
  1. Alex
    Alex avatar
    8 posts
    Member since:
    Apr 2014

    Posted 03 Jun 2014 Link to this post

    I have the below code, this so that I can get the Multiline Edit under the Auto Edit Feature. That part is working great data is bound to the edit portion, but in the actual Grid the columns are blank under these fields - the data is not being bound to the Grid, but is showing up when I open the Edit Popup Panel. Why is the data not showing in the initial grid:


    <telerik:GridTemplateColumn DataField="CorrectiveAction" 
    FilterControlAltText="Filter CorrectiveAction column" HeaderText="Corrective 
    Action" SortExpression="CorrectiveAction" UniqueName="CorrectiveAction" 
    Visible="false"><BR><EditItemTemplate><BR><asp:TextBox ID="TextBox2" 
    Text='<%# Bind("CorrectiveAction")%>' Columns="30" Rows="5" 
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 03 Jun 2014 in reply to Alex Link to this post

    Hi Alex,

    You have to set the ItemTemplate of the GridTemplateColumn, it appears in column cells in browser mode.
    Please keep in mind that when adding a template column, it is also recommended that you declare an ItemTemplate. If you do not need an ItemTemplate, you can simply omit its contents and leave it empty.

    <telerik:GridTemplateColumn DataField="CorrectiveAction" FilterControlAltText="Filter CorrectiveAction column" HeaderText="CorrectiveAction" SortExpression="CorrectiveAction" UniqueName="CorrectiveAction" Visible="true">
          <%# Eval("CorrectiveAction")%>'
         <asp:TextBox ID="TextBox2" Text='<%# Bind("CorrectiveAction")%>' TextMode="MultiLine" runat="server"></asp:TextBox><br>

  3. DevCraft R3 2016 release webinar banner
  4. Aruna
    Aruna avatar
    4 posts
    Member since:
    Aug 2014

    Posted 30 Nov 2014 in reply to Princy Link to this post

            <rad:GridTemplateColumn UniqueName="Qty" AllowFiltering="false" HeaderText="Quantity">
                                        <rad:RadTextBox ID="txtqty" runat="server" Text='<%# Bind("Qty") %>' BorderColor="White"
                                            BorderStyle="None" Width="100px" AutoPostBack="true" OnTextChanged="txtqty_TextChanged">
                                        <asp:HiddenField ID="txtisqty" runat="server" Value='<%#Bind("hIsQty") %>' />

     Here I want to fire this "txtqty_TextChanged" ,pls help me,in this event i will show the javascript message.
  5. Eyup
    Eyup avatar
    2942 posts

    Posted 04 Dec 2014 Link to this post

    Hi Aruna,

    If you will display a script alert, you can use the client-side event of the textbox:

    Hope this helps.


    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

Back to Top