Quantcast
Channel: DevExpress Support Center (Examples)
Viewing all articles
Browse latest Browse all 7205

ASPxGridView - How to set a different color for the modified cell in different columns in Batch Edit mode

$
0
0

To implement this scenario, handle the HtmlDataCellPrepared event and add a custom attribute for each data cell:

     

[C#]
protectedvoidGrid_HtmlDataCellPrepared(objectsender,ASPxGridViewTableDataCellEventArgse){e.Cell.Attributes.Add("fieldName",e.DataColumn.FieldName);}

Then, you can change the cell's color by modified the dxgvBatchEditModifiedCell CSS class based on the "fieldName" attribute of each cell:

[CSS]
.dxgvBatchEditModifiedCell[fieldName="C2"]{background-color:LightCoral!important;}.dxgvBatchEditModifiedCell[fieldName="C3"]{background-color:LightYellow!important;}.dxgvBatchEditModifiedCell[fieldName="C4"]{background-color:LightBlue!important;}.dxgvBatchEditModifiedCell[fieldName="C5"]{background-color:LightSalmon!important;}

Viewing all articles
Browse latest Browse all 7205

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>