Hi friends,
I Have gridview by default no columns declared in the aspx page. I declared the columns dynamically based on the requirement. I have a subject dropdownlist control ,inwhich selectedIndexchanged event I created dynamic columns(label,and textbox) show in the page.. For label control I bind the data from database and for Textbox i just enter the data from here. Outside the gridview I Have the button for save this gridview value to database.In button click event i would like call the gridview data for saving in the database. But I Have an issue with gridview state level.In this button click event postback, gridview loses their data value,so i cannot able to read the data from gridview. what is my task is I want to read the gridview data to save to database. help me.
I post my code previously. but no result. i tried my level best.
how can maintain viewstate for gridview for different postback[^]
Loading
Jaganathan BantheswaranPosted Oct 6, 2013, 5:14 AM
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
BindGrid();
}
}
protected void BindGrid()
{
//Based on the dropdown selection, create column here
GridView1.DataSource = CreateDataSource();
GridView1.DataBind();
}
baskaran chellasamyPosted Oct 5, 2013, 1:44 AM
Jaganathan BantheswaranPosted Oct 4, 2013, 2:25 PM