Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7587381
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T19:39:35+00:00 2026-05-30T19:39:35+00:00

I am adding columns to RadGrid from code behind. In NeedDataSource event, I am

  • 0

I am adding columns to RadGrid from code behind. In NeedDataSource event, I am binding a DataTable(with 10 columns) to the radgrid.
Everything’s working well till here. But I would like to have text boxes in 2 columns(on load itself, not just in edit mode).

<telerik:RadGrid ID="RadGrid1" runat="server" ShowHeader="true" 
        OnNeedDataSource="RadGrid1_NeedDataSource" OnPreRender="RadGrid1_PreRender"
        AutoGenerateColumns="true" >
        <MasterTableView>
        </MasterTableView>
</telerik:RadGrid>

If done declarative, the column definition shall be like this. But I want it accomplished from code behind.

<telerik:GridTemplateColumn HeaderText="Qty">
                <ItemTemplate>
                    <input id="<%# this.GetUniqueId("Qty", Container.DataItem)%>" name="<%# this.GetUniqueId("Qty", Container.DataItem)%>" type="text" value="<%# Eval("Quantity")%>" size="2" maxlength="3"  />
                </ItemTemplate>
</telerik:GridTemplateColumn>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T19:39:36+00:00Added an answer on May 30, 2026 at 7:39 pm

    Create TemplateColumn like any other column type and set template object to ItemTemplate (and you can do same for HeaderTemplate and FooterTemplate). But you have to define custom template class witch will implement ITemplate.

    You can find an example here :

    http://www.telerik.com/help/aspnet-ajax/grid-programmatic-creation.html#Section4

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

It's an addition for previous my question about adding columns into jqGrid-based table. Here
I have defined a DataTable by adding typed columns. I expect the DataTable to
I have situation where I need to change the order of the columns/adding new
Should I be careful adding too many include columns to a non-cluster index? I
we've been making changes in the MySQL database, adding tables, columns and so forth
I'm adding an auto increment column (called rowNum) to my table and it's working
I have scripts for adding columns to tables which worked. When I run scripts
I have JTextPane from Netbeans designer's section. I want to add columns and rows
I'm adding some columns to one of my database tables, and then populating those
I'm editing the order grid by adding custom columns like this $this->addColumn('pagamenti', array( 'header'

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.