Click here to Skip to main content
15,897,187 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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 .
C#
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
Posted

1 solution

when u want to hide footer after selecting dropdown value or after clicking footer link button ?
 
Share this answer
 
Comments
[no name] 3-Oct-12 8:09am    
after selecting the dropdown value i want to set visible false for textbox and linkbutton only, not footer template.
solanki.net 3-Oct-12 8:20am    
in rowcommand event after finding dropdown , u can check value of drop down and set visible=false for textbox and button .

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900