Click here to Skip to main content
15,889,931 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
hi friends
i have one dynamic grid view in this grid view two drop down box like state and city and one add button and one delete button when i click add button generate new dynamic column and when i click delete button one column are delete in grid view
and my problem is when i fill up record like state=> gujarat and city=> Ahmedabad and click add button and generate new column but city drop down are blank and i use update panel but thy are not working so nay one please give me a idea
Posted
Comments
Nirav D Parmar 24-May-13 3:47am    
pls put up your code over here which will give better understanding
for someone to solve it.
[no name] 24-May-13 5:15am    
their are 3000 lines code its not possible to put here pls give me some idea

1 solution

Hi Rashmikants,

Please save Your City Data in ViewState then on Button Add Click event when u add new DropDownlist Bind this data to That Drop DownList.

eg.
C#
ViewState["City"]=dataTable;
protected void ButtonAdd_Click(object _object, EventArgs eventArgs )
{
    DropDownList dropDownList =new DropDownList();
    dropDownList.DataSource=(DataTable)ViewState["City"];
    dropDownList.DataBind();
    //Add this To GridView
}


:) Enjoy
 
Share this answer
 
v2
Comments
[no name] 24-May-13 6:26am    
thanks

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