Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #104758
    oliver.aldrian
    Participant

    Hi,

     

    DisplayField is ignored in Blazor.

     

    See Reproduction in https://github.com/DiawaKG/reproduction-smarthtml-grid-displayfield-not-working

     

    Thanks,

    KR

    #104765
    admin
    Keymaster

    As a workaround, you can create a column which is hidden and has its DataField = DisplayName

    #104766
    oliver.aldrian
    Participant

    the reproduction of the problem is not my use case, so that workaround won’t work for me.

     

    my displayed data in the grid contains an object of a complex type, which needs to be set in the grid.

    So I have a autocomplete editor which displays the different options to select from, and when selected I handle the assignment in the CellEndEdit event

    I have following properties set up

     

    ComplexObject ObjectLink {get set}
    
    string ObjectLinkName => ObjectLink?.ToString()
    
    string ObjectLinkSetter {get set}

     

    and my grid column

    
    <div>
    <div><Column DataField="ObjectLinkSetter" DisplayField="ObjectLinkName" Label="blah"  AllowEdit="true" Editor="@autocompleteEditor" /></div>
    </div>
    

     

    I cannot use the ObjectLink directly, or at least the grid didn’t like it at all.

    #104767
    oliver.aldrian
    Participant

    and yes I know I could go change my complete backend to have the ObjectLinkName “dereferenced” and saved alongside. but why would I… this is clearly a bug

    #104768
    admin
    Keymaster

    We offered a workaround. A fix will come in a future version.

    #104769
    oliver.aldrian
    Participant

    you offered a workaround for a use case that does not exist… but ok….

     

    do you have a timeframe for the fix, so I can communicate that to my customer?

     

    KR

    #104789
    admin
    Keymaster

    Hi Oliver,

    The workaround is valid for any use case. Adding a hidden column is possible in any app using a Grid.

    Regards,
    Peter

    #104790
    oliver.aldrian
    Participant

    How is the workaround viable If I want to use the DisplayField parameter do actually display something?

    I dont need the column hidden, I need it displayed…

     

    My DisplayName is an auto property that is filled from a complex datatype

    I literally cannot Set anything to it.

     

    I want to use the DisplayField and DataField together in one visible column, that uses an autocomplete editor, to use the value from the AutoComplete editor in the EndEdit Event to calculate the fitting ComplexObject and set it in my datamodel, which then fills the auto property which is displayed.

    How would a hidden column with a displayField help in this case??

    #104791
    admin
    Keymaster

    Hi Oliver,

    Create a Hidden Column with dataField = your Display Field and your column with the Display Field will work

    Regards,
    Peter

    #104792
    oliver.aldrian
    Participant

    Ah I see… the DisplayField Property is not loaded to the grid correctly, and with having it a DataField somewhere the Property is forced to be loaded on the DataGrid.

    If you would have said that that was the problem I would not have had complained.

     

    Thanks

Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.