Click here to Skip to main content
15,867,750 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: event in custom control Pin
minhpc_bk9-Jul-06 17:13
minhpc_bk9-Jul-06 17:13 
GeneralRe: event in custom control Pin
g00fyman9-Jul-06 17:26
g00fyman9-Jul-06 17:26 
GeneralRe: event in custom control Pin
minhpc_bk9-Jul-06 18:24
minhpc_bk9-Jul-06 18:24 
GeneralRe: event in custom control Pin
g00fyman9-Jul-06 18:41
g00fyman9-Jul-06 18:41 
GeneralRe: event in custom control Pin
g00fyman9-Jul-06 19:05
g00fyman9-Jul-06 19:05 
GeneralRe: event in custom control Pin
g00fyman9-Jul-06 19:20
g00fyman9-Jul-06 19:20 
GeneralRe: event in custom control Pin
minhpc_bk9-Jul-06 19:32
minhpc_bk9-Jul-06 19:32 
GeneralRe: event in custom control [modified] Pin
g00fyman9-Jul-06 20:59
g00fyman9-Jul-06 20:59 
thanks for all your help so far,

the trouble i am having now is that the control is not rendered design time properly when it is a composite control, the properties are not being refreshed, like when i set a button group to YesNoCancel, i get nothing until i switch from design to source view to deign again.

so i moved the logic to create control hierarchy into createchildcontrols() then in render i just render the table that createchildcontrols() creates. but now the events aren't firing again and i can't see why as the events are wired up in CreateChildControls() still.

any ideas on how i can get design time support refreshing display when i change a property or


sorry to be a pain.

kind regards,
g00fy

this is what i have now

private WebTable MessageBoxTable = null;

private WebTable BuildHierarchy()
{
  // actual message box to hold all controls
  WebTable table = new WebTable(1, 1);
  table.Style[HtmlTextWriterStyle.Position] = (Location == MessageBoxLocation.CentreWindow) ? "absolute" : "relative";

  WebTable content = new WebTable(3, 1);
  WebTable header = CreateTitleBarPanel();
  WebTable body = CreateBodyPanel();
  WebTable buttons = CreateButtonsPanel();
  WebTable footer = CreateFooterPanel();

  // title bar
  table[0, 0].Controls.Add(header);

  // message area
  content[0, 0].Controls.Add(body);
  content.Width = new Unit(100, UnitType.Percentage);

  // buttons area
  content[1, 0].HorizontalAlign = HorizontalAlign.Center;
  if (DesignMode && Buttons.Count == 0)
  {
    content[1, 0].Controls.Add(new LiteralControl("Use the Property Browser to add the Message Box Buttons"));
    content[1, 0].Font.Bold = true;
    content[1, 0].Font.Name = "Verdana";
    content[1, 0].Font.Size = new FontUnit(11, UnitType.Pixel);
  }
  else
  {
    content[1, 0].Controls.Add(buttons);
  }

  // footer area
  content[2, 0].Controls.Add(footer);

  table.ID = this.ID;
  if (Draggable)
  {
    // mandatory attribute to enable dragging of message box,
    // drag handle is restricted to the title bar
    header.Attributes["onmousedown"] = "dragStart(event, '" + this.UniqueID + "_" + table.ID + "')";
    header.Style[HtmlTextWriterStyle.Cursor] = "move";
  }

  table.Height = base.Height;
  table.Width = base.Width;
  table[0, 0].Controls.Add(content);

  SetMessageBoxLocation(ref table);
  ApplyEmbeddedCssClasses(ref table, ref content, ref header, ref body, ref buttons, ref footer);

  foreach (Button button in Buttons)
  {
    button.Click += new EventHandler(Button_Click);
  }
  return table;
}

protected override void CreateChildControls()
{
  MessageBoxTable = BuildHierarchy();
}

protected override void Render(HtmlTextWriter writer)
{
  HtmlLink link = GetEmbeddedStyleSheet();
  WebTable table = MessageBoxTable;

  base.Controls.Add(link);
  base.Controls.Add(table);

  link.RenderControl(writer);
  table.RenderControl(writer);
}


-- modified at 3:31 Monday 10th July, 2006
GeneralRe: event in custom control Pin
minhpc_bk10-Jul-06 17:11
minhpc_bk10-Jul-06 17:11 
GeneralRe: event in custom control Pin
g00fyman10-Jul-06 17:42
g00fyman10-Jul-06 17:42 
QuestionWeb.cofig error [modified] Pin
madalluge9-Jul-06 3:25
madalluge9-Jul-06 3:25 
AnswerRe: Web.cofig error Pin
Guffa9-Jul-06 5:33
Guffa9-Jul-06 5:33 
QuestionDebugging Problem Pin
AliAmjad9-Jul-06 3:05
AliAmjad9-Jul-06 3:05 
AnswerRe: Debugging Problem Pin
Subrahmanyam K9-Jul-06 18:19
Subrahmanyam K9-Jul-06 18:19 
QuestionDisplaying IE Popup before download Pin
VenkataRamana.Gali9-Jul-06 1:09
VenkataRamana.Gali9-Jul-06 1:09 
QuestionHow and Where to store the data Pin
Pentellcc8-Jul-06 13:35
Pentellcc8-Jul-06 13:35 
AnswerRe: How and Where to store the data Pin
Guffa8-Jul-06 23:20
Guffa8-Jul-06 23:20 
GeneralRe: How and Where to store the data Pin
Pentellcc9-Jul-06 7:27
Pentellcc9-Jul-06 7:27 
AnswerRe: How and Where to store the data Pin
Guffa9-Jul-06 10:24
Guffa9-Jul-06 10:24 
Questionalphabetic paging of datagrid with C# Pin
anu_chandu8-Jul-06 12:05
anu_chandu8-Jul-06 12:05 
QuestionASP.Net 2.0 Skins and Themes files to download Pin
Clickok8-Jul-06 12:04
Clickok8-Jul-06 12:04 
QuestionDoubt regarding AJAX Pin
ravindradonkada8-Jul-06 10:35
ravindradonkada8-Jul-06 10:35 
QuestionAbout property of FieldSize in access Pin
KSCsoft8-Jul-06 5:00
KSCsoft8-Jul-06 5:00 
AnswerRe: About property of FieldSize in access Pin
Guffa8-Jul-06 8:32
Guffa8-Jul-06 8:32 
Questioncreate user controls [modified] Pin
surshbabuk8-Jul-06 4:42
surshbabuk8-Jul-06 4:42 

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.