Click here to Skip to main content
15,888,351 members
Home / Discussions / ASP.NET
   

ASP.NET

 
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 
AnswerRe: Dropdownlist not displaying selectedItem in GridView - Resolved Pin
meeram3957-Jun-10 1:41
meeram3957-Jun-10 1:41 
GeneralRe: Dropdownlist not displaying selectedItem in GridView - Resolved Pin
michaelschmitt7-Jun-10 1:45
michaelschmitt7-Jun-10 1:45 
QuestionDateFormat Problem in ASP.NET Pin
sharad Pyakurel6-Jun-10 21:57
sharad Pyakurel6-Jun-10 21:57 
AnswerRe: DateFormat Problem in ASP.NET Pin
saini arun6-Jun-10 22:06
saini arun6-Jun-10 22:06 
AnswerRe: DateFormat Problem in ASP.NET Pin
walterhevedeich6-Jun-10 22:47
professionalwalterhevedeich6-Jun-10 22:47 
GeneralRe: DateFormat Problem in ASP.NET Pin
sharad Pyakurel7-Jun-10 1:38
sharad Pyakurel7-Jun-10 1:38 
GeneralRe: DateFormat Problem in ASP.NET Pin
walterhevedeich7-Jun-10 2:28
professionalwalterhevedeich7-Jun-10 2:28 
AnswerRe: DateFormat Problem in ASP.NET [modified] Pin
kupps7-Jun-10 21:09
kupps7-Jun-10 21:09 
GeneralRe: DateFormat Problem in ASP.NET Pin
sharad Pyakurel8-Jun-10 18:08
sharad Pyakurel8-Jun-10 18:08 
AnswerRe: DateFormat Problem in ASP.NET Pin
Goutam Patra29-Jun-10 3:03
professionalGoutam Patra29-Jun-10 3:03 
QuestionTabContainer cannot have children of type 'System.Web.UI.UpdatePanel'. Pin
developerit6-Jun-10 21:05
developerit6-Jun-10 21:05 
AnswerRe: TabContainer cannot have children of type 'System.Web.UI.UpdatePanel'. Pin
Jamil Hallal6-Jun-10 21:55
professionalJamil Hallal6-Jun-10 21:55 
QuestionHow to be man in the middle for a http communication!! Pin
Nadia Monalisa6-Jun-10 19:57
Nadia Monalisa6-Jun-10 19:57 
AnswerRe: How to be man in the middle for a http communication!! Pin
Adam R Harris7-Jun-10 4:15
Adam R Harris7-Jun-10 4:15 
GeneralRe: How to be man in the middle for a http communication!! Pin
Nadia Monalisa7-Jun-10 8:51
Nadia Monalisa7-Jun-10 8:51 
GeneralRe: How to be man in the middle for a http communication!! Pin
Adam R Harris7-Jun-10 9:18
Adam R Harris7-Jun-10 9:18 

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.