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

Easy Drag and Drop between Radgrids?

2 Answers 69 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Robert
Top achievements
Rank 1
Robert asked on 31 Oct 2009, 01:55 PM
Do you have the source for the Radgrid Drag and drop demo from teleriktv I am trying to do what the video shows but need to convert to VB.

2 Answers, 1 is accepted

Sort by
0
digitall
Top achievements
Rank 1
answered on 31 Oct 2009, 07:38 PM
0
Robert
Top achievements
Rank 1
answered on 01 Nov 2009, 08:50 PM
Maybe I should explain a bit more in detail.

I have 2 Grids

  1. UnassignedGrid- Shows all Jobs which have not been assigned to a transcriptionist.
  2. TranscriptionistGrid- Shows a list of transcriptionist available for job assignments

My Requirements are as follows

  1. Drag and drop unassigned job(s) from the unnassignedgrid to a Transcriptionistgrid.
  2. Jobs should be able to be assigned by the drag and drop to a specific transcriptionistid within the transcriptionist grid.
  3. Be able to "Unassign" jobs by dragging the jobs back to the Unassigned grid.
  4. Must be able to drag and drop Multiple jobs between both grids.

I am basically trying to provide a quick way to assign jobs by a drag and drop to a userid in the transcriptionist grid is there a simple way to do this.

<telerik:RadScriptManager ID="RadScriptManager1" Runat="server">  
        </telerik:RadScriptManager> 
      
     
      
   
    <telerik:RadAjaxManager runat="server">  
        <AjaxSettings> 
            <telerik:AjaxSetting AjaxControlID="UnassignedGrid">  
                <UpdatedControls> 
                    <telerik:AjaxUpdatedControl ControlID="UnassignedGrid" /> 
                    <telerik:AjaxUpdatedControl ControlID="TranscriptionistGrid" /> 
                </UpdatedControls> 
            </telerik:AjaxSetting> 
            <telerik:AjaxSetting AjaxControlID="TranscriptionistGrid">  
                <UpdatedControls> 
                    <telerik:AjaxUpdatedControl ControlID="UnassignedGrid" /> 
                    <telerik:AjaxUpdatedControl ControlID="TranscriptionistGrid" /> 
                </UpdatedControls> 
            </telerik:AjaxSetting> 
        </AjaxSettings> 
    </telerik:RadAjaxManager> 
    <asp:SqlDataSource ID="PendingDictationSQL" runat="server"   
        ConnectionString="<%$ ConnectionStrings:TESTDEVConnection %>"   
          
        SelectCommand="SELECT Dictations.Dictationid, Dictations.Dictatorid, Dictations.Jobstate, CAST(Dictations.Dictatorid AS Nvarchar) + '-' + Users.FirstName + ' ' + Users.Lastname AS Dictator, Dictations.PriorityLevel, Dictations.Worktype, Dictations_JobState.Jobstate AS State FROM Dictations INNER JOIN Users ON Dictations.Dictatorid = Users.Userid INNER JOIN Dictations_JobState ON Dictations.Jobstate = Dictations_JobState.JobStateid WHERE (Dictations.Jobstate = @Jobstate) order by prioritylevel desc">  
        <SelectParameters> 
            <asp:Parameter DefaultValue="1" Name="Jobstate" Type="Int32" /> 
        </SelectParameters> 
    </asp:SqlDataSource> 
    <asp:SqlDataSource ID="AssignedDictationSQL" runat="server"   
        ConnectionString="<%$ ConnectionStrings:TESTDEVConnection %>"   
        SelectCommand="SELECT Dictations.Dictationid, Dictations.Dictatorid, Dictations.Jobstate, Dictations.AssignedTranID, Users.FirstName, Users.Lastname FROM Dictations INNER JOIN Users ON Dictations.Dictatorid = Users.Userid WHERE (Dictations.Jobstate = 2) AND (Dictations.AssignedTranID &lt;&gt; 0)">  
    </asp:SqlDataSource> 
    <asp:SqlDataSource ID="TranScriptionistlookupSQL" runat="server"   
        ConnectionString="<%$ ConnectionStrings:TESTDEVConnection %>"   
          
        SelectCommand="SELECT DISTINCT Users.Userid, Users.FirstName, Users.Lastname, (SELECT COUNT(AssignedTranID) AS Expr1 FROM Dictations WHERE (AssignedTranID = Users.Userid)) AS jobsassigned, (SELECT COUNT(AssignedTranID) AS Expr2 FROM Dictations AS Dictations_2 WHERE (AssignedTranID = Users.Userid) AND (PriorityLevel &gt; 1)) AS Priorityjobs FROM Users CROSS JOIN Dictations AS Dictations_1 WHERE (Users.UserType = 2)">  
        <SelectParameters> 
            <asp:Parameter DefaultValue="2" Name="UserType" Type="Int32" /> 
        </SelectParameters> 
    </asp:SqlDataSource> 
    <telerik:RadGrid ID="UnassignedGrid" runat="server"   
        DataSourceID="PendingDictationSQL" GridLines="None" Width="600px"   
        AllowFilteringByColumn="True" AllowMultiRowSelection="True" AllowPaging="True"   
        AllowSorting="True" ShowGroupPanel="True">  
<MasterTableView AutoGenerateColumns="False" CellSpacing="-1"   
            DataSourceID="PendingDictationSQL"   
            NoMasterRecordsText="No Un-assigned Dictations">  
<RowIndicatorColumn> 
<HeaderStyle Width="20px"></HeaderStyle> 
</RowIndicatorColumn> 
 
<ExpandCollapseColumn> 
<HeaderStyle Width="20px"></HeaderStyle> 
</ExpandCollapseColumn> 
    <Columns> 
        <telerik:GridBoundColumn DataField="Dictationid" DataType="System.Int32"   
            HeaderText="JobNumber" ReadOnly="True" SortExpression="Dictationid"   
            UniqueName="Dictationid">  
        </telerik:GridBoundColumn> 
        <telerik:GridBoundColumn DataField="Dictatorid" DataType="System.Int32"   
            HeaderText="Dictatorid" SortExpression="Dictatorid" UniqueName="Dictatorid"   
            Visible="False">  
        </telerik:GridBoundColumn> 
        <telerik:GridBoundColumn DataField="Jobstate" DataType="System.Int32"   
            HeaderText="Jobstate" SortExpression="Jobstate" UniqueName="Jobstate"   
            Visible="False">  
        </telerik:GridBoundColumn> 
        <telerik:GridBoundColumn DataField="State" HeaderText="JobState"   
            SortExpression="State" UniqueName="State">  
        </telerik:GridBoundColumn> 
        <telerik:GridBoundColumn DataField="Dictator" HeaderText="Dictator"   
            ReadOnly="True" SortExpression="Dictator" UniqueName="Dictator">  
        </telerik:GridBoundColumn> 
        <telerik:GridBoundColumn DataField="PriorityLevel" DataType="System.Byte"   
            HeaderText="PriorityLevel" SortExpression="PriorityLevel"   
            UniqueName="PriorityLevel">  
        </telerik:GridBoundColumn> 
        <telerik:GridBoundColumn DataField="Worktype" DataType="System.Byte"   
            HeaderText="Worktype" SortExpression="Worktype" UniqueName="Worktype">  
        </telerik:GridBoundColumn> 
    </Columns> 
</MasterTableView> 
        <ClientSettings AllowDragToGroup="True" AllowRowsDragDrop="True">  
            <Selecting AllowRowSelect="True" /> 
        </ClientSettings> 
    </telerik:RadGrid> 
      
    <telerik:RadSkinManager ID="RadSkinManager1" Runat="server" ShowChooser="True"   
        Skin="Sunset">  
        <TargetControls> 
            <telerik:TargetControl ControlID="UnassignedGrid" /> 
            <telerik:TargetControl ControlID="TranscriptionistGrid" /> 
        </TargetControls> 
    </telerik:RadSkinManager> 
      
    <hr /> 
    <hr /> 
    <hr /> 
   
      
    <telerik:RadGrid ID="TranscriptionistGrid" runat="server"   
        AllowFilteringByColumn="True" AllowSorting="True"   
        DataSourceID="TranScriptionistlookupSQL" GridLines="None" Width="500px">  
<MasterTableView AutoGenerateColumns="False" CellSpacing="-1"   
            DataSourceID="TranScriptionistlookupSQL">  
<RowIndicatorColumn> 
<HeaderStyle Width="20px"></HeaderStyle> 
</RowIndicatorColumn> 
 
<ExpandCollapseColumn> 
<HeaderStyle Width="20px"></HeaderStyle> 
</ExpandCollapseColumn> 
    <Columns> 
        <telerik:GridBoundColumn DataField="Userid" DataType="System.Int32"   
            HeaderText="Userid" ReadOnly="True" SortExpression="Userid" UniqueName="Userid">  
        </telerik:GridBoundColumn> 
        <telerik:GridBoundColumn DataField="FirstName" HeaderText="FirstName"   
            SortExpression="FirstName" UniqueName="FirstName">  
        </telerik:GridBoundColumn> 
        <telerik:GridBoundColumn DataField="Lastname" HeaderText="Lastname"   
            SortExpression="Lastname" UniqueName="Lastname">  
        </telerik:GridBoundColumn> 
        <telerik:GridBoundColumn DataField="jobsassigned" DataType="System.Int32"   
            HeaderText="jobsassigned" ReadOnly="True" SortExpression="jobsassigned"   
            UniqueName="jobsassigned">  
        </telerik:GridBoundColumn> 
        <telerik:GridBoundColumn DataField="Priorityjobs" DataType="System.Int32"   
            HeaderText="Priorityjobs" ReadOnly="True" SortExpression="Priorityjobs"   
            UniqueName="Priorityjobs">  
        </telerik:GridBoundColumn> 
    </Columns> 
</MasterTableView> 
        <ClientSettings> 
            <Selecting AllowRowSelect="True" /> 
        </ClientSettings> 
    </telerik:RadGrid> 
   
      
    </form> 
    </body> 
</html> 
 

Tags
Grid
Asked by
Robert
Top achievements
Rank 1
Answers by
digitall
Top achievements
Rank 1
Robert
Top achievements
Rank 1
Share this question
or