weixin_39588104
2021-01-03 07:20 阅读 1

DataGridColumn Displayable="false" shows column in DataGridEditMode.Inline edit mode

Describe the bug Hiding a DataGridColumn with Displayable="false" still shows the column in DataGridEditMode.Inline edit mode.

To Reproduce Steps to reproduce the behavior: 1. Go to https://blazorise.com/docs/extensions/datagrid/#basic-example 2. Add Editable="true" EditMode="DataGridEditMode.Inline" to DataGrid 3. Add Displayable="false" to a few columns 4. Click Edit on a row

Expected behavior The hidden columns should not be visible in DataGridEditMode.Inline edit mode.

Screenshots Before edit (3 visible and 27 hidden columns) hidden

Inline edit (30 visible columns) edit

Additional context I have 30 columns in my DataGrid so the user can choose a few columns that are important. With 3 columns visible and 27 hidden, the inline edit mode still displays all 30 columns.

该提问来源于开源项目:stsrki/Blazorise

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享

6条回答 默认 最新

  • weixin_39726971 weixin_39726971 2021-01-03 07:20

    Can you try setting the Editable property to false?

    点赞 评论 复制链接分享
  • weixin_39588104 weixin_39588104 2021-01-03 07:20

    Yes, I tried... now all the data is visible:

    editable

    PS: Hvala puno za odgovor tako brzo! Pozdrav iz Ljubljane!

    点赞 评论 复制链接分享
  • weixin_39588104 weixin_39588104 2021-01-03 07:20

    To fix this, just line 68 in _DataGridRowEdit.razor has to be changed:

    https://github.com/stsrki/Blazorise/blob/master/Source/Extensions/Blazorise.DataGrid/_DataGridRowEdit.razor#L68

    from:

        else
    

    to:

        else if ( column.Displayable )
    

    Can you confirm this?

    点赞 评论 复制链接分享
  • weixin_39726971 weixin_39726971 2021-01-03 07:20

    It's line 85 on dev092 branch https://github.com/stsrki/Blazorise/blob/b332b01f37da8e2e2224fbab387a5e7213bd803c/Source/Extensions/Blazorise.DataGrid/_DataGridRowEdit.razor#L85

    And I think it should work

    点赞 评论 复制链接分享
  • weixin_39588104 weixin_39588104 2021-01-03 07:20

    I have tested it and I can confirm that it works without a problem.

    点赞 评论 复制链接分享
  • weixin_39726971 weixin_39726971 2021-01-03 07:20

    Thanks, I will set it for 092 since it is minor change.

    点赞 评论 复制链接分享

相关推荐