when GridEvents RowDataBound is enabled no request is made to remote data source for the second page etc
I have two issues actually.
- Pdi.ChargeSeqNo is an integer value. When there is no RowDataBound event grid running perfectly. Receing/pagination all work well. But when RowDataBound added grid only get the first page but not second. Even it does not make request for the second page to the host. Checked with browser developer tool network tab.
- I want to change the back-color and the font color of a row according to a field value it contains. It only changes the back-color of the row not the font color. Please look at my style tag above.
...
<SfDataManager Url="@ApiUrl.PdiGetAll" Adaptor="Adaptors.ODataV4Adaptor" HttpClientInstance="_httpPdiService.ServiceHttpClient"></SfDataManager>
<GridPageSettings PageSizes="@(new string[] { "10", "20", "30", "40", "All" })" PageSize="@PageSize" ></GridPageSettings>
<GridEditSettings AllowEditing="true" AllowAdding="true" AllowDeleting="true"></GridEditSettings>
<GridSelectionSettings Mode="SelectionMode.Row" Type="Syncfusion.Blazor.Grids.SelectionType.Single"></GridSelectionSettings>
<GridEvents RowDataBound="OnRowBound" CommandClicked="OnCommandClicked" RowSelected="OnRowSelected" TValue="Pdi" OnActionFailure="OnActionFailure"></GridEvents>
<GridSortSettings >
<GridSortColumns>
<GridSortColumn Field="@nameof(Pdi.ChargeSeqNo)" Direction="SortDirection.Ascending"></GridSortColumn>
</GridSortColumns>
</GridSortSettings>
...
<style>
.rowcolor {
background-color: darkred;
color: wheat !important;
}
</style>
...
public void OnRowBound(RowDataBoundEventArgs<Pdi> args)
{ if(args.Data.CoilStatus > 1)
{
args.Row.AddClass(new string[] { "rowcolor" });
StateHasChanged();
}
}
...
Hi Erciyes,
We are unable to reproduce the reported issue when attempting to do so using the latest version 26.2.10. For your reference, we have attached a screenshot and a simple sample. So, to proceed with the reporting problem, we require some additional clarification from you. Please share the details below to proceed further at our end.
- Could you please share with us the version of the NuGet package you have used?
- To analyze the reported issue, could you please share a simple and reproducible sample that demonstrates the problem? Or Kindly share your attempts to replicate the issue using the attached simple sample.
|
|
Above-requested details will be very helpful
in validating the reported query at our end and providing a solution as early
as possible. Thanks for your understanding.
Regarding the second issue, to change the text color, we suggest the following
CSS customization to achieve your requirement.
|
<style> .rowcolor, .e-grid .e-row.rowcolor .e-rowcell { background-color: antiquewhite; color: green; } </style> |
Regards,
Prathap Senthil
Prathap Senthil, thanks for quick response.
When I visited your suggested sample link, I found out that I used
DataSource="PdiList" and SfDataManager at the same time for the same grid. It is nonsense obviously. Sorry for my mistake.
After removing DataSource it is running perfect.
Thanks
for the update,
We are happy to hear that the reported issue has been resolved on your end. We
will now be closing this thread.
- 3 Replies
- 2 Participants
- Marked answer
-
ER Erciyes
- Aug 24, 2024 11:40 AM UTC
- Aug 28, 2024 06:54 AM UTC