Click here to Skip to main content
11,488,877 members (78,018 online)
   

ASP.NET

 
GeneralRe: ASP.NET Pin
Sandeep Mewara5-Mar-13 0:02
mvpSandeep Mewara5-Mar-13 0:02 
GeneralRe: ASP.NET Pin
Varadha Raj5-Mar-13 1:02
memberVaradha Raj5-Mar-13 1:02 
AnswerRe: ASP.NET Windows Application Pin
Muhammad Aqib Shehzad5-Mar-13 1:55
memberMuhammad Aqib Shehzad5-Mar-13 1:55 
GeneralRe: ASP.NET Windows Application Pin
Varadha Raj5-Mar-13 2:17
memberVaradha Raj5-Mar-13 2:17 
AnswerRe: ASP.NET Pin
Howard Richards5-Mar-13 4:21
memberHoward Richards5-Mar-13 4:21 
QuestionDataset Pin
berba4-Mar-13 2:00
memberberba4-Mar-13 2:00 
AnswerRe: Dataset Pin
Blikkies4-Mar-13 4:05
memberBlikkies4-Mar-13 4:05 
Questiondropdownlist auto select first value in gridview with edit mode Pin
demoninside93-Mar-13 21:30
memberdemoninside93-Mar-13 21:30 
Hi,

actually I have bounded a dropdownlist in gridview in edit mode, but the problem is that whenever i try to select another value from dropdownlist, it auto select the first value.

I also used !IsPostBack property on page_load event but still it is not selecting the another items.

<pre lang="c#">
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
      if (e.Row.RowType == DataControlRowType.DataRow)
      {
            if ((e.Row.RowState & DataControlRowState.Edit) > 0)
            {

                  DropDownList ddlCost_Code = DropDownList)e.Row.FindControl("ddlCost_Code");

                  BAL bl = new BAL();
                  DataTable dt_for_CostCode = null;

                  dt_for_CostCode = bl.Select_Cost_Code();
                  if (dt_for_CostCode.Rows.Count > 0)
                  {
                        ddlCost_Code.DataSource = dt_for_CostCode;
                        ddlCost_Code.DataTextField = "Cost_Code";
                        ddlCost_Code.DataValueField = "Proposalno";
                        ddlCost_Code.DataBind();
                  }

}


   if (!IsPostBack)
      {


            try
            {

                  Log_Booked_Info_Through_Booking_Table();


            }
            catch (Exception ex)
            {
                  WebMsgBox.Show(ex.Message);
            }
      }

}
</pre>
AnswerRe: dropdownlist auto select first value in gridview with edit mode Pin
Karthik Harve3-Mar-13 22:44
memberKarthik Harve3-Mar-13 22:44 
GeneralRe: dropdownlist auto select first value in gridview with edit mode Pin
demoninside93-Mar-13 22:56
memberdemoninside93-Mar-13 22:56 
GeneralRe: dropdownlist auto select first value in gridview with edit mode Pin
Karthik Harve3-Mar-13 23:00
memberKarthik Harve3-Mar-13 23:00 
GeneralRe: dropdownlist auto select first value in gridview with edit mode Pin
demoninside93-Mar-13 23:13
memberdemoninside93-Mar-13 23:13 
GeneralRe: dropdownlist auto select first value in gridview with edit mode Pin
Karthik Harve3-Mar-13 23:23
memberKarthik Harve3-Mar-13 23:23 
GeneralRe: dropdownlist auto select first value in gridview with edit mode Pin
demoninside93-Mar-13 23:27
memberdemoninside93-Mar-13 23:27 
GeneralRe: dropdownlist auto select first value in gridview with edit mode Pin
Karthik Harve4-Mar-13 0:23
memberKarthik Harve4-Mar-13 0:23 
GeneralRe: dropdownlist auto select first value in gridview with edit mode Pin
demoninside94-Mar-13 0:35
memberdemoninside94-Mar-13 0:35 
GeneralRe: dropdownlist auto select first value in gridview with edit mode Pin
Karthik Harve4-Mar-13 0:38
memberKarthik Harve4-Mar-13 0:38 
GeneralRe: dropdownlist auto select first value in gridview with edit mode Pin
demoninside94-Mar-13 0:53
memberdemoninside94-Mar-13 0:53 
GeneralRe: dropdownlist auto select first value in gridview with edit mode Pin
Karthik Harve4-Mar-13 0:59
memberKarthik Harve4-Mar-13 0:59 
GeneralRe: dropdownlist auto select first value in gridview with edit mode Pin
demoninside94-Mar-13 0:57
memberdemoninside94-Mar-13 0:57 
GeneralRe: dropdownlist auto select first value in gridview with edit mode Pin
Karthik Harve4-Mar-13 1:04
memberKarthik Harve4-Mar-13 1:04 
Questionhow to make multiple entries for a book in database for multiple copies of the same book in a library? Pin
Madhubala Ganesan2-Mar-13 7:33
memberMadhubala Ganesan2-Mar-13 7:33 
AnswerRe: how to make multiple entries for a book in database for multiple copies of the same book in a library? Pin
Bernhard Hiller3-Mar-13 21:35
memberBernhard Hiller3-Mar-13 21:35 
QuestionJson + asp.net Pin
jojoba20112-Mar-13 5:45
memberjojoba20112-Mar-13 5:45 
AnswerRe: Json + asp.net Pin
jkirkerx4-Mar-13 11:36
memberjkirkerx4-Mar-13 11:36 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Web02 | 2.8.150520.1 | Last Updated 27 May 2015
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid