Column Reordering
Send Feedback

Glossary Item Box

Topic Overview

Purpose

This topic provides a conceptual overview on reordering the IGGridView™ control’s columns.

Required background

The following table lists the topics required as a prerequisite to understanding this topic.

Topic

Purpose

Adding the Grid Framework File

This topic explains how to add the grid framework file to the project.


In this topic

This topic contains the following sections:


Introduction

Column reordering summary

Column reordering allows users to rearrange the position of visible columns within their data source helper, except for cell specific helpers, by using simple drag and drop techniques. The IGGridViewDataSourceHelper class exposes the allowColumnReordering property, used to enable or disable column reordering at the data source level.

The following methods were added to IGGridViewDataSource to support this feature:

  • -(BOOL)gridView:(IGGridView *)gridView canMoveColumnAtIndex:(int)index
  • -(void)gridView:(IGGridView *)gridView moveColumnAtIndex:(int) sourceIndex toIndex:(int)destinationIndex

It is also possible to trigger a column move, without dragging, using the following IGGridView’s API method.

  • -(void)moveColumnAtIndex:(int)index toIndex:(int)newIndex

The IGGridView control constantly calls the IGGridViewDelegate whenever you drag a column. To make a column stationary, propose and return a different index.

  • -(int)gridView:(IGGridView*)gridView targetPathForMoveFromColumnAtIndex:(int)sourceIndex toProposedIndex:(int)proposedIndex
Note: Column Reordering only applies to data source helpers. If, following any column manipulation, you need to update the data source; you will need to call the IGGridView method invalidateData with the BOOL parameter specified as NO. Not invalidating the data after making any alterations, such as moving, inserting, or deleting cells, rows, or columns causing them to reappear in their original position.

Related Content

Topics

The following topics provide additional information related to this topic.

Topic

Purpose

This section serves as an introduction to the IGGridView’s key features and functionalities.