Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET4.0
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..
 
[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 25-Oct-12 0:30am
Edited 25-Oct-12 11:40am
(no name)498.5K
v3

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

  Print Answers RSS
0 OriginalGriff 584
1 Maciej Los 275
2 DamithSL 233
3 Sergey Alexandrovich Kryukov 209
4 BillWoodruff 200
0 OriginalGriff 6,803
1 Sergey Alexandrovich Kryukov 6,377
2 DamithSL 5,421
3 Manas Bhardwaj 4,841
4 Maciej Los 4,330


Advertise | Privacy | Mobile
Web02 | 2.8.1411023.1 | Last Updated 25 Oct 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100