E
estebistec
Hello,
I've developed a CompositeControl in C# for ASP.NET 2.0. In this
control I am simulating Edit and View modes by hiding or showing
appropriate controls (setting Control.Visible). Basically I'm
simulating the functionality of the DetailsView or a GridView cell,
except that my data is dynamic (variable number of fields), so I can't
just use those. So I have custom edit and view controls for this
dynamic data and I render one of those two based on the current mode of
the control. I also render an "Edit" button in view mode and "Cancel"
and "Save" buttons in edit mode. As I said I just change the visibility
of controls appropriately, so I just render them all in the overrie of
RenderContents() like so:
this.ViewControl.RenderControl(writer);
this.EditorControl.RenderControl(writer);
writer.WriteBreak();
this.EditButton.RenderControl(writer);
this.SaveButton.RenderControl(writer);
this.CancelButton.RenderControl(writer);
This works fine in view-mode, but when edit-mode is entered, the Save
and Cancel buttons are rendered BEFORE the EditorControl, and after
those another control from the page I'm testing on also appears before
the EditorControl. So not only is it reversing the order of the edit
buttons and control, but it is interleaving the rendering of another
control from the page, in-between children from this control.
Otherwise, all of the individual child controls work and do what
they're supposed to, successfully editing my dynamic data, but the
rendering order is sure to confuse users.
Has anybody seen anything like this and/or have clues as to what may
fix it? Thanks.
I've developed a CompositeControl in C# for ASP.NET 2.0. In this
control I am simulating Edit and View modes by hiding or showing
appropriate controls (setting Control.Visible). Basically I'm
simulating the functionality of the DetailsView or a GridView cell,
except that my data is dynamic (variable number of fields), so I can't
just use those. So I have custom edit and view controls for this
dynamic data and I render one of those two based on the current mode of
the control. I also render an "Edit" button in view mode and "Cancel"
and "Save" buttons in edit mode. As I said I just change the visibility
of controls appropriately, so I just render them all in the overrie of
RenderContents() like so:
this.ViewControl.RenderControl(writer);
this.EditorControl.RenderControl(writer);
writer.WriteBreak();
this.EditButton.RenderControl(writer);
this.SaveButton.RenderControl(writer);
this.CancelButton.RenderControl(writer);
This works fine in view-mode, but when edit-mode is entered, the Save
and Cancel buttons are rendered BEFORE the EditorControl, and after
those another control from the page I'm testing on also appears before
the EditorControl. So not only is it reversing the order of the edit
buttons and control, but it is interleaving the rendering of another
control from the page, in-between children from this control.
Otherwise, all of the individual child controls work and do what
they're supposed to, successfully editing my dynamic data, but the
rendering order is sure to confuse users.
Has anybody seen anything like this and/or have clues as to what may
fix it? Thanks.