N
Netmonster
I am having trouble programmatically setting the SelectedIndexChanged
of a GridView.
Code as follows.
Panel Panel1 = new Panel();
GridView g = new GridView();
ObjectDataSource o = new ObjectDataSource();
//load objectdatasource using webservice
o.SelectMethod = "getAllCCF";
o.TypeName = "testitoccfws.PDAFServices";
//Bind to Gridview
o.DataBind();
g.AutoGenerateSelectButton = true;
g.DataSource = o;
g.DataBind();
g.SelectedIndexChanged += new
System.EventHandler(this.GridView1_SelectedIndexChanged()); ----This
line has an error
Panel1.Controls.Add(g);
here is the method i wish to handle the event.
void GridView1_SelectedIndexChanged(object sender, e)
{
GridViewRow row = o.SelectedRow;
TextBox1.Text = row.Cells[1].Text;
}
Can someone please take a look and please tell me what I am doing
wrong?
Thanks,
KC
of a GridView.
Code as follows.
Panel Panel1 = new Panel();
GridView g = new GridView();
ObjectDataSource o = new ObjectDataSource();
//load objectdatasource using webservice
o.SelectMethod = "getAllCCF";
o.TypeName = "testitoccfws.PDAFServices";
//Bind to Gridview
o.DataBind();
g.AutoGenerateSelectButton = true;
g.DataSource = o;
g.DataBind();
g.SelectedIndexChanged += new
System.EventHandler(this.GridView1_SelectedIndexChanged()); ----This
line has an error
Panel1.Controls.Add(g);
here is the method i wish to handle the event.
void GridView1_SelectedIndexChanged(object sender, e)
{
GridViewRow row = o.SelectedRow;
TextBox1.Text = row.Cells[1].Text;
}
Can someone please take a look and please tell me what I am doing
wrong?
Thanks,
KC