You must Sign In to post a response.
  • Category: ASP.NET

    How to add dropdownlist selected value to data table

    In run mode as follows

    Course Code AMC (Dropdownlist1) Major Code AFF (Dropdownlist2)

    i want to add the dropdownlist1 and dropdownlist2 selected value to data table.

    for that how can i do in using c#.
  • #762201
    Hi rao,

    Without saving the records into database you want to show it into gridview...?

    If this is the case then maintain data into one table and store that information into ViewState and based on view state data you can bind your gridview. You can achieve this by following below code.

    protected void btnAdd_Click(object sender, EventArgs e)
    //Create DataTable with columns whatever you want to bind in grid.

    DataRow dr= dt.NewRow();

    //now row is inserted into your temporary table, store that into one state object.

    Whenever you want to bind data to gridview bind it from viewstate object.

    Hope this will helpful to you...

    Give respect to your work, Instead of trying to impress your boss.

    Blog :

  • Sign In to post your comments