Drag&Drop from listbox to grid

2 posts, 1 answers
  1. Stefania
    Stefania avatar
    107 posts
    Member since:
    May 2013

    Posted 07 Feb 2014 Link to this post

    Hi,
    Inside my grid I have a NestedViewTemplate with Listbox and grid.

    <telerik:RadGrid ID="TaskRadGrid" runat="server" OnNeedDataSource="RadGrid_NeedDataSource"
     AllowPaging="True" OnItemCommand="RadGrid_ItemCommand"
                    AllowSorting="True" OnItemInserted="RadGrid_ItemInserted" OnPreRender="RadGrid_PreRender"
                    OnItemDataBound="RadGrid_ItemDataBound">
                    <MasterTableView AutoGenerateColumns="False" DataKeyNames="Id, Ambiente, Asset.Id"
                        HierarchyLoadMode="Client" Name="Task" CommandItemDisplay="Top">
                        <NestedViewTemplate>
                            <div style="width: 100%">
    <telerik:RadSplitter ID="RadSplitter1" runat="server" Height="250" Width="100%">
        <telerik:RadPane ID="MiddlePane" runat="server">
                                        <telerik:RadSplitter ID="RadSplitter2" runat="server" Height="400" Width="100%">
                                            <telerik:RadPane ID="RadPane1" runat="server" Width="24" Scrolling="None" Height="100px">
                                                <telerik:RadSlidingZone ID="RadSlidingZone1" runat="server" Width="24" ClickToOpen="true"
                                                    Height="100px">
                                                    <telerik:RadSlidingPane ID="CatalogOperationsRadSlidingPane" Title="Catalog operations (Drag&Drop record into the grid)" runat="server" Height="100px" DockOnOpen="true"
                                                        IconUrl="img/gears.png" Width="150px">
                                                        <asp:ListBox runat="server" ID="CatalogOperationListBox" DataTextField="CodeAndDescription" DataValueField="Id"
                                                        EnableDragAndDrop="True"                                                  
                                                        Width="100%" Height="100%"></asp:ListBox>
                                                    </telerik:RadSlidingPane>
                                                </telerik:RadSlidingZone>
                                            </telerik:RadPane>
                                            <telerik:RadSplitBar ID="RadSplitBar2" runat="server">
                                            </telerik:RadSplitBar>
                                            <telerik:RadPane ID="RadPane2" runat="server" Width="100%">
                                                <telerik:RadGrid ID="TaskOperationsRadGrid" runat="server" OnNeedDataSource="TaskOperationsRadGrid_NeedDataSource"
                                               OnItemCommand="TaskOperationsRadGrid_ItemCommand"
                                                OnItemDataBound="TaskOperationsRadGrid_ItemDataBound" >
                                                    <MasterTableView AutoGenerateColumns="False" EditMode="InPlace" DataKeyNames="Id, Ambiente"
                                                        Name="TaskOperations" CommandItemDisplay="Top">
                                                        <CommandItemSettings AddNewRecordText="" RefreshText="" />                                       
                                                        <Columns>
                                                            <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn"
                                                                HeaderStyle-Width="70px" UpdateImageUrl="App_Themes/Default/Grid/Update.gif"
                                                                EditImageUrl="App_Themes/Default/Grid/Edit.gif" CancelImageUrl="App_Themes/Default/Grid/Cancel.gif"
                                                                InsertImageUrl="App_Themes/Default/Grid/Update.gif">
                                                                <HeaderStyle Width="70px"></HeaderStyle>
                                                            </telerik:GridEditCommandColumn>
                                                            <telerik:GridBoundColumn DataField="CodeAndDescription" HeaderText="Operation" SortExpression="CodeAndDescription"
                                                                HeaderStyle-Width="120px" MaxLength="45" UniqueName="Operation">
                                                                <HeaderStyle Width="120px"></HeaderStyle>
                                                            </telerik:GridBoundColumn>
                                                          
                                                            <telerik:GridBoundColumn DataField="Remarks" HeaderText="Remarks" SortExpression="Remarks"
                                                                HeaderStyle-Width="120px" MaxLength="45" UniqueName="Remarks">
                                                                <HeaderStyle Width="120px"></HeaderStyle>
                                                            </telerik:GridBoundColumn>
                                                            <telerik:GridButtonColumn Text="Delete" CommandName="Delete" UniqueName="DeleteColumn"
                                                                ButtonType="ImageButton" ConfirmText="Are you sure?" HeaderStyle-Width="35px"
                                                                ImageUrl="App_Themes/Default/Grid/Delete.gif">
                                                                <HeaderStyle Width="35px"></HeaderStyle>
                                                            </telerik:GridButtonColumn>
                                                        </Columns>
                                                        <EditFormSettings>
                                                            <EditColumn ButtonType="ImageButton" />
                                                        </EditFormSettings>
                                                    </MasterTableView>
                                                    <ClientSettings>
                                                        <ClientEvents OnRowDblClick="RowDblClick" OnHierarchyExpanding="CollapseOtherRows">
                                                        </ClientEvents>
                                                    </ClientSettings>
                                                </telerik:RadGrid>
                                            </telerik:RadPane>
                                        </telerik:RadSplitter>
                                    </telerik:RadPane>
                                </telerik:RadSplitter>
      </div>
                        </NestedViewTemplate>
                        <Columns>
    .....
    </Column>
    </MasterTableView>
      </telerik:RadGrid>

    I want to drag item from listbox to radgrid. Is it possible?
    Do you have some example?

    Thanks
  2. Answer
    Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 10 Feb 2014 in reply to Stefania Link to this post

    Hi Stefania,

    Please take a look into this forum thread which deals the same scenario.

    Thanks,
    Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top