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

RadGrid Row ReOrder on client side

2 Answers 252 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Saranya
Top achievements
Rank 1
Saranya asked on 03 Jan 2011, 11:33 AM
Hi Team,

Please let me know a way to Reorder RadGrid Rows on client side, just like column reorder functionality?

2 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 03 Jan 2011, 11:55 AM
Hello Saranya,

I have found one forum which discussed about reordering the grid rows in client side. Please take a look at this and I hope it will help.
Drag and Drop RadGrid in clientside

Thanks,
Princy.
0
Saranya
Top achievements
Rank 1
answered on 07 Jan 2011, 10:21 AM
Thanks for the Update..

I got a sample on the same. But having a issue on drag drop.

<

 

radG:RadGrid ID="RadGrid1" AllowPaging="true" EnableAJAX="true" runat="server" OnNeedDataSource="RadGrid1_NeedDataSource">

 

 

<MasterTableView DataKeyNames="CustomerID">

 

 

<Columns>

 

 

<radG:GridTemplateColumn UniqueName="TemplColumn">

 

 

<ItemTemplate>

 

 

<img src="RadControls/Grid/Skins/Default/Loading.gif" alt="RadControls/Grid/Skins/Default/Loading.gif" />

 

 

</ItemTemplate>

 

 

</radG:GridTemplateColumn>

 

 

</Columns>

 

 

</MasterTableView>

 

 

<ClientSettings>

 

 

<ClientEvents OnRowCreated="RowCreated"></ClientEvents>

 

 

</ClientSettings>

 

 

</radG:RadGrid>

 

The above is my aspx code and the script for Row Created is below: The issue is , the row.RealIndex of the row passed to the RowCreated function shows to be always undefined, as a result its always dragging the entire table content and not the current row to be dragged. any help on this really appreciated. I want this immediately.

var

 

currentRow, movedRow = null;

 

 

function RowCreated(row)

 

{

row.Control.RowIndex = row.RealIndex;

 

debugger;

 

 

var mouseDownHandler = function(e)

 

{

 

if (!e)

 

 

var e = window.event;

 

 

if (!currentRow)

 

{

currentRow = document.createElement(

"div");

 

currentRow.innerHTML =

"<table><tbody><tr>"+row.Control.innerHTML+"</tr></tbody><table>";

 

document.body.appendChild(currentRow);

currentRow.style.position =

"absolute";

 

currentRow.style.display =

"none";

 

 

debugger;

 

movedRow = row;

}

 

ClearDocumentEvents();

};



Tags
Grid
Asked by
Saranya
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Saranya
Top achievements
Rank 1
Share this question
or