Drag and Drop Single Grid

2 posts, 0 answers
  1. David Gunderson
    David Gunderson avatar
    13 posts
    Member since:
    Apr 2010

    Posted 31 May 2011 Link to this post

    What I am trying to do is reorder a set of questions.  What i pull into the grid is the
    intQuestionID, strQuestion and the intOrder

    What I want to be able to do is drag and drop and reorder the questions, do you have an example of doing this only server side using the Radgrid_rowDrop.

                                    <td align="left"><telerik:RadGrid ID="myRad" runat="server" ClientSettings-AllowRowsDragDrop="true" ClientSettings-Selecting-AllowRowSelect="true"
                                        <MasterTableView AutoGenerateColumns="false" DataKeyNames="intQuestionId">
                                        <HeaderStyle ForeColor="White" CssClass="backColor" BackColor="Steelblue" Font-Bold="true" BorderColor="#404040" BorderWidth="1px" />
                                                <telerik:GridDragDropColumn HeaderStyle-Width="18px"></telerik:GridDragDropColumn>
                                                <telerik:GridBoundColumn DataField="strQuestion" HeaderText="Question"></telerik:GridBoundColumn>
                                                <telerik:GridBoundColumn DataField="IntOrder" HeaderText="Order"></telerik:GridBoundColumn>

     Protected Sub ddlQuestions_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ddlQuestions.SelectedIndexChanged
            Dim catId As String = ddlQuestions.SelectedValue

            If catId = "0" Then
                ScriptManager.RegisterClientScriptBlock(Page, GetType(Page), "OpenWindow", "PickCategory();", True)
            End If
        End Sub

    Private Sub FillGrid()
            Dim CatId As String = ddlQuestions.SelectedValue
            Dim itemCount As Integer = 0

            sql = "Select intQuestionId, strQuestion, intOrder from tblSRPQuestion where intCategoryID = " & CatId
            myDataTable = New DataTable
            myDataTable = getData(sql)

            myRad.DataSource = getData(sql)

        End Sub

        Protected Sub myRad_RowDrop(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridDragDropEventArgs) Handles myRad.RowDrop

        End Sub

  2. Mira
    Mira avatar
    1124 posts

    Posted 01 Jun 2011 Link to this post

    Hello David,

    Please examine the Drag and drop to reorder rows in grid code library to see how the desired functionality can be implemented.

    I hope this helps.

    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

  3. DevCraft R3 2016 release webinar banner
Back to Top