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

Unknown server tag 'telerik:GridDragDropColumn'

8 Answers 140 Views
Grid
This is a migrated thread and some comments may be shown as answers.
sameer
Top achievements
Rank 1
sameer asked on 14 Sep 2010, 06:54 AM
Hi ALL,

I am using telerik rad grid , but i am unable to find the <telerik:GridDragDropColumn> tag.

MY grid code look like:

<

 

div style="float: left; padding: 0 6px 0 10px">

 

 

<h2 style="color: #9c3608">

 

Pending Orders

</h2>

 

 

<telerik:RadGrid runat="server" ID="grdPendingOrders" OnNeedDataSource="grdPendingOrders_NeedDataSource"

 

 

AllowPaging="True" Width="350px" OnRowDrop="grdPendingOrders_RowDrop" AllowMultiRowSelection="true"

 

 

PageSize="30" EnableHeaderContextMenu="true">

 

 

<MasterTableView DataKeyNames="QuestionnairePK" TableLayout="Fixed">

 

 

<Columns>

 

 

<telerik:GridDragDropColumn HeaderStyle-Width="18px" Visible="false" /> --> i am unable to write this tag. its throwing error like 'Unknown server tag 'telerik:GridDragDropColumn'.

 

 

</Columns>

 

 

</MasterTableView>

 

 

<ClientSettings AllowRowsDragDrop="True" AllowColumnsReorder="true" ReorderColumnsOnClient="true">

 

 

<Resizing AllowColumnResize="true" />

 

 

<Selecting AllowRowSelect="True" EnableDragToSelectRows="false" />

 

 

<ClientEvents OnRowDropping="onRowDropping" />

 

 

<Scrolling AllowScroll="true" UseStaticHeaders="true" />

 

 

</ClientSettings>

 

 

<PagerStyle Mode="NumericPages" PageButtonCount="4" />

 

 

</telerik:RadGrid>

 

</

 

div>


Thanks in advance
sameer

 

8 Answers, 1 is accepted

Sort by
0
Rosen
Telerik team
answered on 14 Sep 2010, 07:05 AM
Hello Sameer,

Could you please verify that the version of RadControls for ASP.NET AJAX you are using is Q2 2010 (version 2010.2.713) or later.

Regards,
Rosen
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items
0
sameer
Top achievements
Rank 1
answered on 14 Sep 2010, 07:57 AM
I am using the version  2010.1.309.35.

Regards,
sameer
0
Rosen
Telerik team
answered on 14 Sep 2010, 08:26 AM
Sameer,

As I have stated in my previous post, the GridDragDropColumn is introduced in Q2 2010 release, but the version you are using is Q1 2010, therefore you should upgrade to a later (Q2 2010+) version in order to use the column in question.

Greetings,
Rosen
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items
0
Brad
Top achievements
Rank 1
answered on 23 Sep 2010, 06:54 PM
Is there any way to mimic this feature/functionality in older versions?  I'm at a client where they simply will not entertain the "risk" of upgrading (their perception)... I'm stuck back in 2008 land with them and it won't be changing any time soon...

This is exactly what I'm looking for and even if it takes some effort (compared to a canned implementation from the newest version) I'd love to deliver this for the end users who thus far haven't asked for drag-n-drop much but this time they have a screen where it really makes sense to implement drag-n-drop...
0
Cori
Top achievements
Rank 2
answered on 23 Sep 2010, 07:04 PM
Hello Sameer,

The RadGrid has always had drag-and-drop functionality, the only function of the GridDragDropColumn is to provide a visual handler that so the user knows they can drag the row. You can pretty much just add a TemplateColumn with that image in it and it will function pretty much the same way as the GridDragDropColumn does. The only difference would be that you can grab the entire row, where as when you use the GridDragDropColumn you can only grab the handler to move the rows.

I hope that helps.
0
tomekm
Top achievements
Rank 1
answered on 01 Dec 2010, 02:05 PM
When using GridTemplateColumn with asp:Image inside, user needs to click row first and then can move it. Any ideas how to make it in one action? Maybe onmousedown event of image would select row?
0
Veli
Telerik team
answered on 06 Dec 2010, 10:42 AM
Hi Rychu,

For RadGrid versions prior to Q2 2010 that do not have the GridDragDropColumn, you can use the following workaround:

1. Create a GridTemplateColumn with an <img> element that has a CSS class of rgDrag:

<telerik:GridTemplateColumn>
    <ItemTemplate>
        <img src="rgDrag.gif" alt="rgDrag.gif" class="rgDrag" />
    </ItemTemplate>
</telerik:GridTemplateColumn>

2. Use RadGrid's client-side OnRowDragStarted event to cancel the action if you are not dragging by the drag handle:

<telerik:RadGrid ID="RadGrid1" runat="server">
    <ClientSettings AllowRowsDragDrop="true">
        <Selecting AllowRowSelect="true" />
        <ClientEvents OnRowDragStarted="gridRowDragStarted" />
    </ClientSettings>
</telerik:RadGrid>


function gridRowDragStarted(sender, args)
{
    if (!args.get_domEvent()._isDragHandle)
    {
        args.set_cancel(true);
    }
}

3. Use RadGrid's ItemCreated event to register an onmousedown handler for RadGrid's data items:

protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e)
{
    if (e.Item is GridDataItem)
    {
        e.Item.Attributes["onmousedown"] = "startRowDrag(this, event);";
    }
}

4. Start the row drag from within the startRowDrag() function if the target of the event is the drag handle (identified by the rgDrag css class) :

function startRowDrag(row, args)
{
    var target = args.target || args.srcElement;
    if (target.className.indexOf("rgDrag") > -1)
    {
        args._isDragHandle = true;
        var tableView = $find(row.id.split("__")[0]);
        var grid = $find(tableView.get_owner().get_id());
 
        tableView.get_dataItems();
        $find(row.id).set_selected(true);
 
        var origFunc = Telerik.Web.UI.RadGrid.prototype._canRiseRowEvent;
        Telerik.Web.UI.RadGrid.prototype._canRiseRowEvent = function ()
        {
            var el = arguments[0].target || arguments[0].srcElement;
            return origFunc.apply(grid, arguments) || el.tagName.toLowerCase() == "img";
        }
 
        grid._mouseDown(args);
 
        Telerik.Web.UI.RadGrid.prototype._canRiseRowEvent = origFunc;
    }
}

That's it. You now have a drag-drop column that is used to drag grid items. Attaching a test page to demonstrate.

Greetings,
Veli
the Telerik team
Browse the vast support resources we have to jumpstart 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.
0
Noonecares
Top achievements
Rank 1
answered on 10 Apr 2012, 11:29 AM
Hi all,

in my current version of DNN 6 and Telerik Version 2011.2.915.35 (I think in any versions) you have to care about some details.
I used this way of drag-drop for more then one rows combined with a checkboxColumn.
If you are using it in 2 diferent modules in dotnetnuke you have to care about the naming of the functions or maybe naming of the grids.
however you have to be sure that you are calling the right functions in your different grids on the same page.
i.e. I renamed my functions like this "gridRowDragStarted_ModuleID_" + ModuleID

You only have to care about this if you have different modules with the same drag n drop functions on the same page and the functions are doing different stuff.
i.e. Iam using 2 different modules on one page. One is selecting only one row and another module has got a grid where you can select more then 1 row using a checkboxcolumn. Both grids are calling maybe the same functions (you dont know. You have to make the different functions unique!).

You also have to care about using the same module twice on a page but they have different javascript in that functions (this works if you are dynamically add the javascript at page_init() and read out the unique moduleID and add this moduleID into the names of the functions.)
like this:
RadGrid.ClientSettings.ClientEvents.OnRowDragStarted = "gridRowDragStarted_ModuleID_" + this.ModuleId;

If you want to make it perfect you have to make this functions unique inside a module, too. Cause if you have a copy of the grid in the same module you will have the same moduleID and the problem occures again :-)
So take care about this case of problems.

greets noone
Tags
Grid
Asked by
sameer
Top achievements
Rank 1
Answers by
Rosen
Telerik team
sameer
Top achievements
Rank 1
Brad
Top achievements
Rank 1
Cori
Top achievements
Rank 2
tomekm
Top achievements
Rank 1
Veli
Telerik team
Noonecares
Top achievements
Rank 1
Share this question
or