Adding TemplateFields into a Gridview with code RRS feed

  • Question

  • Hello everyone,

    i have seen plenty of code examples with TemplateField/ItemTemplate/EditItemTemplate, but they are all written in markup and i need some help with my webpart code.

    I'm this far:
    GridView gv = new GridView();
    gv.AutoGenerateColumns = false;
    gv.ID = "GriedView1";
    TemplateField tf = new TemplateField();
    tf.HeaderText = "Location";
    // somehow add Combobox as EditItemTemplate with values that come from a sharepoint list
    // ...
    Now as EditItemTemplate is of Type ITemplate, i have no clue how to declare the combobox in it as i have just started with C#.

    • Moved by Chao Kuo Monday, November 2, 2009 2:47 AM off topic in C Sharp (From:Visual C# General)
    Monday, October 26, 2009 11:43 AM

All replies

  • Hello,
    You had better go to ASP.Net forum to post your question. This forum does not support Asp.net.
    Monday, November 2, 2009 2:46 AM