advanceddatagrid removing the sorting incos from the column header

800 views
Skip to first unread message

Vivian Richard

unread,
Jul 14, 2008, 4:28:26 AM7/14/08
to flex_...@googlegroups.com


  Hello devs,

  I need to remove the sorting icons from all my columns headers of
  the advanced data grid since they are taking too much space from
  the column header. I do not need multiple sorting for my grid so
  if removing icons disables that I am fine with that. I tried to make
  " sortableColumns='false' " in the advanceddatagrid but it only
  stop showing the icon and the number but does not free the
  occupied space. Please Help....

  Regards....

Sameer

unread,
Jul 14, 2008, 11:43:19 AM7/14/08
to Flex India Community
Set sortExpertMode="true"

-Sameer

Vivian Richard

unread,
Jul 14, 2008, 12:04:34 PM7/14/08
to flex_...@googlegroups.com


   Thanks a lot.

vinitha pascal

unread,
Jul 14, 2008, 11:58:55 PM7/14/08
to flex_...@googlegroups.com

Hi,
 
I am using AdvancedDataGrid and removed multicolumn sort feature to support single column sort by setting sortExpertMode = "true". But i am unable to remove the number which comes in the column header. How can i achieve this?
 
Thanks in advance.

jjones730

unread,
Jul 23, 2008, 12:39:44 PM7/23/08
to Flex India Community
To remove the sort column numbers:

1. Add the following class to your project:

<code>
import
mx.controls.advancedDataGridClasses.AdvancedDataGridSortItemRenderer;
import mx.core.UITextField;

public class MySortItemRenderer extends
AdvancedDataGridSortItemRenderer
{
public function MySortItemRenderer()
{
}

override protected function childrenCreated():void
{
super.childrenCreated();

// Get reference to sort number text field
var sortOrderTextField:UITextField = this.getChildAt(0) as
UITextField;

if (sortOrderTextField != null)
{
// Hide sort number text field
sortOrderTextField.includeInLayout = false;
sortOrderTextField.visible = false;
}
}
}
</code>

2. Add the following property to your AdvancedDataGrid declaration:
sortItemRenderer="MySortItemRenderer"

Hope this helps

Joe
Reply all
Reply to author
Forward
0 new messages