Jul 13, 2009, 10:09 AM
Assign GetRowClass-Handler in codebehind
Hello,
as described in the Example Marking Records I need to change the background color of multiple rows in my gridpanel in certain situations.
Because I`ve implemented the Grid within a user control and the name of the handler function is dynamic, I need to assign the GetRowClass-Handler in codebehind.
If I try to assign the name of the handler function directly, it gets never assigned:
Is this Bug still existent ? Do you have any ideas ?
Thx,
Peter
as described in the Example Marking Records I need to change the background color of multiple rows in my gridpanel in certain situations.
Because I`ve implemented the Grid within a user control and the name of the handler function is dynamic, I need to assign the GetRowClass-Handler in codebehind.
If I try to assign the name of the handler function directly, it gets never assigned:
<style type="text/css">
.past {
background:red;
}
.future {
background:green;
}
</style>
function <%= this.ClientID %>.GetRowClass(record) {
if (record.get('ValidTo') < new Date() ) {
return 'past';
}
if (record.get('ValidFrom') > new Date() ) {
return 'future';
}
}
_resourceConstraintDataGridView.GetRowClass.Fn = this.ClientID + ".GetRowClass"; // does not have an efffect
After discovering this post, I tried out the workaround which was posted there. But also the workaround does not work for me (error: "JFunction is not serializeable").JFunction fn = new JFunction();
fn.Fn = this.ClientID + ".GetRowClass";
_resourceConstraintDataGridView.GetRowClass = fn; // raises an Exception with message "JFunction is not serializeable"
I`m using Coolite 0.8.1.Is this Bug still existent ? Do you have any ideas ?
Thx,
Peter