I am setting the style on individual cells in javascript using code like this:
oCell._element.className = strRedCellClass;
The styling works properly. My problem is that if I bind grid to new data and there is not any data in the cell that was previously styled the style remains. I am clearing the grid on the server side before binding like this:
WebDataGrid1.Columns.Clear()WebDataGrid1.Rows.Clear()WebDataGrid1.ClearDataSource()
This does not clear any cell styles that were previously set. How can I clear the styles?
Hello wamanring,
Thank you for posting in our community. I have created a sample that reproduces this scenario. Try it and let me know your comments. If the sample is different than yours you can modify it in the way this issue is reproducible.
I hope this information helps.
For any other questions with this matter do not hesitate to contact me.
Sincerely,
Georgi Sashev
Developer Support Engineer
Infragistics, Inc.
http://es.infragistics.com/support
I downloaded you application and while it did not exactlt reproduce my problem it gave me an ides that allowed me to solve my problem.
In the RowInitialize event I need to clear the CssClass properties for all cells in the row. This happened before the CssClass property was set and it took care of my issue.
Private Sub WebDataGrid1_InitializeRow(sender As Object, e As Infragistics.Web.UI.GridControls.RowEventArgs) Handles WebDataGrid1.InitializeRow
' Clear any CssClass settings on this row - this fixed the problem For Each oRecordItem As Infragistics.Web.UI.GridControls.GridRecordItem In e.Row.Items oRecordItem.CssClass = "" Next
' Do stuff which might cause the CssClass property to be set to something ' special.
End Sub
Doing this fixed my problem.
I am glad that you have solved this.