on 01-07-2014 9:02 AM
Friends...
I am calling the rowfocuschanged event from itemchanged event....but the calling event is not working.
see the italic bold line. the event
dw_2 item changed event.
String ls_PassFail
If dwo.Name = 'marks_final_grade' Then
Choose Case data // What is the letter grade?
Case 'A','B','C','D','E','S'
ls_PassFail = 'Pass'
Case 'U'
ls_PassFail = 'Fail'
dw_2.TriggerEvent(rowfocuschanged!)
case else
ls_PassFail = 'Nil'
End Choose
This.SetItem(row,'marks_final_passfail',ls_PassFail)
End If
my requirement is....marks_final_passfail field's font color should be red...once the 'Fail' case comes...
already the rowfocuschanged event is working...but now i am not going to that field to select 'Pass' or 'Fail'...iam doing it here...so i want to change the font color also from here(dw_2 item changed event)
thanks
Hello,
why not put an expression for the font color of the column in the DW painter ?
ex: if ( marks_final_passfail = "Fail", 255, 33554432 )
HTH,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I suggest you follow Philippe's reply for multiple reasons.
If by "tilted" you mean setting that Italic attribute, then Philippe's approach is still an improvement if applied to the expression for the Italic attribute (and changed parameters for the If() function). In fact, done right, his approach should make things simpler and able to handle more cases (e.g. bulk data loading, programmatic change of marks_final_grade). (We're assuming you want this change on a row-by-row basis, which isn't entirely clear from your post.)
BTW, slightly off-topic, but I always considering it very bad design to call a system event directly like that. If someone on my team sees a need for something like that, I have them break the code in question out into a custom user event or function, and fire it from both places. Why?
JMHO and my experience.
Good luck,
Terry.
i have already tried that...its not working...
below is working
dw_2.modify("marks_final_passfail.Color='413200'")
but we have many dropdownboxes as per the above code, all the text of the dropdownboxes inside the datawindow are changing...
i need only the particular dropdownbox/row text color should be changed.
There is no need for a dw_2.Modify () - If possible just set the expression with the "if" in the DW Painter.
If you want to do this via Modify () you have to add a default value and a '~t' in front of the expression.
string ls_error
ls_error = dw_2.Modify("marks_final_passfail.Color='" + '0~tif ( marks_final_passfail = "F", 255, 0 )' + "'" )
If Len ( ls_error ) > 0 then MessageBox ("Modify Error" , ls_error )
hth
Arnd
Hi Sathy;
I would like to suggest that you change the TriggerEvent ( ) to a PostEvent ( ) method to let the ItemChanged event complete properly first.
Regards ... Chris
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
78 | |
9 | |
9 | |
7 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.