Click here to Skip to main content
15,911,762 members
Home / Discussions / ASP.NET
   

ASP.NET

 
Answerfind answer Pin
Amit Patel19857-Jun-10 0:52
Amit Patel19857-Jun-10 0:52 
GeneralRe: find answer Pin
Not Active7-Jun-10 4:51
mentorNot Active7-Jun-10 4:51 
Questionon dropdownlist selected indexchange event the fiel upload data is lost Pin
developerit7-Jun-10 0:08
developerit7-Jun-10 0:08 
AnswerRe: on dropdownlist selected indexchange event the fiel upload data is lost Pin
Eduard Keilholz7-Jun-10 0:17
Eduard Keilholz7-Jun-10 0:17 
GeneralRe: on dropdownlist selected indexchange event the fiel upload data is lost Pin
The solution7-Jun-10 0:42
The solution7-Jun-10 0:42 
GeneralRe: on dropdownlist selected indexchange event the fiel upload data is lost Pin
developerit7-Jun-10 1:49
developerit7-Jun-10 1:49 
AnswerRe: on dropdownlist selected indexchange event the fiel upload data is lost Pin
maltova8-Jun-10 0:09
maltova8-Jun-10 0:09 
QuestionGet month name and last date form date time Pin
Amit Patel19857-Jun-10 0:04
Amit Patel19857-Jun-10 0:04 
AnswerRe: Get month name and last date form date time Pin
Eduard Keilholz7-Jun-10 0:15
Eduard Keilholz7-Jun-10 0:15 
GeneralRe: Get month name and last date form date time Pin
maltova8-Jun-10 0:29
maltova8-Jun-10 0:29 
AnswerRe: Get month name and last date form date time Pin
Refwah8-Jun-10 5:01
Refwah8-Jun-10 5:01 
Questionproblem in displaying money in grid view. Pin
souravghosh186-Jun-10 23:07
souravghosh186-Jun-10 23:07 
AnswerRe: problem in displaying money in grid view. Pin
michaelschmitt6-Jun-10 23:29
michaelschmitt6-Jun-10 23:29 
GeneralRe: problem in displaying money in grid view. Pin
souravghosh187-Jun-10 0:21
souravghosh187-Jun-10 0:21 
GeneralRe: problem in displaying money in grid view. Pin
michaelschmitt7-Jun-10 1:56
michaelschmitt7-Jun-10 1:56 
GeneralRe: problem in displaying money in grid view. Pin
Goutam Patra7-Jun-10 2:58
professionalGoutam Patra7-Jun-10 2:58 
AnswerRe: problem in displaying money in grid view. Pin
The solution7-Jun-10 0:45
The solution7-Jun-10 0:45 
Questioncan't see the background-image of a master page Pin
benams6-Jun-10 22:47
benams6-Jun-10 22:47 
AnswerRe: can't see the background-image of a master page Pin
saini arun6-Jun-10 22:58
saini arun6-Jun-10 22:58 
QuestionDropdownlist not displaying selectedItem in GridView Pin
meeram3956-Jun-10 22:03
meeram3956-Jun-10 22:03 
AnswerRe: Dropdownlist not displaying selectedItem in GridView Pin
michaelschmitt6-Jun-10 23:19
michaelschmitt6-Jun-10 23:19 
GeneralRe: Dropdownlist not displaying selectedItem in GridView Pin
meeram3956-Jun-10 23:52
meeram3956-Jun-10 23:52 
GeneralRe: Dropdownlist not displaying selectedItem in GridView Pin
michaelschmitt7-Jun-10 0:06
michaelschmitt7-Jun-10 0:06 
GeneralRe: Dropdownlist not displaying selectedItem in GridView Pin
meeram3957-Jun-10 0:31
meeram3957-Jun-10 0:31 
Ok. Thanks a lot Michael. I have EditItemTemplate and ItemTemplate. As you said, I checked now only the dropdownlist and I'm getting the object. But how will I fix the selected value. Still it is displaying only the first value.

<asp:TemplateField HeaderText="REGIONCODE" SortExpression="REGIONCODE">
                <EditItemTemplate>
                    <asp:DropDownList ID="RegionCodeList" runat="Server" AppendDataBoundItems="true" >
                     <asp:ListItem Text="AM" ></asp:ListItem>
                    <asp:ListItem Text="US" ></asp:ListItem>
                    <asp:ListItem Text="EU"></asp:ListItem>
                    <asp:ListItem Text="JP" ></asp:ListItem>
                    <asp:ListItem Text="AS" ></asp:ListItem>
                    <asp:ListItem Text="OF" ></asp:ListItem>
                    </asp:DropDownList>
                </EditItemTemplate>
                    <ItemTemplate>            
                        <asp:Label ID="lblcountry" runat="server" Text = '<%# Eval("REGIONCODE") %>'></asp:Label>
                    </ItemTemplate>
            </asp:TemplateField>


As per the above, it always show the selected value as 'AM' rather than 'EU' which is the actual value selected. Following is my RowDataBoundEvent.
protected void grdTCCRics_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        

        if (e.Row.RowType == DataControlRowType.DataRow)
        {  
            
            if ((e.Row.RowState & DataControlRowState.Edit) > 0)
            {
                DropDownList ddlRegion = (DropDownList)e.Row.FindControl("RegionCodeList");
                if (ddlRegion != null)
                {
                    string strregion = ddlRegion.SelectedItem.Text;
                } 
                
            }
        }

Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.

GeneralRe: Dropdownlist not displaying selectedItem in GridView Pin
michaelschmitt7-Jun-10 1:43
michaelschmitt7-Jun-10 1:43 

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

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