This is a migrated thread and some comments may be shown as answers.

Grab selected value RadDropDownList

1 Answer 88 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Thijs
Top achievements
Rank 1
Thijs asked on 08 Jan 2016, 02:44 PM

All,

 

I am new with Telerik and to this forum. I'm working on a Radgrid with a dropdown box that will be populated on pre-render. This works fine and the values come in as expected. However, when I try to grab them they will not appear in newValues. If I change the RadDropDownList back to a GrindBoundColumn the function works as expected.

Any help is appreciated! Thanks!

ASPX:

      <telerik:GridTemplateColumn HeaderText="Bin #" HeaderStyle-Width="260px" DataField="Bin_no" UniqueName="Mat_Bin_no">
                                        <ItemTemplate>
                                            <telerik:RadDropDownList runat="server" ID="rddBin_no" Width="250px" 
                                                DataTextField="Bin_no" DataValueField="Bin_no">
                                            </telerik:RadDropDownList>
                                        </ItemTemplate>
                                    </telerik:GridTemplateColumn>

 

VB:

  Private Function FindMaterialData(ByVal sender As Object, ByVal e As GridBatchEditingEventArgs, sOrdNo As String, sLoc As String) As Boolean
        Dim bErrorsFound As Boolean = False
        Dim p_iWisysReturnValue As Integer = 0
       
        Dim iSequenceNo As String
        Dim sItemNo As String
        Dim sBin As String
        Dim sSerialLot As String
        Dim dqty As Double
        Dim dtExpDate As Date
        Dim e2 As Telerik.Web.UI.GridItemEventArgs
        Dim bIsEdited As Boolean = True
        Dim lOffset As Long = 0
        
        
        For Each row As GridDataItem In rgMaterial.Items
                 
            Dim Command As GridBatchEditingCommand
            Try
                Command = e.Commands.Item(row.ItemIndex - lOffset)
                If Command.Item.DataSetIndex <> row.ItemIndex Then
                    bIsEdited = False
                    lOffset = lOffset + 1
                Else
                    bIsEdited = True
                End If
            Catch
                bIsEdited = False
            End Try
            
            iSequenceNo = row("Mat_seq_no").Text
            sItemNo = row("Mat_item_no").Text
            
          
            ''Edited rows
            If bIsEdited Then
                Dim newValues As Hashtable = Command.NewValues
                Dim oldValues As Hashtable = Command.OldValues
                
                sSerialLot = newValues("ser_lot_no")
                sBin = newValues("bin_no")
                dqty = newValues("QtyRemaining")
            Else
           
                'Non edited rows
                sSerialLot = row("Mat_ser_lot_no").Text
                sBin = row("Mat_bin_no").Text
                dqty = row("Mat_QtyRemaining").Text

            End If
            If dqty <> 0 Then
               doSomething()
            End If
        Next
        FindMaterialData = Not bErrorsFound
    End Function

1 Answer, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 13 Jan 2016, 09:50 AM
Hello Thijs,

Please note that Batch editing mode is different than other modes. You can find a detailed explanation in the following section:
http://docs.telerik.com/devtools/aspnet-ajax/controls/grid/rows/accessing-cells-and-rows#accessing-controls-in-batch-edit-mode


You can find related information for implementing Batch editing with templates in this article:
http://docs.telerik.com/devtools/aspnet-ajax/controls/grid/data-editing/edit-mode/batch-editing/working-with-templates

Hope this helps.

Regards,
Eyup
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
General Discussions
Asked by
Thijs
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Share this question
or