microsoft / powercat-creator-kit

This toolkit helps create well-designed Power App experiences on the web & mobile. It contains a component library; PCF controls and other utilities that increase developer productivity.
MIT License
322 stars 55 forks source link

[BUG]: RecordSelected Not Honored in DetailList #398

Open sperry1625 opened 1 year ago

sperry1625 commented 1 year ago

Describe the bug If a collection contains a column to indicate a row is selected, ex. IsSelected, when the grid is displayed, the records with IsSelected set to true are not selected in the detail list.

To Reproduce Steps to reproduce the behavior:

  1. Create a collection of records with a Boolean column of IsSelected.
  2. Make at least one record where IsSelected is true
  3. Add a DetailList to a screen
  4. Assign the Items property as the collection created above
  5. Set the RecordSelected property to the boolean column to use for selection. "IsSelected"
  6. DetailList displays collection records but no records are selected

Expected behavior To display the records in the collection with the records with column IsSelected set to true to be selected in the list.

Screenshots N/A

Additional context I tried creating an InputEvent for SetFocusOnRowSetSelection and SetSelection. None of these worked.

This should work for selecting a record and clearing all selections and it does not.

AB#957

MaheshSripada commented 2 months ago

Hi @sperry1625

After thorough testing, we couldn’t replicate the problem. Please ensure that you are using the latest version, or try the following steps to set the row selection by default

https://learn.microsoft.com/en-us/power-platform/guidance/creator-kit/detailslist#set-row-selection

Sample query which I used to test.

image

Also please note that you need to add the RecordSelected field to the Fields for the control.

image