Bind to template column problem

3 posts, 1 answers
  1. Steve
    Steve avatar
    4 posts
    Member since:
    Aug 2015

    Posted 07 Apr 2016 Link to this post

    I'm trying to bind to a templated column with a radDropDownList control in it. I am using editmode=batch on the grid. So when editing no events are fired server side.

    How do I go about binding to the dropdownlist when the grid is populated server side. I tried binding to the dropdownlist when the grid is built server side in the itemdatabound event but the e.Item.FindControl("radddlParameterId") does not find the control.

    I want the grid to show text and then when edited switch to the populated dropdownlist that the user can select from.



  2. Answer
    Eyup avatar
    4084 posts

    Posted 12 Apr 2016 Link to this post

    Hello Steve,

    Please note that Batch editing mode is different than other modes. You can find a detailed explanation in the following section:

    You can check the following live sample:

    If you need to implement more complex template configuration, you can use:

    I hope this will prove helpful.

    Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
  3. Steve
    Steve avatar
    4 posts
    Member since:
    Aug 2015

    Posted 14 Apr 2016 in reply to Eyup Link to this post

    Thanks Eyup. The live sample led me in the right direction. What I was looking for was this:

    Protected Sub radgrdTableColumns_PreRender(sender As Object, e As EventArgs)

             Dim objParameterDropList As RadDropDownList = DirectCast(radgrdTableColumns.MasterTableView.GetBatchEditorContainer("Parameter_Id").Controls(1), RadDropDownList)
             Dim objParameterDs As DataSet
             objParameterDs = m_objDb.GetParameters()
             If objParameterDs IsNot Nothing AndAlso objParameterDs.Tables IsNot Nothing Then
                objParameterDropList.DataValueField = "Parameter_Id"
                objParameterDropList.DataTextField = "Description"
                objParameterDropList.DataSource = objParameterDs.Tables(0)
             End If

    end Sub

Back to Top