Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Datagrid Template column instantiate with a custom control

Posted on 2004-08-22
4
Medium Priority
?
575 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 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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

Sometimes in DotNetNuke module development you want to swap controls within the same module definition.  In doing this DNN (somewhat annoyingly) swaps the Skin and Container definitions to the default admin selections.  To get around this you need t…
In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

971 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