hi guys,
I have 2 gridviews, one inside a modal popup(gvSupplie rs) and one on the page(gvFirms). The header row of the gvFirms has 4 text boxes. I can find those controls easily inside the selectedindexCh anged method of gvSuppliers easilly when one row gvSupliers is selected. My problem arises when i try to find the 4 textboxes inside the emptydatatempla te of gvFirms.
Eg.
My question is, inside gvSuppliers_Sel ectedIndexChang ed method, how do i find the textboxes inside the emptydatatempla te of gvFirms.
one thought that crossed my mind was to programatically call the rowcommand event within the gvSuppliers_Sel ectedIndexChang ed method and so i should have the GridViewCommand EventArgs e and then i could say something to this effect inside gvFirms_Rowcomm and method
I dont know what to do
Please help asap
I have 2 gridviews, one inside a modal popup(gvSupplie rs) and one on the page(gvFirms). The header row of the gvFirms has 4 text boxes. I can find those controls easily inside the selectedindexCh anged method of gvSuppliers easilly when one row gvSupliers is selected. My problem arises when i try to find the 4 textboxes inside the emptydatatempla te of gvFirms.
Eg.
Code:
protected void gvSuppliers_SelectedIndexChanged(object sender, EventArgs e)
{
GridViewRow row = gvSuppliers.SelectedRow;
LinkButton linkbutton = (LinkButton)row.Cells[0].FindControl("LinkButton1");
TextBox SupplierID = (TextBox)gvFirms.HeaderRow.FindControl("txtNewSupplierId");//This is the first textbox
}
one thought that crossed my mind was to programatically call the rowcommand event within the gvSuppliers_Sel ectedIndexChang ed method and so i should have the GridViewCommand EventArgs e and then i could say something to this effect inside gvFirms_Rowcomm and method
Code:
if (e.CommandName.Equals("AddNewItem"))
{
GridViewRow row = (GridViewRow)((e.CommandSource as Button).NamingContainer);
string categoryName = (row.FindControl("txtCategoryName") as TextBox).Text;
Please help asap
Comment