|
<style>
.e-grid .e-rowcell.e-selectionbackground{
background-color: aqua !important;
}
...
</style>
|
|
|
Hi Syncfusion Team,
Thanks for this solution. However, is there a way to apply the background color to the edited row?
Gerald
Hi Gerald ,
Sorry for the Inconvenience.
We are currently Validating the reported query at our end and we will update the further details within one day(Aug 24, 2022). Until then we appreciate your patience.
Regards,
Naveen Palanivel
Hi Gerald,
We checked your query and achieve your requirement after row is edited , we give color to the edited row using OnActionBegin and RowDataBound event. We prepared sample and attached in this ticket, kindly refer the snippet code and attached sample for your reference
|
public void ActionBeginHandler(ActionEventArgs<Order> args) { if (args.RequestType == Syncfusion.Blazor.Grids.Action.Save) { EditedRecordValue.Add(args.Data.OrderID); }
} public void RowDataBoundHandler(RowDataBoundEventArgs<Order> args) { for(int i = 0; i <EditedRecordValue.Count; i++) { if (EditedRecordValue[i].Value == args.Data.OrderID) { args.Row.AddClass(new string[] { "EditAfter" }); }
}
} |
Please get back to us if you need further assistance.
Regards,
Naveen Palanivel
Hi Naveen,
Sorry - I think I need to clarify.
I only want the row currently being edited to have a background colour. So:
Hi Gerald
Thanks for the Update
We checked your query when the row is in editing state to change background color of the row . we achieved your requirement by given background color to the class( .e-grid .e-row.e-editedrow .e-gridform tr). Please refer the snippet code and attached sample for your reference.
|
<style>
.e-grid .e-row.e-editedrow .e-gridform tr {
background-color:aqua; }
</style> |
Please get back to us if you need further assistance.
Regards,
Naveen Palanivel
Hi Naveen,
That worked great! Thank you!
Gerald.
Hi Naveen,
Sorry - one more question. For an added row under edit, how would we apply the same color? Your code above works for existing rows that are being edited, but not for a new row being edited. Thanks!
Gerald
Hi Gerald,
Thanks for the Update
We checked your query when the row is in editing state and new row is added in editing state to change background color of the row . we achieved your requirement by given background color to the class( .e-grid .e-row.e-editedrow .e-gridform tr && .e-grid .e-row.e-addedrow .e-gridform tr ). Please refer the snippet code and attached sample for your reference.
|
<style>
.e-grid .e-row.e-editedrow .e-gridform tr {
background-color:aqua; } .e-grid .e-row.e-addedrow .e-gridform tr {
background-color:aqua; }
</style> |
Please get back to us if you need further assistance.
Regards,
Naveen Palanivel
Hi Naveen,
That works well. Thank for your help. Much appreciated.
Gerald
Sorry - one more question -
For the CSS code - is there a way to apply to all pages that consume the Syncfusion Grid? Currently this is added to each razor page with a data grid:
<style type="text/css" class="cssStyles">
.warning {
background-color: yellow;
}
.error {
background-color: red;
}
.e-grid .e-rowcell.e-selectionbackground {
background-color: aqua !important;
}
.e-grid .e-row.e-editedrow .e-gridform tr {
background-color:aqua !important;
}
.e-grid .e-row.e-addedrow .e-gridform tr {
background-color: aqua !important;
}
</style>
I tried adding the css elements to site css, but it still takes the default syncfusion colour scheme.
T
Hi Gerald,
Welcome from Syncfusion support.
We have analyzed your query and we suggest you add the CSS style code in the site.css file to apply to all pages that consume the Syncfusion Grid. We have
attached the screenshot of the code and output based on your requirement. Kindly
refer to the attached screenshot for your reference.
Kindly get back to us if you have any further queries.
Regards,
Keerthana.
Thanks again for your help.
One (hopefully last) question - if the grid is in batch mode (not in-line mode, which the above works well), how do I colour the row being edited? Thanks again!
G
Hi Gerald,
We
checked your query when the row is in batch mode editing state to change background color of the edited cell . we achieved your requirement by given background color to the class (.e-grid .e-editedbatchcell.e-rowcell .e-gridform).
Please refer the snippet code for your reference.
|
.e-grid .e-editedbatchcell.e-rowcell .e-gridform{ background-color:aqua; } |
Please get back to us if you need further assistance.
Regards,
Naveen Palanivel
Hi Naveen,
Thank you - is it possible to do change color of the whole row that the edited cell is located?
G
Hi Gerald,
We checked your query and we like to inform that when we try to edit In batch edit mode. when you double-click on the datagrid , the target cell changes to edit state in batch mode. So it only possible to color to the target cell in Batch mode edit.
Kindly get back to us if you have any further queries.
Regards,
Naveen Palanivel
Thanks Naveen for your help.
Gerald
Hi Gerald,
Welcome
Please get back to us if you need further assistance.
Regards,
Naveen Palanivel.