I tried to create a gridview and add a templatefield.
But i had a problem with itemtemplate.
Here is the which i have written.
public partial class _Default : System.Web.UI.Page
protected void Page_Load(object sender, EventArgs e)
SqlConnection cn = new SqlConnection();
cn.ConnectionString = "Server=SQL;Integrated Security = true;Database=test;Persist Security Info=true";
SqlDataAdapter da = new SqlDataAdapter("select * from Customer", cn);
DataSet ds = new DataSet();
GridView gv1 = new GridView();
gv1.DataSource = ds;
gv1.AutoGenerateColumns = false;
TemplateField tf = new TemplateField();
tf.HeaderText = "Customer Id & Name";
tf.ItemTemplate.InstantiateIn = ???!! <== here is place where i don't know what to do.
(I want to join to two columns I.e., FName and Lname as Name in the Gridview by adding to labels.)
I got the similar code using asp tags.
If any one know how to do this or know any links where i can find some resources for this , help me