Solved

Datagrid Template column instantiate with a custom control

Posted on 2004-08-22
4
556 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
  • 3
4 Comments
 
LVL 17

Accepted Solution

by:
AerosSaga earned 500 total points
Comment Utility
This should help:

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

Regards,

Aeros
0
 
LVL 17

Expert Comment

by:AerosSaga
Comment Utility
0
 
LVL 9

Author Comment

by:noulouk
Comment Utility
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
Comment Utility
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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

763 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now