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
309 stars 51 forks source link

[BUG]: RaiseOnRowSelectionChangeEvent Self.EventRowKey is index number even though I set the RecordKey property #262

Open kayetter opened 1 year ago

kayetter commented 1 year ago

Describe the bug RaiseOnRowSelectionEvent results in a Self.EventRowKey that is an index number instead of the RecordKey id I set in the RecordKey property.

To Reproduce Steps to reproduce the behavior:

  1. Set RaiseOnRowSelectionChangeEvent property to true
  2. Set RecordKey property to the column of your items that you want to use as the id. Note: make sure this column is included in the fields of the items set on the controls property pane
  3. Set OnChange property fx: Notify($"{Self.EventName}, {Self.EventRowKey}");
  4. Select a record in your details pane and note that the Self.EventRowKey displays an index
  5. But I can get the record from the Self.Selected property so maybe this is ok although if I have multi-select, I wanted to get to the that last selection.

Expected behavior I was expecting that the Self.EventRowKey would display the value of the field that I set in the RecordKey property for this selected item.

Screenshots image

Additional context Just to be sure I was troubleshooting this appropriately, I changed one of my Column_Items to be a link so that I could trigger a CellAction instead of row selection and see if the EventRowKey would return my RecordKey which it did so it is not my column configurations.

image

AB#999

Jenefer-Monroe commented 1 year ago

I think this in my usage of the feature for the CoE as well.

scottdurow commented 1 year ago

Hi @kayetter Thanks for reporting - I can reproduce it. It only seems to happen for collections. If the grid is bound directly a dataverse table, then the EventRowKey correctly gives the id of the row.

sperry1625 commented 1 year ago

When is this going to be fixed? This was reported in January and the problem is still occurring in September. What can you even do with the row id returned? This is a critical issue with the DetailList. There is no other way to determine the item a user selected as the Selected property is not yet set in certain instances. Please help getting this resolved! Or provide a work-around?

Regards,

-S