DropDownList Value Not in Hashtable

2 posts, 0 answers
  1. Ray
    Ray avatar
    1 posts
    Member since:
    Apr 2014

    Posted 11 Jul Link to this post

    I have an application for training attendance where a column in the database is a varchar but when editing the record they want a dropdown with Yes|No values. That is fine however, when updating the the records the UpdateCommand does not the dropdown values in the Hashtable.

    BTW - the edimode for the grid is "InPlace".

    Any help would greatly be appreciated. Thanks

     

    ASPX

    <telerik:GridTemplateColumn DataField="Attended" HeaderText="Attended" AllowFiltering="false">
                        <ItemTemplate>
                            <asp:Label ID="AttendedLabel" runat="server" Text='<%# Eval("Attended") %>'></asp:Label>
                        </ItemTemplate>
                    <EditItemTemplate>
                        <telerik:RadDropDownList ID="ddAttended" runat="server" Width="55px">
                            <Items>
                                <telerik:DropDownListItem Text="" />
                                <telerik:DropDownListItem Text="Yes" />
                                <telerik:DropDownListItem Text="No" />
                            </Items>
                        </telerik:RadDropDownList>
                    </EditItemTemplate>
                </telerik:GridTemplateColumn>

    VB

     

    Protected Sub rgCourse_ItemCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs)
            If (e.CommandName = "UpdateAll") Then
                For Each editedItem As GridEditableItem In rgCourse.EditItems
                    Dim newValues As Hashtable = New Hashtable
                    'The GridTableView will fill the values from all editable columns in the hash
                    e.Item.OwnerTableView.ExtractValuesFromItem(newValues, editedItem)
                    dsCourses.UpdateCommand = String.Format("Update vwCurrentCourse SET Attended='{0}' WHERE Registration_ID='{1}'", newValues("Attended").ToString(), editedItem.GetDataKeyValue("Registration_ID").ToString())
                    dsCourses.Update()
     
                    editedItem.Edit = Falsetable
                Next
            End If
            rgCourse.Rebind()
        End Sub

  2. Eyup
    Admin
    Eyup avatar
    3005 posts

    Posted 14 Jul Link to this post

    Hello Ray,

    I've already replied to your ticket with ID: 1049853. I suggest that we continue our conversation on the mentioned thread if there are any further questions.

    Regards,
    Eyup
    Telerik by Progress
    Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top