Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7709677
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T00:55:19+00:00 2026-06-01T00:55:19+00:00

My RadioButtonList : <asp:RadioButtonList ID=rblType runat=server selectedvalue='<%#Bind(Type)%>’ AutoPostBack=true > <asp:ListItem Text=X Value=X /> <asp:ListItem

  • 0

My RadioButtonList :

<asp:RadioButtonList ID="rblType" runat="server" selectedvalue='<%#Bind("Type")%>' AutoPostBack="true" >
         <asp:ListItem Text="X" Value="X" />
         <asp:ListItem Text="E" Value="E" />
         <asp:ListItem Text="H" Value="H" />
         <asp:ListItem Text="F" Value="F" />
         <asp:ListItem Text="A" Value="A" />
</asp:RadioButtonList>

It is inside a formview:

<asp:FormView ID="fv" runat="server" DataSourceID="ds" DataKeyNames="ChartId,Type,ItemId"
    OnModeChanged="fv_ModeChanged">

Datasource :

<asp:EntityDataSource ID="ds" runat="server" 
    ContextTypeName="Model.Entities"
    EntitySetName="ItemCharts" EnableInsert="true" EnableUpdate="true" AutoGenerateWhereClause="true"
    OnInserting="ds_Inserting" >
    <WhereParameters>
        <asp:QueryStringParameter Name="ItemId" DbType="Int32" QueryStringField="id" />
        <asp:QueryStringParameter Name="ChartId" DbType="Int32" QueryStringField="chart" />
        <asp:QueryStringParameter Name="Type" DbType="String" QueryStringField="type" />
    </WhereParameters>
</asp:EntityDataSource>

Error message :

has a SelectedValue which is invalid because it does not exist in the list of items

Cause :

The value I get from Bind() is a lower case ‘x’, the value of the ListItem is upper case ‘X’.

I have lower case ‘x’ and upper case ‘X’ in my database.

I’m trying to find a way to keep the ‘Bind’ functionnalities, and select a listItem ignoring case sensitivity.

Any suggestions?

Thank you!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T00:55:20+00:00Added an answer on June 1, 2026 at 12:55 am

    The Bind expression can be used with a custom format, but in .Net there is no way to instruct the format to “lowercase” or “uppercase” the object, so you need to build a custom format provider. I don’t know how “inject” such a provider to the Bind expression or if even it’s possible (or if it worths the effort).

    Since you are using EF, you can benefit on the partial methods used when a property is changed so you can write code to always save the Type in Uppercase.

      partial void OnTypeChanged()
            {
               if (this._Type != null)
                 this._Type = this._Type.ToUpper();
            }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using a asp.net radiobuttonlist. <asp:RadioButtonList ID=rbtnAEreq RepeatDirection=Horizontal runat=server> <asp:ListItem Text=Yes Value=true></asp:ListItem> <asp:ListItem
update question: <asp:radiobuttonlist runat=server id=rbl repeatdirection=Horizontal> <asp:listitem text=None value=0 selected=True enabled=true/> <asp:listitem text=Float Left
I have the following ASP.NET RadioButtonList: <asp:RadioButtonList ID=rbl runat=server> <asp:ListItem Text=Type1 Value=1 /> <asp:ListItem
I have a RadioButtonList with two ListItems included: <asp:RadioButtonList runat=server ID=optRollover OnSelectedIndexChanged=RolloverOptionSelected AutoPostBack=true> <asp:ListItem
I have this code: <asp:RadioButtonList ID=rblExpDate runat=server > <asp:ListItem Selected=True Text=No expiration date></asp:ListItem> <asp:ListItem
<tr step=step2 optional=true><td>Gender</td></tr> <tr step=step2 optional=true> <td> <asp:RadioButtonList ID=rblGender runat=server RepeatDirection=Horizontal> <asp:ListItem Text=Female Value=0></asp:ListItem>
I have this code <asp:RadioButtonList ID=rblSplitWeek runat=server> <asp:ListItem selected=true>No Choice</asp:ListItem> <asp:ListItem Text = First
ASPX Code <asp:RadioButtonList ID=rbServer runat=server > <asp:ListItem Value=<%=ServerDeveloper%>> Developer </asp:ListItemv <asp:ListItem Value=dev.ahsvendor.com> dev.test.com</asp:ListItem> <asp:ListItem
<asp:RadioButtonList ID=rbEmployeeGroup runat=server RepeatDirection=Horizontal AutoPostBack=true OnSelectedIndexChanged= [Call java script to check first] then rbEmployeeGroup_SelectedIndexChanged>
I have a RadioButtonList: <p> <label for=rblIAm>I am</label> <asp:RadioButtonList ID=rblIAm ValidationGroup=RegForm runat=server> <asp:ListItem Text=Gay

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.