Post it here, the more eyes that look at it the better for you.
Your DataGrid is not editable, correct? And your render is not set as an editor, right? I assume you have debugged this and have tested to see that the dataProvider is set when you set selectedItem? Maybe there is a timing issue with the bound dataProvider. Loop over the items to make sure the item exists. And make sure it matches the selectedIndex. I'd probably suggest you do this any way and use selectedItem always. I would use a conditional, testing for the selectedItem, rather than blindly setting selectedIndex every time. Finally, I strongly suggest you move that work into commitProperties() The set data() function gets called much more often than you may realize. Tracy Spratt, Lariat Services, development services available _____ From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of Laurence Sent: Sunday, February 07, 2010 6:19 AM To: flexcoders@yahoogroups.com Subject: [SPAM] [flexcoders] Re: Custom ItemRenderer still not working... --- In flexcod...@yahoogro <mailto:flexcoders%40yahoogroups.com> ups.com, Alex Harui <aha...@...> wrote: > > Maybe Tracy can figure it out from just the renderer code, but I > think I need a complete (but small) test case with some sample data. Can I send it to you via this list? Or do I have to e-mail you privately somehow? Just let me know where to send it, and I'll put together a small test-case for ya sometime in the next couple of days. > > The only thing I see that looks unusual (besides calling refrehs() > is setting both selectedItem and selectedIndex. One should be good > enough. Yeah, one should be good enough, I agree... If you notice, however, that I set selectedItem first, then selectedIndex. There are times (rare, but it happens) when the database has been corrupted or accidentally changed, and none of the items match in the selectedItem list. The boss wants it to default, in that case, to whatever is returned by selectedIndex. Kind of an auto-repair for his database. LOL Thanks, Laurence MacNeill Mableton, Georgia, USA