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

client api swapColumns not working

1 Answer 38 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Murray
Top achievements
Rank 1
Murray asked on 27 Jan 2009, 10:50 PM
Have grid with client-side data binding that works but i can't swapColumns.

I tried grid.get_masterTableView().hideColumn(index); and showColumn(index) works fine.

But when i try:
grid.get_masterTableView().swapColumns(col1UniqueName, Col2UniqueName);
does nothing.

I have UniqueName set on both columns.

Am i missing some ClientSettings.
i tried ClientSettings->AllowColumnsReorder=true and still didn't work.

using: version 2008.3.1125.20

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 28 Jan 2009, 04:39 AM
Hi Murray,

I tried swapping the columns on the client and it is working well. Check whether you have set the correct columnUniqueName for swapping.

ASPX:
<telerik:GridBoundColumn DataField="ProductName"    HeaderText="ProductName" SortExpression="ProductName" 
                            UniqueName="ProductName"   > 
                        </telerik:GridBoundColumn> 
    <telerik:GridDropDownColumn DataField="ProductID"  HeaderText="DropCol"  UniqueName="DropCol" ></telerik:GridDropDownColumn> 
                       

<ClientSettings   AllowColumnsReorder="true"  ReorderColumnsOnClient="true" >  
                </ClientSettings> 
 

JS:
<script type="text/javascript"
function swap() 
var Grid =$find('<%=RadGrid1.ClientID %>'); 
Grid.get_masterTableView().swapColumns("ProductName","DropCol"); 
  
</script> 


Thanks
Shinu
Tags
Grid
Asked by
Murray
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or