Custom Control with DataControlField

Discussion in 'ASP .Net Building Controls' started by Marten Engblom, Feb 18, 2007.

  1. I want to build my own custom control utilizing the DataControlField. What I
    can't figure out is how to parse the markup such as:
    <MyControls:MyCustomGridView . >
    <asp:BoundField DataField="FirstName" HeaderText=" FirstName "
    SortExpression=" FirstName " />
    <asp:BoundField DataField="LastName" HeaderText=" LastName "
    SortExpression=" LastName " />

    into a DataControlFieldCollection? There has to be an already existing
    mechanism by which the GridView control etc does this, that I can utilize?

    I am suspecting there is a way to do this with the TemplateContainer
    attribute, and then use InstantiateIn(), to parse the markup inside the
    <Columns> element into a DataControlFieldCollection?

    Any ideas?

    Thank you in advance,
    Marten Engblom, Feb 18, 2007
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.