Click here to Skip to main content
15,900,110 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: COM Interop Pin
Dave Sexton13-Aug-06 21:22
Dave Sexton13-Aug-06 21:22 
AnswerRe: COM Interop Pin
GlenCope17-Aug-06 10:36
GlenCope17-Aug-06 10:36 
GeneralRe: COM Interop Pin
Dave Sexton18-Aug-06 0:59
Dave Sexton18-Aug-06 0:59 
QuestionJustify Alignment in a Textbox Pin
Excadrix13-Aug-06 14:30
Excadrix13-Aug-06 14:30 
AnswerRe: Justify Alignment in a Textbox Pin
Christian Graus13-Aug-06 14:52
protectorChristian Graus13-Aug-06 14:52 
GeneralRe: Justify Alignment in a Textbox Pin
Dave Sexton13-Aug-06 21:23
Dave Sexton13-Aug-06 21:23 
GeneralRe: Justify Alignment in a Textbox Pin
Excadrix14-Aug-06 4:40
Excadrix14-Aug-06 4:40 
QuestionITemplate INamingcontainer Pin
erikkl200013-Aug-06 12:29
erikkl200013-Aug-06 12:29 
Hi..
I have made a custom template that derives from ITemplate.
I have also create a class that inherits from INaming container.

For some reason i can not get the INaming container to work with my custom template. In order to implement the INaming container one must have a property that returns an ITemplate.

Why can i not return my custom Template the derives from ITemplate?


here is some of my code:
----

[ParseChildren(true)]
[PersistChildren(false)]
[ToolboxData("<{0}:HoverCalendar runat=server>")]
public class HoverCalendar : WebControl, INamingContainer
{


private ITemplate _itemTemplate;
[PersistenceMode(PersistenceMode.InnerProperty)]
public ITemplate ItemTemplate
{
get { return _itemTemplate; }
set { _itemTemplate = value; }
}

protected override void CreateChildControls()
{
Controls.Clear();
HtmlGenericControl container = new HtmlGenericControl("div");

if (ItemTemplate != null)
{ ItemTemplate.InstantiateIn(container); }
Controls.Add(container);
base.CreateChildControls();
}
}

*** this works fine; however, how do i use my ( the one below for example ) template?
----


public class myItemplate_1 : ITemplate
{

static int itemcount = 0;
ListItemType templateType;
public myItemplate_1(ListItemType type)
{
templateType = type;
}

public void InstantiateIn(System.Web.UI.Control container)
{
Literal lc = new Literal();
switch (templateType)
{
case ListItemType.Header:
lc.Text = "";
break;
case ListItemType.Item:
lc.Text = "";
break;
case ListItemType.AlternatingItem:
lc.Text = "";
break;
case ListItemType.Footer:
lc.Text = "
Items
Item number: " + itemcount.ToString() +
"
Item number: " +
itemcount.ToString() + "
";
break;
}
container.Controls.Add(lc);
itemcount += 1;
}

}






thanks

erik
AnswerRe: ITemplate INamingcontainer Pin
Dave Sexton13-Aug-06 21:26
Dave Sexton13-Aug-06 21:26 
Questionquicktime first frame Pin
Phoen2513-Aug-06 10:52
Phoen2513-Aug-06 10:52 
QuestionUsing Send Keys.dll Pin
Big Hutch13-Aug-06 10:46
Big Hutch13-Aug-06 10:46 
QuestionPls Help Big Problem ?? Pin
nsr2006nsr13-Aug-06 8:23
nsr2006nsr13-Aug-06 8:23 
AnswerRe: Pls Help Big Problem ?? [modified] Pin
Guffa13-Aug-06 9:48
Guffa13-Aug-06 9:48 
QuestionUsing part of an image .clip? Pin
spelltwister13-Aug-06 8:05
spelltwister13-Aug-06 8:05 
AnswerRe: Using part of an image .clip? Pin
Christian Graus13-Aug-06 13:22
protectorChristian Graus13-Aug-06 13:22 
GeneralRe: Using part of an image .clip? Pin
spelltwister13-Aug-06 13:37
spelltwister13-Aug-06 13:37 
QuestionGDI Pin
Agus Budianto13-Aug-06 3:51
Agus Budianto13-Aug-06 3:51 
AnswerRe: GDI Pin
Christian Graus13-Aug-06 13:23
protectorChristian Graus13-Aug-06 13:23 
GeneralRe: GDI Pin
Agus Budianto17-Aug-06 17:08
Agus Budianto17-Aug-06 17:08 
Questionhow to get value from one crystal report to another Pin
ambikarama13-Aug-06 3:49
ambikarama13-Aug-06 3:49 
AnswerRe: how to get value from one crystal report to another Pin
Dave Sexton13-Aug-06 21:32
Dave Sexton13-Aug-06 21:32 
Questionhow to get value from one crystal report to another Pin
ambikarama13-Aug-06 3:48
ambikarama13-Aug-06 3:48 
QuestionVB 2005 creating an emailing function? Pin
Solly7413-Aug-06 3:28
Solly7413-Aug-06 3:28 
AnswerRe: VB 2005 creating an emailing function? Pin
Christian Graus13-Aug-06 13:24
protectorChristian Graus13-Aug-06 13:24 
Questiontxt file recieved over the network using TCP/IP not the same as the original Pin
mrmathews9913-Aug-06 2:59
mrmathews9913-Aug-06 2:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.