1: protected override void OnLoad(EventArgs e)
2: {
3: Table table = (Table)this.Controls[0];
4: int x = 0;
5:
6: // The navigation buttons are in the last table row...
7: foreach (Control control in table.Rows[table.Rows.Count - 1].Cells[0].Controls)
8: {
9: // Each of the navigation containers is a table
10: // There'll be a prettier way of doing this.
11: if (control.Controls[0] is Table)
12: {
13: Table t = (Table)control.Controls[0];
14:
15: // The buttons exist in the table cells
16: foreach (TableCell cell in t.Rows[0].Cells)
17: {
18: // There is a button of each type LinkButton/Button/ImageButton
19: foreach (IButtonControl ctrl in cell.Controls)
20: {
21: // Add a validation group to the button
22: ctrl.ValidationGroup = this.ValidationGroup;
23:
24: if (ctrl is LinkButton)
25: {
26: // The button you want to use must be visible at this stage for the client side
27: // script to get rendered. The wizard itself doesn't make them visible until the render method.
28: ((Control)ctrl).Visible = true;
29:
30: // Create a native control extender and assign the button as the control to extend
31: PeterBlum.DES.NativeControlExtender nce = new PeterBlum.DES.NativeControlExtender();
32: nce.ID = this.ID + "_" + (ctrl as Control).ID + x.ToString() + "_NCE";
33: nce.ControlToExtend = (Control)ctrl;
34: nce.Group = this.ValidationGroup;
35:
36: // Add the NativeControlExtender to the Wizard, can't use this.Conrols.Add() as the
37: // wizard does not allow it's controls collection to be modified. So I just added them
38: // in the first row as they don't render any HTML
39: table.Rows[0].Cells[0].Controls.Add(nce);
40:
41: x++;
42: }
43: }
44: }
45: }
46: }
47: }