FormView Buttons

  • Thread starter Thread starter shapper
  • Start date Start date
S

shapper

Hello,

I created a FormView at runtime and implemented Insert, Edit and Item
templates through a Class (Implements ITemplate).

Since all my templates are the same, i.e., there are no differences
between them I just used the same class for all.

Can I do this?

And in my ITemplate I created 3 buttons: Insert, Update, Edit and
Cancel.

How can I make the buttons work with FormView?

And how do I have to manual hide or show the buttons depending on
FormView mode?

Thanks,

Miguel
 
You can use the CommandName property of the buttons to make them
insert, update, edit, and cancel. Just set it to one of those as
strings. You can handle the PreRender event of the buttons to
determine if the mode of the containing FormView should contain each,
and set the Visible property appropriately.

-Mike Placentra II
 
Back
Top