views:

31

answers:

0

I have created a databound control that creates 3 calendars with specific formats and binds a list of dates to it to format it even moreso... anyway, that part is working perfectly. I'm trying to implement a day selector, so, when the user clicks on a day in the calendar, it'll highlight the day and raise an event to the calling page.

In the PerformDataBinding, I have this

protected override void PerformDataBinding(IEnumerable retrievedData) {
  base.PerformDataBinding(retrievedData);
  /* SNIP */
  td = new TableCell();

  lb = new LinkButton();
  lb.CommandArgument=curr.ToString("d");
  lb.Command+=new CommandEventHandler(lb_Command);
  lb.Text = string.Format("{0:g}", curr.Day);
  td.Controls.Add(lb);
  /* SNIP */
}

and then.. lb_Command (to be renamed)

void lb_Command(object sender, CommandEventArgs e) {
  SelectedDate = DateTime.Parse(e.CommandArgument.ToString());
  this.Controls.Clear();
  PerformSelect();
}

I'm assuming this isn't the correct way since it doesn't work. Am I approaching it anywhere close to how I should be for this?

Thanks.