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
220
Restrict multiple cell selection in a single column
posted

Hi,

I'm trying to configure a grid in an old winform application (using Infragistics 6.2) which restricts users to selecting multiple cells within a single column only.  I'm able to set the grid to allow multiple cell selection (by setting SelectTypeCell property to Extended) but this allows a user to select multiple cells across one or more columns.  How can I restrict multiple cell selection to one column only?

Thanks in advance,
Assad 

Parents
No Data
Reply
  • 5520
    Verified Answer
    posted

    try this:

     

      int ctr = 0;

    private void ultraGrid1_BeforeSelectChange(object sender, Infragistics.Win.UltraWinGrid.BeforeSelectChangeEventArgs e)

            {

                if (ultraGrid1.Selected.Cells.Count <=1)

                    ctr = e.NewSelections.Cells[e.NewSelections.Cells.Count-1].Column.Index;

                if(e.NewSelections.Cells.Count>0)

                if (e.NewSelections.Cells[e.NewSelections.Cells.Count - 1].Column.Index != ctr)

                    e.Cancel = true;

            }

Children