Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
590
Want to know an event to get updated column sequence.
posted

Hi

I want a small clarification on one of the use case related to IgrDataGrid (https://es.infragistics.com/products/ignite-ui-react/react/components/grids/data-grid/overview).

I have used IgrDataGrid, in that when I change the column sequence then I want the updated sequence of columns. So please suggest an event which I can use to get the updated column sequence after changing it.

Hoping for a positive response.

Thanks!!!

  • 34810
    Offline posted

    Hello Shubham,

    I am under the impression that by “changing the column sequence” you mean that you are moving columns. If this is the case, I would recommend using the actualColumnsChanged event of the IgrDataGrid. A sample event handler for this looks like the following:

        public onActualColumnsChanged(s: IgrDataGrid, e: IgrGridColumnsChangedEventArgs){
            for(let i=0; i<e.columns.count; i++){
                let column = e.columns.item(i);
                console.log(column.field);
            }       
        }

    The e.columns collection above will reflect the new order of the columns.

    I hope this helps. Please let me know if you have any other questions or concerns on this matter.