Automatic Update Checkboxes with Datasource?

3 posts, 0 answers
  1. Stefan
    Stefan avatar
    58 posts
    Member since:
    Jan 2013

    Posted 23 Apr 2013 Link to this post

    This is probally easy question for somebody but I am a little green to Telerik and Ajax.  I have a radlistbox bound to a datasource, it has 3 fields, id, desc and flag.  I have it populating just fine but what fires the automatic update event?  All the items that are flag are on or off as they should be but when I click the checkbox to turn an item on or off the listbox doesn't even appear to do anything.  Do I need some code behind other than automatic updates = true and post back = true to make the update to the checkbox save to the database? 

                <telerik:RadListBox ID="lbOrgLevels" runat="server" DataSourceID="sqlGetOrgLevels" DataKeyField="OrgLevelID" CheckBoxes ="true" style="top: 0px; left: 0px; width: 459px" OnItemDataBound="lbOrgLevels_ItemDataBound" AllowAutomaticUpdates="True" AutoPostBack="True" Skin="Sitefinity" DataSortField="OrgLevelDescription" DataTextField="OrgLevelDescription" DataValueField="Active">

                    <asp:Parameter Direction="Input" Name="Active" Type="Boolean"></asp:Parameter>
                    <asp:Parameter Direction="Input" Name="OrgLevelID" Type="Int32"></asp:Parameter>

    Protected Sub lbOrgLevels_ItemDataBound............
            e.Item.Text = (DirectCast(e.Item.DataItem, DataRowView))("OrgLevelID").ToString().Trim() _
                     + "- " + (DirectCast(e.Item.DataItem, DataRowView))("OrgLevelDescription").ToString().Trim()

            e.Item.Value = (DirectCast(e.Item.DataItem, DataRowView))("Active").ToString()
            e.Item.Checked = (DirectCast(e.Item.DataItem, DataRowView))("Active").ToString()
    End Sub

    thanks for any help.
  2. Stefan
    Stefan avatar
    58 posts
    Member since:
    Jan 2013

    Posted 25 Apr 2013 Link to this post

    Anyone? I am still stuck on how to make the checkboxes update automically with the DB when checked or unchecked.
  3. DevCraft R3 2016 release webinar banner
  4. Nencho
    Nencho avatar
    1446 posts

    Posted 26 Apr 2013 Link to this post

    Hello Stefan,

    The desired functionality could not be achieved with the Automatic Updates approach, because it is implemented, regarding the main operations of the RadListBox - transfer, reorder, delete.

    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top