1

I have C1FlexGrid in my form with multiple rows. I want to select random rows and get those selected row value.

Selection Mode:

this.CliAcctHolderGrid.SelectionMode = C1.Win.C1FlexGrid.SelectionModeEnum.ListBox;

Function Code:

   private void Submit(object sender, EventArgs e)
   { 
       List<string> holderIdentificationId = new List<string>(); 
       if (CliAcctHolderGrid.RowSel >= 1)
       {
           for (int CliAcctHolder = 1; CliAcctHolder <= CliAcctHolderGrid.Row; CliAcctHolder++)
           {
               C1.Win.C1FlexGrid.Row rowSel = CliAcctHolderGrid.Rows[CliAcctHolder];  
               holderIdentificationId.Add((string)rowSel["HolderIdentifierId"]); 
            } 
        }  
   }

From the code I have done, I am getting values which I didn't selected. Getting all values from the grid. Can anyone please suggest me where I am making a mistake.

Damini Suthar
  • 1,470
  • 2
  • 14
  • 43

1 Answers1

0
private void Submit(object sender, EventArgs e)
    {
        List<string> holderIdentificationId = new List<string>();
        if ( CliAcctHolderGrid.RowSel >= 1 )
        {
            foreach(C1.Win.C1FlexGrid.Row dr in CliAcctHolderGrid.Rows.Selected)
            {
                holderIdentificationId.Add( (string)dr["HolderIdentifierId"] );
            }
    
        }
    }
mkmkmk
  • 167
  • 4