Binding DataGrid Scrollbar Events

I just re-posted my initial inquiry, regarding the context for the result I'm going for. In the meantime, I have a question based on a potential work-around:
How would I go about creating a two-way binding for scrollbar mouse events between two DataGrids with the same dataprovider? Programmatically loosely speaking, they would be arranged as follows:
<mx:DataGrid
     id="datagrid1"
     dataProvider="{vidItems}"
     left="0" top="0" width="300" rowCount="5" (etc...)
</mx:DataGrid>
<mx:DataGrid
     id="datagrid2"
     dataProvider="{vidItems}"
     left="25" top="0" width="275" rowCount="5" (etc...)
</mx:DataGrid>
In this scenario, the additional rows would activate the scrollbar for each DataGrid and, by default would be aligned row-for-row at the same index at creation. For "datagrid1" the MouseWheel events for the Scrollbar executed over the visible area of the DataGrid would need to be passed to "datagrid2" to keep the rows for both components in synch, while the MouseWheel, thumb drag, increment click, and decrement clicks from "datagrid2" would need to be passed to "datagrid1".
Any suggestions would be greatly appreciated.
Thanks~Benny

I came up with an alternate solution that's a much more straightforward and logical way of achieving the desired effect. I posted it here: http://forums.adobe.com/message/3160303#3160303
It's not an answer to the question, but I'm no longer looking for one, so...

Similar Messages

  • How to bind a click event to a button that is embedded in another symbol

    All-
    I'm sure this is easy but ya know...
    So I have a menu on the main stage that has 18 buttons.  These buttons are nested inside of a symbol called MC_MENU_CONTAINER.  I'm animating this symbol with show/hide buttons on the main stage, which works great.  What Id like is to bind a click event to these nested buttons from the main stage.  I was able to   access the nested buttons with this code sym.getComposition().getStage().getSymbol("MC_MENU_CONTAINER").$("BTN_INTRO").hide();  This hides the first button but when i try to attatch a click event to "BTN_INTRO" it doesn't work.  I have the code stored on the stage using compositionReady.
    Any ideas?
    thx

    For simple alerts, console.log, and strings, single or double quotes doesn't matter.
    It does matter when you start dealing with quotes in strings. If you wanted to alert: Say "Hello", you could do it either way:
    alert('Say "Hello"');
    alert("Say 'Hello'");
    Since Edge is built on javascript, it's really important to have a good handle on javascript and jQuery, in order to utilize the tool to it's full potential.
    javascript:
    https://developer.mozilla.org/en-US/docs/JavaScript/Getting_Started
    http://elegantcode.com/2010/10/22/basic-javascript-part-1-functions/
    jQuery:
    http://webdesignerwall.com/tutorials/jquery-tutorials-for-designers
    http://docs.jquery.com/Tutorials

  • CellRenderer + DataGrid + rollOverItem Event

    Hello all,
    I have a custom cellRenderer with a custom button in it. I
    would like to trigger the DataGrid rollOverItem event when the user
    rolls over the button. I haven't been able to find anyting on this
    topic, nor have I been able to figure out a way to use the
    DispatchManager to achieve this.
    Has anyone dealt with this before, or have a method for
    solving this?
    Thanks to anyone with input.
    Jim

    Have you seen the CheckBox CellRenderer example here:?
    http://www.adobe.com/support/documentation/en/flash/fl8/samples.html#component_samples
    Aren't they triggering DataGrid events when the user selects
    one of the checkboxes?
    I didn't look at it in depth, but if you haven't downloaded
    the .AS file check it out (no pun intended), I think it would lead
    you to the answer.
    Otherwise, try starting out by invoking a custom function
    defined on _root, just as a test to "get out" of the button, then
    work your way down from there, using the reference to your DataGrid
    component.
    Also, make sure you don't have any other onRollOver/Out
    methods defined on the DG component, as I believe any methods
    attached to the button would not trigger.
    Again, make sure you are firing a onRollOver event by using
    the _root.function() call, so you cn maintain your sanity!
    Good luck,
    bh

  • How to avoid doubleclick event on a datagrid scrollbars?

    Hello.
    I've a datagrid.
    I need a doubleclick event cliccking on a data grid row.
    I've enabled the doubleclick event. It works fine, when the user doubleclicks on a row, an event happens! In my case I open a modal window. Great!
    Now the problem:
    The problem arises when the user clicks in a short time on a data grid scroll bar (both horizontal or vertical). In this case a double click event is dispatched.
    But his intenton is just to scroll the grid, no more.
    Please, notice that the dobule click on a scrollbar is a well-known action that can be performed in all the applications and operating systems.
    I neet the "double click" event just on a data grid rows and not on its scrollbars. Cliccking twice or more on the scrollbar I just want to scroll the grid. How can avoid to dispatch an event?
    Thank you
    Pbesi

    I was returning today to add something about custom item renderers but you beat me to it, Pbesi.   I have a custom gridItemRenderer which I now have to check for just as you demonstrated above.  What I don't understand is why I can't just do this:
    if( event.target is IGridItemRenderer )  //Should be true for both default and custom
    My custom renderer implements the IGridItemRenderer interface, but when I double click one in the grid, the event.target is not myCustomGridItemRenderer, it is GridLayer.  So what I have to do is this:
    if( (event.target is IGridItemRenderer) || (event.target is GridLayer) )
    I presume this would work for all custom gridItemRenderers, but I only have one, so I haven't tested this.  Any idea why GridLayer is the type of the event target?  My custom renderer is very simple.  It just renders Booleans as "Yes/No" rather than "True/False"
    <s:GridItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"
          xmlns:s="library://ns.adobe.com/flex/spark"
          xmlns:mx="library://ns.adobe.com/flex/mx"
          clipAndEnableScrolling="true"
          implements="spark.components.gridClasses.IGridItemRenderer">
          <fx:Script>
               <![CDATA[
                    override public function prepare(hasBeenRecycled:Boolean):void {
                         lblData.text = (data[column.dataField] == true) ? "Yes" : "No" ;
                                  ]]>
         </fx:Script>
          <s:Label id="lblData" top="9" left="7"/>
    </s:GridItemRenderer>

  • Bug in scrollbar event triggering?

    In LabVIEW 8.6, I am trying to fire an event when I finish moving the scrollbar of an array indicator.  I use the "mouse up" event to avoid having the event structure fire constantly the entire time I am moving the scrollbar.  However, there seems to be a bug (?) in the event detection.  It works fine as long as I have the mouse on top of the scrollbar when I release it.  However, Win XP allows you to continue to move the scrollbar even if the mouse is off to the left or right of the bar (when you click on the scrollbar it "locks" the focus onto it).  However, LabVIEW does not seem to realize this and if I have the mouse slightly off to the right of the scrollbar when I release, the event doesnt fire. LV seems to base the event off of whether the mouse is on top of the pixels of the indicator rather than whether I still have control of the scrollbar.

    Technically it is not a bug.  There is no event triggered because when you do the Mouse Up, you are no longer on the scrollbar.  Unfortunately, the behavior in Windows that allows you to continue to move the scrollbar even when you aren't on it is conflicting with the desire to detect when you let go of the scroll bar.
    There was a recent thread discussingthis very issue and a way to get the behavior you are looking for.
    Re: Handle mouse up on numeric slider control - even when mouse leaves control

  • BAM: Problem with 'Binding' while creating event linkage

    Hello colleagues.
    We have an ECC 6.0  and a PI 7.1 system. I want to create a prototype using the features of BAM.
    In transaction SWF_BAM, i tried to create a binding for the OB proxy parameters and the event object parameters. Unfortunately, the proxy class no longer has the method 'EXECUTE_ASYNCHRONOUS' and hence i am unable to create the binding.
    Any pointers on how to go about this. Please also let me know if i am not doing it the right way.
    Regards,
    Keshav

    HI Keshav,
    Try writing the method which u create in the same name as the implementing class; also known as the provider class. I have faced the same problem, and when writing the method, use the operation name, which is used in PI 7.1, while creating the interface, and there shouldn't be any problem during Binding.
    Regards,
    Abhisek.

  • DataGrid scrollbar on left side.

    I know I have seen a topic about this somewhere but this
    forum has such a bad searchfunction that I cant find the answer...
    I have 2 DataGrids, 1 must have the vertical scrollbar on the
    right side (normal), and 1 must have the vertical scrollbar on the
    left side (not normal).
    I have tried everything I could think of. Help files didn't
    help, tutorials didn't help, looking through the UIScrollbar and
    DataGrid class files didn't help either.
    I'm stuck...
    If anyone knows how to do this, please share.
    p.s. the tricks that people use to get the scrollbar to the
    left in a "scrollpane" component do NOT work for
    DataGrids...

    Also tried:
    _root.myDG.vScroller._x = 0;
    _root.myDG.setHPosition(-15);
    didn't work... I also tried adding this:
    myDG.vScrollPolicy = "off"; (this removes the vertical
    scrollbar)
    and then adding an additional UIScrollbar component into the
    DataGrid... but even after configuring it correctly it will not
    interact with the DataGrid (perhaps it only works for textfields).
    Anyone?!?

  • DataGrid SCrollbar Header

    Hello all,
    I am trying to get an image or a button in my datagrid's
    scrollbar's header. I have done many google searches but have not
    found anything. Does anyone have a solution or maybe help me get
    started in the right direction? Thanks!
    BTW, Flex Builder 2.0.

    Thank you Peter and Alex for the replies.
    Setting the baseColor in the stylesheet worked (I was trying everything else but). 
    It would be nice to have greater control over the track and trackbar colors when using the Spark theme, my datagrid header background is dark with a fontcolor of white and a symbolcolor of white, so trying to match a dark scrollbar basecolor the trackbar is almost lost in a dark track.
    Thanks,
    John

  • Datagrid scrollbar

    Hi there.
    I've got a prolem. I have skinned scrollbar, and it works
    pretty well on TextArea etc
    The only issue I've discovered is that some lists (ex.
    DataGrid) will not redraw correctly according to the scrollbar
    width until the first time the user interacts with them. The width
    of it is way too big, background is white (while i have grey), and
    it collides with DataGrid header.
    Does anybody know any solution for this problem?

    Found a solution...
    Set up columnWidth property to 0, and (if you're using CSS)
    DataGridBase colors to the same as for the DataGrid.
    Works fine for me.

  • DataGrid Scrollbar issue

    I have a DataGrid inside a container with wordwrap turned on.
    Some fields have a good chunk of data so they are allowed to
    wrap. I have also set variableRowHeight to true (though it doesn't
    affect the behavior below).
    Once populated the Datagrid will not show the scrollbar when
    it overflows the container area. Rather the container scrollbars
    are turned on (both horizontal & vertical).
    When I have WordWrap turned off, the overflow will trigger
    the scrollbar for the Datagrid itself, not the container.
    I am not sure what am I missing when I turn the wordwrap on
    Appreciate any help/tip.
    Thanks.

    Setting minWidth on the column with wrapping data fixed the
    sxroll issue.
    Now the scrollbars are appearing with the Datagrid.

  • Radio Buttons, Global Binding, and Change Event

    I have a pair of radio button groups with the same name that I have set to Global binding.  The radio buttons in these radio button groups have script in the change event.  The problem is, when I click on a button in one group, it doesn't fire the change event in the other one, even though the corresponding button changes.  I can work around this, but I'm curious why this doesn't work.

    ocen12 is correct - the change event will only fire when a user clicks on the radiobutton. It will not fire when a script changes the value. I tried it here and found that the radio buttons on both groups act like they are under the same exclusion group. Do you see the same thing? If I select a value in the second exclusion group any value I had in the 1st one is gone.
    Paul

  • Disable datagrid keyboard events

    Is it possible to disable keyboard events or prevent the datagrid from switching selected rows?  In my app, I allow the user to select a datagrid row, but when they do I make a request to get data. While I am waiting for the data to return I want to prevent the user from using the keyboard arrow keys to select another row.
    I have tried setting selectable to false and setting focusEnabled to false, but neither one works.  Anyone know of another alternative?
    TIA

    Block the keyDown event or override  moveSelectionVertically

  • Sleutel Bind, fancy key events handler for standalone window managers

    I began using Openbox in my laptop a while ago, and I was amazed by the speed, customization and simplicity it provides. After I started customizing my desktop I noticed that some of the special keys (TouchpadToggle, Volume, PrintScreen, etc) didn't worked at all. There are some applications for the Volume keys to work, but not for keys like touchpad-toggle and print-screen. Of course, there's a workaround for each case using simple scripts, but I wanted something a little more fancy, so I made:
    Sleutel Bind
    It's made in C and provides key events handling for:
    XF86TouchpadToggle
    Print (prtsc key)
    It makes use of libnotify to display states ( touchpad enabled/disabled, screenshot taken, etc) and imlib2 (a very popular library, probably already installed in your system) to grab the screenshots. Almost all other keys are covered already by another application, but if needed, more key events will be added in the future.
    Feel free to post your thoughts about Sleutel Bind, it's my first contribution to the community.
    How to use
    Once installed just run the command as a normal user.
    If using openbox, place the following command in the "~/.config/openbox/autostart" file:
    sleutelb &
    Links
    AUR
    github
    Last edited by DanielRS (2013-03-01 21:58:35)

    mgmillani wrote:
    I believe it must have been a bug and it was fixed, since print screen now works as expected. I'm using xmonad version 0.11-9, with ghc version 7.8.3.
    davama wrote:
    Note: for my print key to be recognized by xev i had to hold the ctrl key. that way it was not registered by xmonad. Also for xev command i use
    xev | grep -A2 --line-buffered '^KeyRelease' | sed -n '/keycode /s/^.*keycode \([0-9]*\).* (.*, \(.*\)).*$/\1 \2/p'
    Nice, that seems to be useful. Thanks!
    @LQYMGT
    Do you still have issues with the latest version? Otherwise I will mark this thread as solved.
    well, still do not work... But I do not want to try it any more...So you can mark.

  • Binded Datagrid displays System.Data.Datarow as data

    Using VS2010 C#
    Hi All,
    I am having a really annoying issue which I know there's an easy fix for, but i cannot figure it out for the life of me. My goal is to copy info from an excel sheet to the datagrid. To achieve this, I am taking the clipboard and creating a datatable, and
    from the datatable --> datagrid. I have finally got the datagrid to display the correct column names and number of rows, but the records are showing "System.Data.Row" instead of the row's ItemArray. I've debugged the datatable and the correct
    info is right there in the ItemArray properties. Can someone please help me resolve this issue?
    Thanks in Advance!!!
    Here's my code:
    private void button1_Click(object sender, RoutedEventArgs e)
    string s = System.Windows.Clipboard.GetText();
    string[] lines = s.Split('\n');
    string[] columnsNames = lines[0].Split('\t');
    lines = lines.Where(w => w != lines[0]).ToArray();
    DataTable dt = new DataTable();
    DataRow dr;
    List<DataRow> list = new List<DataRow>();
    foreach (string str in columnsNames)
    dt.Columns.Add(str, typeof(string));
    DataGridTextColumn dgtxcol = new DataGridTextColumn();
    dgtxcol.Header = str;
    dataGrid1.Columns.Add(dgtxcol);
    dgtxcol.Binding = new Binding(".");
    for (int row = 0; row < lines.Length; row++)
    string[] rowInfo = lines[row].Split('\t');
    dr = dt.NewRow();
    for (int z = 0; z < rowInfo.Length; z++)
    if (rowInfo[z].Contains('\r'))
    rowInfo[z] = rowInfo[z].Replace('\r', ' ');
    dr[columnsNames[z]] = rowInfo[z];
    dt.Rows.Add(dr);
    list = dt.AsEnumerable().ToList();
    dataGrid1.ItemsSource = list;
    string name = ((DataRow)dataGrid1.Items[0]).ToString();
    private void dataGrid1_LoadingRow(object sender, DataGridRowEventArgs e)
    e.Row.Header = (e.Row.GetIndex()+1).ToString();
    <Window x:Class="ClipboardToWPF.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="MainWindow" Height="500" Width="846" WindowStartupLocation="CenterScreen" Loaded="Window_Loaded">
    <Grid>
    <DataGrid ItemsSource="{Binding}" AutoGenerateColumns="False" Height="346" HorizontalAlignment="Left" Margin="12,103,0,0" Name="dataGrid1" VerticalAlignment="Top" Width="800" LoadingRow="dataGrid1_LoadingRow" CanUserAddRows="True">
    </DataGrid>
    <Button Content="PASTE" Height="39" HorizontalAlignment="Left" Margin="691,33,0,0" Name="button1" VerticalAlignment="Top" Width="96" Click="button1_Click" />
    </Grid>
    </Window>

    Since the DataContext of a DataGridRow is an item in the DataGrid's IEnumerable<T> ItemsSource, you must specify the column name or property name of T to bind to for each column. "." just binds to the DataRow itself.
    You must also remove the \r also from the column name. You can then set the ItemsSource property of the DataGrid to the DefaultView of the DataTable itself.
    The following modified code seems to work fine for this sample data:
    col1 col2
    val1 val2
    private void button1_Click(object sender, RoutedEventArgs e)
    string s = System.Windows.Clipboard.GetText();
    string[] lines = s.Split('\n');
    string[] columnsNames = lines[0].Split('\t');
    lines = lines.Where(w => w != lines[0]).ToArray();
    DataTable dt = new DataTable();
    List<DataRow> list = new List<DataRow>();
    foreach (string str in columnsNames)
    string name = str.Replace("\r", "");
    dt.Columns.Add(name, typeof(string));
    DataGridTextColumn dgtxcol = new DataGridTextColumn();
    dgtxcol.Header = name;
    dataGrid1.Columns.Add(dgtxcol);
    dgtxcol.Binding = new Binding(name);
    for (int row = 0; row < lines.Length; row++)
    string[] rowInfo = lines[row].Split('\t');
    DataRow dr = dt.NewRow();
    for (int z = 0; z < rowInfo.Length; z++)
    if (rowInfo[z].Contains('\r'))
    rowInfo[z] = rowInfo[z].Replace('\r', ' ');
    dr[z] = rowInfo[z];
    dt.Rows.Add(dr);
    dataGrid1.ItemsSource = dt.DefaultView;
    string firstname = dt.Rows[0][0].ToString();
    Hope that helps.
    Please remember to mark helpful posts as answer to close the thread and then start a new thread if you have a new question.

  • Binding Datagrid XML Data

    Hi,
    Summary: I cannot get my DataGrid binding with XML data.
    Specifically, I cannot bind a DataGridColumn with a child of a
    child using the dataField property. However, I can bind with a
    direct child.
    I'm currently building an application where I retrieve data
    from a XML database and contact it through posting a XQuery to the
    database. I set the resultFormat of my HTTPServer to "e4x".
    quote:
    <mx:HTTPService id="searchRequest" url="
    http://localhost:8080/exist/rest/db/"
    contentType="application/xml" useProxy="false"
    method="POST" resultFormat="e4x" />
    I receive this data:
    quote:
    <exist:result exist:hits="1" exist:start="1"
    exist:count="1" xmlns:exist="
    http://exist.sourceforge.net/NS/exist">
    <schedule>
    <tournament>
    <sport>Testing Our DTD</sport>
    <tname>Well-formed Document</tname>
    <match>
    <mdate>Oct. 12, 2007</mdate>
    <competitor>
    <cname>sd</cname>
    <score>2</score>
    </competitor>
    <competitor>
    <cname>sdgs</cname>
    <score>3</score>
    </competitor>
    <location>
    <city>San Luis Obispo</city>
    <state>CA</state>
    <country>USA</country>
    <stadium>Test Stadium, OPTIONAL</stadium>
    </location>
    <tv>SVN</tv>
    <description>Basic testing...</description>
    </match>
    </tournament>
    </schedule>
    </exist:result>
    I receive the data fine however, I cannot nested
    elements of the XML nodes I retrieve. Here is my data grid.
    quote:
    <mx:DataGrid id="grid" width="446" height="100%"
    dataProvider="{searchRequest.lastResult.schedule.tournament.match}"
    enabled="true">
    <mx:columns>
    <mx:DataGridColumn headerText="Tournament" />
    <mx:DataGridColumn headerText="Match Date"
    dataField="mdate" />
    <mx:DataGridColumn headerText="Sport" />
    <mx:DataGridColumn headerText="City"
    dataField="location.city"/>
    <mx:DataGridColumn headerText="State"
    dataField="location.state"/>
    </mx:columns>
    </mx:DataGrid>
    The 'mdate' shows up however, 'location.city'
    and 'location.state' do not. I am not sure how the dataField works.
    Does it get the 'current' node and allow me to drill down in the
    XML node?
    I will note that I can get it working with a labelFunction
    and an ItemRenderer. I feel that using either of those methods for
    this is a bit verbose.

    The default DGColumn picks up the property value by doing
    data[dataField]. Due to this the nested value would not be picked
    up.
    By extending DGColumn and overriding the itemToLabel function
    it is possible to get the desired functionality by adding code to
    detect "field1.field2" kind of dataField value and returning the
    nested value.
    This custom DGColumn can be used whererever the functionality
    is desired.

Maybe you are looking for

  • Illustrator document thumbnail previews not showing in finder window

    I am trying to find a way to view Illustrator document thumbnails (CS,CS2,CS3 and CS4) in Finder windows. Other documents such as .tiffs, jpgs, etc and Word and .pdfs show but not Illustrator. I used +show view options+ in the Finder, turning on and

  • Can multiple users share a single Email Account?

    I set up my email account last night and everything worked perfectly. Messages downloaded from my ISP with no problems. Then I logged out of my user account and logged into my wife's user account. When I clicked on mail to test it, I realized that it

  • XBMC/mplayer and KDE Desktop effects

    Hi, i have setup a arch based HTPC with XBMC on top of KDE, but there is one thing i were not able to resolve: The XBMC GUI and playing a video on it gets laggy as soon as i DISABLE the kde desktop effects. My system is i3/sandy bridge based with int

  • Mac Book Pro - Rebooting and Kernel Panic

    Hi Everyone, I hope that you're all well. I've recently sold my iMac and purchased a Mac Book Pro Mid 2010 edition (i7, 8gig Ram, 500mb disk). It has Mountain Lion 10.8.4 installed. and I am having problems with the machine and I hope that you might

  • Jdbc Driver for MSSQL

    Where from i get the jdbc driver for MSSQL server. This is the driver i used JData2_0.sql.$Driver. Please give the location of this to download.