?
Solved

Datagrid Template column instantiate with a custom control

Posted on 2004-08-22
4
Medium Priority
?
571 Views
Last Modified: 2012-06-27
Hi Experts,

I want to load a custom control in my template column. Is it possible ?

I do like this, but doesn't work:

public class TemplateColumn : ITemplate
{
    public void InstantiateIn(System.Web.UI.Control container)
    {
               public void InstantiateIn(System.Web.UI.Control container)
               {
                 MyTemplate=(MyTemplate)LoadControl("UserControls/MyTemplate.ascx");
                 container.Controls.Add(MyTemplate);
                }
}

Thanks in advance for any help.
0
Comment
Question by:noulouk
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 17

Accepted Solution

by:
AerosSaga earned 2000 total points
ID: 11865539
This should help:

http://www.dotnetbips.com/displayarticle.aspx?id=84

Regards,

Aeros
0
 
LVL 9

Author Comment

by:noulouk
ID: 11897331
Thanks AerosSaga,

I'm sorry for answering so late. Your answers help me to create the template column with my usercontrol, but I don't know how to rebuild my usercontrol in itemcreated event of my datagrid.

Thanks in advance for helping me about this particular problem.
0
 
LVL 17

Expert Comment

by:AerosSaga
ID: 11897522
You will have to readd them programatically if I'm understanding this second question. see below:

http://www.c-sharpcorner.com/Database/PlayingWithDataGridTA.asp
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question