Click here to Skip to main content
15,886,362 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
hi all,
I am developing a custom grid control.I am able to get row and cells for particular row.Now i want to have either a LABEL or HYPERLINK in cells.SO how do i need to proceed further?

below is my code..

C#
[DefaultProperty("Text")]
[ToolboxData("<{0}:Infobox  runat="server">")]
public class Infobox : TableCell, INamingContainer
{
TableCell cell = new TableCell();

HyperLink lbl = new HyperLink();

private bool _resizable;
private Int16 _weighting;

[Bindable(false),
Category("Appearance"),
DefaultValue(false)]
public bool Resizable
{
get { return (_resizable); }
set { _resizable = value; }
}

[Bindable(false),
Category("Appearance"),
DefaultValue(50)]
public Int16 Weighting
{
get { return (_weighting); }
set { _weighting = value; }
}


protected override void CreateChildControls()
{
this.Controls.Add(cell);
this.Controls.Add(lbl);
}
protected override void Render(HtmlTextWriter writer)
{
base.Render(writer);

}
}

[ToolboxData("<{0}:GridRow  runat="server">")]
public class GridRow : TableRow, INamingContainer
{
Infobox gcColumn = new Infobox();

protected override void CreateChildControls()
{
gcColumn.ID = "column";

gcColumn.Width = Unit.Percentage(100);

this.Controls.Add(gcColumn);
}

protected override void Render(HtmlTextWriter writer)
{
base.Render(writer);
}
}

[ToolboxData("<{0}:Grid  runat="server">")]
public class Grid : Table, INamingContainer
{
GridRow grRow = new GridRow();

protected override void CreateChildControls()
{
grRow.ID = "row";

grRow.Width = Unit.Percentage(100);
Label lbl = new Label();
grRow.Controls.Add(lbl);
Controls.Add(grRow);
}

protected override void Render(HtmlTextWriter writer)
{
base.Render(writer);
}
}
Posted
Updated 25-Oct-12 10:40am
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900