Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

467
Views
How to select checkbox when click on any cell in the table except clicking on checkbox icon? DevExpress

I have a C# devexpress project. I am using the checkbox for my project. Here is the screenshot of my design.

enter image description here

I want to click the "In Price" and "Out Price" cell, and select the rows (multiple. To be exact: I have a number of rows. If I click a cell, the cell will be selected, if I click another row cell, the first-row will still remain selected, and then the second one also be selected.)

Here is a demo of what I exactly expecting: enter image description here

I am assuming that, because of the Toggle button, only if I click on the checkbox column, it is selected. If I need to turn it off, How can I do that?

If I need to write code what I am expecting, the code will be written:

private void gridView2_RowCellClick(object sender, RowCellClickEventArgs e)
        {
            if (e.Column.FieldName == "InPrice" || e.Column.FieldName == "OutPrice")
            {
                //Here I need to write the code.
            }
        }
over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

private void gridView2_RowCellClick(object sender, RowCellClickEventArgs e)
        {
            if (e.Column.FieldName == "InPrice" || e.Column.FieldName == "OutPrice")
            {
                         
                if ((Control.ModifierKeys & Keys.Control) != Keys.Control)
                {
                    GridView view = sender as GridView;
                    GridHitInfo hi = view.CalcHitInfo(e.Location);
                    if(hi.InRowCell)
                    {
                        view.FocusedRowHandle = hi.RowHandle;
                        view.FocusedColumn = hi.Column;
                        view.ShowEditor();
                        CheckEdit edit = (view.ActiveEditor as CheckEdit);
                        if(edit != null)
                        {
                            edit.Toggle();
                            (e as DevExpress.Utils.DXMouseEventArgs).Handled = true;
                        }
                    }
                }
            }
        }

This code works what I exactly wanted. If anyone need this, it may help you.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!