Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

dropdownlist selected Index remains zero.

10 views
Skip to first unread message

Harsha

unread,
Nov 24, 2009, 1:24:02 AM11/24/09
to

Hi,

I have a ModalPopupExtender in my page. And In popup I am showing a
gridview. Inside Gridview a dropdownlist is there.

In pop there is a submitt button. But problem is in dropdownlist selected
index remains zero irespective of my selection. Even after I select
second,third or fourth Item ti will show first item of the dropdown as the
selected Item. Please help.

Also, all my code

Please let me know why dropdownlist selected item is not getting changed ?
My Code is as below.

Code to bind gridview in popup window :-
1. protected void btnSearch_Click(object sender, EventArgs e)
2. {
3. DataTable dtContract = new DataTable();
4. dtContract = objBLTimesheet.RunQuery(query);
5.
6.
7. gvOrders.DataSource = dtContract;
8. gvOrders.DataBind();
9. }

And I am binding dropdownlist inside Gridview at RowDataBound Event as below:-
# protected void gvOrders_RowDataBound(object sender, GridViewRowEventArgs
e)
# {
# if (e.Row.RowType == DataControlRowType.DataRow)
# {
# string Ordrno = rw.Cells[0].Text;
# string query = "select MCSRLNO,FOORD from mccommdata";
# DataTable dtmcslorder = new DataTable();
# dtmcslorder = objBLTimesheet.RunQuery(query);
# if (dtmcslorder.Rows.Count > 0)
# {
#
((DropDownList)rw.FindControl("ddlSlnoOrder")).DataSource = dtmcslorder;
#
((DropDownList)rw.FindControl("ddlSlnoOrder")).DataTextField = "MCSRLNO";
#
((DropDownList)rw.FindControl("ddlSlnoOrder")).DataValueField = "FOORD";
#
((DropDownList)rw.FindControl("ddlSlnoOrder")).DataBind();
#
# }
#
# }

Alexey Smirnov

unread,
Nov 25, 2009, 3:29:49 AM11/25/09
to

You code doesn't show where you do the submit. It might be that you
rebind gvOrders again...

0 new messages