|
21 | 21 | { |
22 | 22 | <td class="@GridCellCssClass" data-name="" style="width:36.5px;"></td> |
23 | 23 | } |
24 | | - @if (Grid.ReadEnabled || ((CGrid<T>)Grid).FuncReadEnabled != null) |
| 24 | + @if ((Grid.ReadEnabled || ((CGrid<T>)Grid).FuncReadEnabled != null) && !HeaderCrudButtons) |
25 | 25 | { |
26 | 26 | <td class="@GridButtonCellCssClass" data-name="" style="width:35px;"></td> |
27 | 27 | } |
28 | | - @if (Grid.UpdateEnabled || ((CGrid<T>)Grid).FuncUpdateEnabled != null) |
| 28 | + @if ((Grid.UpdateEnabled || ((CGrid<T>)Grid).FuncUpdateEnabled != null) && !HeaderCrudButtons) |
29 | 29 | { |
30 | 30 | <td class="@GridButtonCellCssClass" data-name="" style="width:35px;"></td> |
31 | 31 | } |
32 | | - @if (Grid.DeleteEnabled || ((CGrid<T>)Grid).FuncDeleteEnabled != null) |
| 32 | + @if ((Grid.DeleteEnabled || ((CGrid<T>)Grid).FuncDeleteEnabled != null) && !HeaderCrudButtons) |
33 | 33 | { |
34 | 34 | <td class="@GridButtonCellCssClass" data-name="" style="width:35px;"></td> |
35 | 35 | } |
|
65 | 65 | } |
66 | 66 | if (_hasTotals) |
67 | 67 | { |
68 | | - <GridTotalsComponent T="@T" Grid="@Grid"></GridTotalsComponent> |
| 68 | + <CascadingValue Value=@this Name="GridComponent"> |
| 69 | + <GridTotalsComponent T="@T" Grid="@Grid"></GridTotalsComponent> |
| 70 | + </CascadingValue> |
69 | 71 | } |
70 | 72 | } |
71 | 73 | else |
|
82 | 84 | @ref="gridmvc" |
83 | 85 | @onkeyup="GridComponentKeyup"> |
84 | 86 | <div class="@GridWrapCssClass"> |
| 87 | + <p id="error" style="color:red;">@Error</p> |
85 | 88 | <div class="row"> |
86 | 89 | <div class="col-md-6 grid-header-buttons"> |
87 | 90 | @if (Grid.ClearFiltersButtonEnabled) |
|
103 | 106 | } |
104 | 107 | </div> |
105 | 108 | } |
| 109 | + @if ((Grid.ReadEnabled || ((CGrid<T>)Grid).FuncReadEnabled != null) && HeaderCrudButtons) |
| 110 | + { |
| 111 | + <div class="grid-crud"> |
| 112 | + @if (string.IsNullOrWhiteSpace(Grid.ReadLabel)) |
| 113 | + { |
| 114 | + <button class='grid-button grid-button-header-view btn btn-sm btn-outline-secondary' title="@Strings.ReadItem" @onclick="@(e => ReadSelectedHandler())" type="button" @onclick:stopPropagation></button> |
| 115 | + } |
| 116 | + else |
| 117 | + { |
| 118 | + <button class='grid-button-header-label-view btn btn-sm btn-primary' title="@Strings.ReadItem" @onclick="@(e => ReadSelectedHandler())" type="button" @onclick:stopPropagation>@Grid.ReadLabel</button> |
| 119 | + } |
| 120 | + </div> |
| 121 | + } |
| 122 | + @if ((Grid.UpdateEnabled || ((CGrid<T>)Grid).FuncUpdateEnabled != null) && HeaderCrudButtons) |
| 123 | + { |
| 124 | + <div class="grid-crud"> |
| 125 | + @if (string.IsNullOrWhiteSpace(Grid.UpdateLabel)) |
| 126 | + { |
| 127 | + <button class='grid-button grid-button-header-edit btn btn-sm btn-outline-secondary' title="@Strings.UpdateItem" @onclick="@(e => UpdateSelectedHandler())" type="button" @onclick:stopPropagation></button> |
| 128 | + } |
| 129 | + else |
| 130 | + { |
| 131 | + <button class='grid-button-header-label-edit btn btn-sm btn-primary' title="@Strings.UpdateItem" @onclick="@(e => UpdateSelectedHandler())" type="button" @onclick:stopPropagation>@Grid.UpdateLabel</button> |
| 132 | + } |
| 133 | + </div> |
| 134 | + } |
| 135 | + @if ((Grid.DeleteEnabled || ((CGrid<T>)Grid).FuncDeleteEnabled != null) && HeaderCrudButtons) |
| 136 | + { |
| 137 | + <div class="grid-crud"> |
| 138 | + @if (string.IsNullOrWhiteSpace(Grid.DeleteLabel)) |
| 139 | + { |
| 140 | + <button class='grid-button grid-button-header-delete btn btn-sm btn-outline-secondary' title="@Strings.DeleteItem" @onclick="@(e => DeleteSelectedHandler())" type="button" @onclick:stopPropagation></button> |
| 141 | + } |
| 142 | + else |
| 143 | + { |
| 144 | + <button class='grid-button-header-label-delete btn btn-sm btn-primary' title="@Strings.DeleteItem" @onclick="@(e => DeleteSelectedHandler())" type="button" @onclick:stopPropagation>@Grid.DeleteLabel</button> |
| 145 | + } |
| 146 | + </div> |
| 147 | + } |
106 | 148 | @if (Grid.ExcelExport) |
107 | 149 | { |
108 | 150 | <div class="grid-excel"> |
|
150 | 192 | { |
151 | 193 | <th class="@GridHeaderCssClass" style="width:36.5px;"></th> |
152 | 194 | } |
153 | | - @if (Grid.ReadEnabled || ((CGrid<T>)Grid).FuncReadEnabled != null) |
| 195 | + @if ((Grid.ReadEnabled || ((CGrid<T>)Grid).FuncReadEnabled != null) && !HeaderCrudButtons) |
154 | 196 | { |
155 | 197 | <th class="@GridHeaderCssClass" style="width:35px;"></th> |
156 | 198 | } |
157 | | - @if (Grid.UpdateEnabled || ((CGrid<T>)Grid).FuncUpdateEnabled != null) |
| 199 | + @if ((Grid.UpdateEnabled || ((CGrid<T>)Grid).FuncUpdateEnabled != null) && !HeaderCrudButtons) |
158 | 200 | { |
159 | 201 | <th class="@GridHeaderCssClass" style="width:35px;"></th> |
160 | 202 | } |
161 | | - @if (Grid.DeleteEnabled || ((CGrid<T>)Grid).FuncDeleteEnabled != null) |
| 203 | + @if ((Grid.DeleteEnabled || ((CGrid<T>)Grid).FuncDeleteEnabled != null) && !HeaderCrudButtons) |
162 | 204 | { |
163 | 205 | <th class="@GridHeaderCssClass" style="width:35px;"></th> |
164 | 206 | } |
|
182 | 224 | { |
183 | 225 | <td class="@GridCellCssClass" data-name="" style="width:36.5px;"></td> |
184 | 226 | } |
185 | | - @if (Grid.ReadEnabled || ((CGrid<T>)Grid).FuncReadEnabled != null) |
| 227 | + @if ((Grid.ReadEnabled || ((CGrid<T>)Grid).FuncReadEnabled != null) && !HeaderCrudButtons) |
186 | 228 | { |
187 | 229 | <td class="@GridButtonCellCssClass" data-name="" style="width:35px;"></td> |
188 | 230 | } |
189 | | - @if (Grid.UpdateEnabled || ((CGrid<T>)Grid).FuncUpdateEnabled != null) |
| 231 | + @if ((Grid.UpdateEnabled || ((CGrid<T>)Grid).FuncUpdateEnabled != null) && !HeaderCrudButtons) |
190 | 232 | { |
191 | 233 | <td class="@GridButtonCellCssClass" data-name="" style="width:35px;"></td> |
192 | 234 | } |
193 | | - @if (Grid.DeleteEnabled || ((CGrid<T>)Grid).FuncDeleteEnabled != null) |
| 235 | + @if ((Grid.DeleteEnabled || ((CGrid<T>)Grid).FuncDeleteEnabled != null) && !HeaderCrudButtons) |
194 | 236 | { |
195 | 237 | <td class="@GridButtonCellCssClass" data-name="" style="width:35px;"></td> |
196 | 238 | } |
|
226 | 268 | } |
227 | 269 | @if (_hasTotals) |
228 | 270 | { |
229 | | - <GridTotalsComponent T="@T" Grid="@Grid"></GridTotalsComponent> |
| 271 | + <CascadingValue Value=@this Name="GridComponent"> |
| 272 | + <GridTotalsComponent T="@T" Grid="@Grid"></GridTotalsComponent> |
| 273 | + </CascadingValue> |
230 | 274 | } |
231 | 275 | </tbody> |
232 | 276 | </table> |
|
0 commit comments