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 8427347
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T04:45:36+00:00 2026-06-10T04:45:36+00:00

I have placed a checkboxlist in a formview object. I would like to store

  • 0

I have placed a checkboxlist in a formview object.
I would like to store and load the results of the checkboxlist in a table of an entity framework.

I filled the cbl with values and labels coming from a table that has 2 columns, using the DataSourceID, DataTextField and DataValueField attributes but I can’t seem to find how to bind the cbl to the entity framework object in order to store the checked values when the formview is in “EDIT” mode.

Any help would be appreciate. Thanks!

<asp:FormView ID="formView1" runat="server" DataSourceID="Ods1" 
        Height="203px" Width="495px" 
        onpageindexchanging="formView1_PageIndexChanging">
<EditItemTemplate>
    <asp:CheckBoxList ID="cblProducts" runat="server" RepeatColumns="3" 
                Width="782px" DataSourceID="SqlDataSource1" DataTextField="ProductName" 
                DataValueField="ProductCode">
    </asp:CheckBoxList>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                ConnectionString="<%$ ConnectionStrings:ApplicationServices %>" 
                SelectCommand="SELECT [ProductCode], [ProductName] FROM [Products]">
    </asp:SqlDataSource>
</EditItemTemplate>
</asp:FormView>
    <asp:ObjectDataSource ID="Ods1" runat="server" 
        DataObjectTypeName="WebApplication1.EDM.Emp" DeleteMethod="DeleteEmp" 
        InsertMethod="CreateNewEmp" OldValuesParameterFormatString="original_{0}" 
        SelectMethod="GetEmpByEmpId" TypeName="WebApplication1.EDM.EmpLogic" 
        UpdateMethod="UpdateEmp" OnSelecting="Ods1_Selecting">
        <SelectParameters>
            <asp:RouteParameter Name="EmpId" RouteKey="EmpId" Type="String" />
        </SelectParameters>
    </asp:ObjectDataSource>
  • 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-10T04:45:38+00:00Added an answer on June 10, 2026 at 4:45 am
    <asp:FormView ID="formView1" runat="server" 
         OnItemUpdating="formView1_ItemUpdating" ...>
    
    protected void formView1_ItemUpdating(object sender, FormViewUpdateEventArgs e)
    {
       var cblProducts = formView1.FindControl("cblProducts") as CheckBoxList;
    
       foreach (ListItem item in cblProducts.Items)
       {
           if (item.Selected)
           {
               // Check if item.Value is not in the db for this employee, if so add it
           }
           else
           {
               // Check if item.Value is in the db for this employee, if so delete it
           }
       }
    
       // save
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to further annotate the custom markers I have placed on a
I have multiple Node applications (build on Express framework). Now I have placed them
I have placed a form on a page which looks like this: <form id=editClassList
I have placed in ArrayAdapter an ImageView, the list looks like this: Name1 |ImageView|
I have multiple sprites placed onto a background sprite like this: //my background CCSprite
I have placed a file programmatically in documents folder on iPhone like below. NSFileManager
I have placed the facebook like button on a website, and the weirdest thing
I am new to zend framework.I have placed my bin and library folder in
I have placed a p tag in a td , like so: <html> <head>
I have placed an Image as a button in my App and I want

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.