Dynamic Templatefield problem gridview c#

S

Sharon

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
 

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. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top