FlexGrid MultiCell edit

Posted by: Ranba790 on 7 December 2022, 10:04 am EST

  • Posted 7 December 2022, 10:04 am EST

    Hi

    I have set the grid selection mode to multirange.

    When selecting a couple of cells, and then editing the cell value using the keyboard only the last select cell is edited.

    How can I have all selected cells edited at the same time?

    Thanks

  • Posted 8 December 2022, 3:53 am EST

    Hi,

    You cannot edit multiple cells at a time. Although You can use the AfterEdit event of the FlexGrid and then set the data to all the cells of the selected cell ranges as shown below.

    private void C1FlexGrid1_AfterEdit(object sender, C1.Win.C1FlexGrid.RowColEventArgs e)
            {
                if(c1FlexGrid1.IsCellSelected(e.Row, e.Col) && c1FlexGrid1.SelectionRanges.Count > 0)
                {
                    var data = c1FlexGrid1[e.Row, e.Col];
                    for( int i = 0; i < c1FlexGrid1.SelectionRanges.Count; i++)
                    {
                        var range = c1FlexGrid1.SelectionRanges[i];
                        range.Data = data;
                    }
                }
            } 

    Regards

    Avnish

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels