I have a requirement to display data in a ASP.NET grid. The columns are dynamically created as the table source is selected by the user and is not known at design time. I am able to build the data table with the respective column names and display the data in the grid. This is working OK, but I also have a requirement to color code specific columns. The data source that I am display is the results on a data compare process so I have columns named MYFIELD1_S and MYFIELD1_T where the _S and _T represents the source and target. I am need to compare the values in MYFIELD1_S versus MYFIELD1_T and if the values are different then color code MYFIELD1_T.
I have some logic that is looking for the column name ending with "_T", get the column index and compare it to the column index-1 (i.e. the _S column). But I have been having a hard time getting the column index. I have tried the ItemCreated and ItemDataBound events without any luck and have looked at prerender. I have this function working perfectly for a WinForm grid using CellFormatting event, but this does not exist in ASP.NET and we are moving from a WinForm app to ASP.NET
How is the best way to handle this requirement?
I have some logic that is looking for the column name ending with "_T", get the column index and compare it to the column index-1 (i.e. the _S column). But I have been having a hard time getting the column index. I have tried the ItemCreated and ItemDataBound events without any luck and have looked at prerender. I have this function working perfectly for a WinForm grid using CellFormatting event, but this does not exist in ASP.NET and we are moving from a WinForm app to ASP.NET
How is the best way to handle this requirement?