Hi Ali,
Greetings from Syncfusion support.
Query 1 : What will happen if a field is Nullable (bool?)? Then it won't be possible to set the field value to null because Patch delta entity won't have boolean null value among changed properties.
We would like to inform you that, patch data has to be serialized to remove property with default value, in such case serializer removes bool data as its default value is false. This is a limitation. So in these scenario, to avoid this we need to set the DefaultValue attribute as informed in
163328.
Query 2 : Now my problem is with Grouping, the field in group cannot be edited. Why at the first place a grouped field should be readonly?
We have confirmed it as a bug and logged the defect report “Grouped column field is disabled in the Grid's edit form dialog” for the same. Thank you for taking the time to report this issue and helping us improve our product. At Syncfusion, we are committed to fixing all validated defects (subject to technological feasibility and Product Development Life Cycle) and including the defect fix in our weekly release which is expected to be rolled out by the mid of May, 2021.
You can now track the current status of your request, review the proposed resolution timeline, and contact us for any further inquiries through this link.
Query 3 : Component user should not define the same template
At these cases, it is suggested to use Edit/Filter Templates to customize the GridColumn’s actions based on your requirement. For better code reusability, we suggest you to define the FilterTemplate codes in a separate component in your application. We have also prepared a sample for your reference, please download the sample from the link below,
Note : We have defined dummy data in the above sample to explain the solution of queries. The suggestions for the Query 4 and Query 5 are also included in the above sample.
Please refer the codes below,
|
<FilterTemplate>
<SfCheckBoxGridColumn ContextValue="@context"></SfCheckBoxGridColumn>
</FilterTemplate>
</GridColumn>
[SfCheckBoxGridColumn.razor] <SfCheckBox ... ></SfCheckBox> @code { [Parameter] public object ContextValue { get; set; } [CascadingParameter] public SfGrid<Employee> Grid { get; set; }}
|
Query 4 : How can i get record count in server with applied filter?
We suggest you to fetch the filtered records using GetFilteredRecords method of Grid. You can take count from this result and display the filtered records count value. Please refer the codes below,
<div>Record Count after filter : @FilteredDataCount</div><GridEvents OnActionComplete="OnActionComplete" TValue="Employee"></GridEvents>public async Task OnActionComplete(ActionEventArgs<Employee> args){ if (args.RequestType.Equals(Action.Filtering)) { var a = await Grid.GetFilteredRecords(); FilteredDataCount = JsonConvert.DeserializeObject<List<Employee>>(JsonConvert.SerializeObject(a)).Count(); }}
|
Query 5 : but if i change column edit template then Default Edit Dialog clears header for the field
When using EditTemplate for a GridColumn, then the entire column information display for the corresponding column in grid edit form can be customized. So you need to set the Label for the corresponding component based on your requirement. Please refer the codes below in which we have used the FloatLabelType and Placeholder property of SfTextBox component to display the Label.
<GridColumn Field=@nameof(Employee.Name) HeaderText="Name" Width="250"> <EditTemplate> <SfTextBox @bind-Value="((context as Employee).Name)" FloatLabelType="FloatLabelType.Always" Placeholder="Name"></SfTextBox> </EditTemplate></GridColumn>
|
Please get back to us if you need further assistance.
Regards,
Renjith R