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
190
CellClick event in XamDataGrid?
posted

I have a grid with 2 columns. One is read only and second is not. 

The second is a checkbox column. Initially, FieldSettings.CellClickAction has the default value.

So when I click on checkbox column, I can check/uncheck  the checkbox.

 

I want when to click on first column (the read-only), the whole row to be selected ( FieldSettings.CellClickAction = CellClickAction.SelectRecord.)

If I set initially CellClickAction.SelectRecord, then I cannot check/uncheck the second column, only if I make a double-click on the checkbox and then everything is ok.

This is not acceptable. What I'm need?

Please give me a solution.

I thought that exist a CellClick event to catch the clicked cell, but I don't see something usefully.

Regards, Liviu 

 

 

 

 

 

 

 

 

  • 8576
    Offline posted
    Hi Liviu -
     
    Here is a post that shows how to handle the PreviewMouseLeftButtonDown event and detect when you are over a particular field (column): http://forums.infragistics.com/forums/p/2784/16536.aspx#16536
     
    So what you should be able to do is:
    • set the CellClickAction to SelectRecord
    • listen to the PreviewMouseLeftButtonDown event and look for a click on a cell in the column with the checkboxes as shown in the code from the above referenced post
    • toggle the boolean value of the
    • if you want you can mark the event handled at this point to prevent the grid from selecting the record
    Joe