advancedDataGrid set highlighted element programmatically

I'd like to be able to tell my ADG to set a specific row to be highlighted and update the adg rendering to match such new value. Note: highlight != selected. I thought perhaps setting highlightUID would do the trick, but I can't seem to get the ADG rendering to update. Would love any quick tips.

thanks!

Answers


1) Make a custom AdvancedDataGrid with this function :

public function indicesToItemRenderer(
    rowIndex:int, colIndex:int):IListItemRenderer
{
    var firstItemIndex:int = verticalScrollPosition - offscreenExtraRowsTop;
    if (rowIndex < firstItemIndex ||
        rowIndex >= (firstItemIndex + listItems.length))
    {
        return null;
    }

    return listItems[rowIndex - firstItemIndex][colIndex];
}

2) When you want to hightlight an item, call this code :

youCustomADG.indicesToItemRenderer(
    idxRow, idxCol).dispatchEvent(new MouseEvent(MouseEvent.MOUSE_OVER);

Need Your Help

How to write an annotation for classes to be outputted to LogCat?

java annotations

Can I create an annotation that will make the class call

Using native registration free C++ COM server from managed app

c# c++ .net com com-interop

I have a native C++ COM Server dll accompanied with type library (.tlb file) and .NET Interop assembly generated by TlbImp.exe. The server is registration free and I have a manifest to activate the

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.