microsoft / PowerApps-Samples

Sample code for Power Apps, including Dataverse, model-driven apps, canvas apps, Power Apps component framework, portals, and AI Builder.

Home Page:https://docs.microsoft.com/powerapps

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PowerApps grid control customizer - styling seems to be ignored

mrmwink opened this issue · comments

I'm trying to implement a simplistic custom renderer for the PowerApps grid control, I have an editable grid but in a certain scenario a particular column for the row needs to be locked to avoid editing, the field in question is a Boolean and is represented by the usual toggle.

I have simply introduced a custom renderer which does the check, when read only it just displays a disabled toggle control, pretty simple. When I first did this I just returned a disabled Toggle control but the alignment of the control was top left, so I then tried replicating the stack / stackitem you have for all the other controls I could see when inspecting the DOM in EDGE DevTools, I assumed this would inherit the default styles but it didn't!

Next step I tried to manually copy all the style settings of the stack from a standard cell of the same type but the style was being ignored, when I checked the DOM my stack had a different class name and the definition of the class had the alignment and fill properties all wrong.

I also tried going the css route but that didn't work, but I do not know if css file are supported in the Customizer, I can confirm I added it to the manifest as you would do with a standard PCF control but again the css properties were not reflected in the DOM!

Can anyone confirm how / if I can apply the same stack formatting to the controls and how I do so, otherwise it just looks awful with controls aligned all over the grid?

Attached a file below, all those in the red area are custom and you can see how the alignment differs from the untouched field!

Cheers

Custom Grid Toggle

Please ignore, closing issue, there was something happening in the deployment, no errors but it wasn't reflecting the changes in the UI until I deleted and re-imported the control!!