Click here to Skip to main content
13,255,340 members (46,854 online)

Footer Template filed's visible is set to false

Member 9337857 asked:

Open original thread
In my Gridview Footer i have DropDown list and TextBox and LinkButton . In my dropDown I have some fields

in that one of the field is "-N/A-" value of that field is "7".

Now my doubt is when i select the DropDown Value " -N/A-" then the remaining fields like TextBox and LinkButton visiblity to set as false .
protected void GV_RowCommand(object sender, GridViewCommandEventArgs e) 
       if (e.CommandName == "Add") 
            GridView grid = (GridView)sender; 
            DataGridItem item = grid.NamingContainer as DataGridItem; 
            int Doc_No = Convert.ToInt32(gdDrawing.DataKeys[item.ItemIndex]); 
            ViewState["Doc_Id"] = Doc_No; 
            string Material = (grid.FooterRow.FindControl("ddlMaterial_Type") as DropDownList).SelectedItem.Text; 
            int Material_Id = Convert.ToInt32((grid.FooterRow.FindControl("ddlMaterial_Type") as DropDownList).SelectedValue); 
            string Quantity = (grid.FooterRow.FindControl("txtMaterialQty") as TextBox).Text; 
           //material_id = 7 then textbox and linkbutton of footer to set visible as false 

can any one help me to solve this issue
Tags: C# (C#4.0)


When answering a question please:
  1. Read the question carefully.
  2. Understand that English isn't everyone's first language so be lenient of bad spelling and grammar.
  3. If a question is poorly phrased then either ask for clarification, ignore it, or edit the question and fix the problem. Insults are not welcome.
Let's work to help developers, not make them feel stupid.
Please note that all posts will be submitted under the The Code Project Open License (CPOL).

Advertise | Privacy |
Web01 | 2.8.171114.1 | Last Updated 26 Mar 2009
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100