Adding UserControl for editing,inserting a column. RRS feed

  • Question

  • User-1759624489 posted

     Hello. I have a table called branches with columnds, id, name,, address, phone and responsible.

    Responsible field is a GUID.

    I am using sqlmembership provider in another database, so that guid, is the guid of the user.

    I am making a usercontrol,  the usercontrol is just a DropDownList that will load the users from that database.


     1. I am not using the default templates, I am using my custom templates.

    2. The question is, what should I do in the gridview and detailsview, and what should I do in the usercontrol to make it work?


                                    <asp:DynamicField DataField="Id" />
                                    <asp:DynamicField DataField="Name" HeaderText="Nombre de la Sucursal" />
                                    <asp:DynamicField DataField="Address" HeaderText="Dirección" />
                                    <asp:DynamicField DataField="Phone" HeaderText="Teléfono" />

    I guess

    <myuc:Drop  id=userId> or something like that, and the same in the detailsview.


    Somthing else?


    Friday, August 29, 2008 10:25 AM

All replies

  • User188291263 posted

     Make a control,and put UIHint attribute on property which tell what control to use.

    Make sure you name your control ControlName_Edit and etc

    Friday, August 29, 2008 11:49 AM
  • User-797310475 posted

    You can read more about how to add field templates on this MSDN page.

    Friday, August 29, 2008 2:03 PM