Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1414
Change Row color in WebDataGrid on Error
posted

To All,

 

I am using a WebDataGrid for data entry via a barcode scanner.  Don't get frightened, it just keyfakes in an item's serial number.  The folks here helped me out with that one.  Basically, they have me trap the Grid_KeyDown client side event so I can trap for the Enter key and drop to the next row - thus firing the server side RowUpdating event.  Then, I can process server side database management via the server side Grid_RowUpdating event.  All is good.  My inventory records are being updated just fine.

The problem is when there is an error.  Maybe the item is still marked as issued to someone else - that is, the item was not updated in the database by the operators when the item was returned.  Oh, well. 

What I am looking for is a way to 'style' the background color of the row if the database update process on the server side RowUpdating event cannot issue the item.  I am able to save something like "ERROR" in an hidden unbound column in the row.  When I set the CssClass property of the selected row and or colum in RowUpdating that setting does not get applied (even with !important).  When I force a postback via a button the row/column that should have "ERROR" in it is empty (although displayed).  When I attempt to apply CSS to some visible row in the button postback I see no changes to the background color.

I think I have an event flow issue, but am not certain...