Dynamic Templatefield problem gridview c#

Discussion in 'ASP .Net Web Controls' started by Sharon, Mar 16, 2007.

  1. Sharon

    Sharon Guest

    Hello All,

    I need to create a template field in gridview with table of one column
    repeating as 5 columns. Any ideas and suggestions guys. Cheers,
    Shilpa.

    Something like this.

    ProductImage productImage productImage productImage productImage
    ProductName ProductName ProductName ProductName ProductName



    I have tried this in templatefield of gridview but the data is showing
    as one column

    <table width="120" border="0" cellpadding="0" cellspacing="0"><tr><td
    width="120" align="center" class="box"><img src="<%# Eval("imageurl")
    %>" width="100" height="100" border="0"></td></tr>
    <tr><td width="8"> </td></tr>
    <tr valign="top">
    <td align="center" class="txt-1bold">$<%# Eval("Price") %></td><td> </
    td></tr>
    <tr valign="top">
    <td width="120" align="center" class="txt-main"><%#
    Eval("ProductName") %></td></tr>
    <tr><td> </td></tr>
    </table>


    protected

    void DisplayProducts(int cid)

    {


    DataSet ProductList = new DataSet() ;


    string cmd = "StoredprocedureName" + cid;

    ProductList = a.SelectDSQuery(cmd);

    GridView1.DataSource = ProductList;

    GridView1.DataBind();


    }




    Thanks in Advance for your help. Best Regards
    Sharon, Mar 16, 2007
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. lupina
    Replies:
    3
    Views:
    27,192
    =?Utf-8?B?RWx0b24gVw==?=
    Mar 1, 2006
  2. sloan
    Replies:
    2
    Views:
    4,879
    aryan_subhash
    Oct 17, 2007
  3. Stan SR

    Dynamic TemplateField

    Stan SR, Jun 16, 2007, in forum: ASP .Net
    Replies:
    1
    Views:
    3,137
    Stan SR
    Jun 16, 2007
  4. mesut
    Replies:
    0
    Views:
    554
    mesut
    Jun 29, 2007
  5. pbd22
    Replies:
    0
    Views:
    604
    pbd22
    Oct 28, 2007
Loading...

Share This Page