DataGrid question

does anyone have any idea how to change the background color
of a datagrid based on text in the data you get back?
httpservice -> get data(rowdata)
if rowdata.text == someline of data ){
set background black
else if ( rowdata.text == someline of data) {
set background blue.....
still fairly new so please post good example so that i may
follow..

"ice9_us" <[email protected]> wrote in
message
news:gc4bof$dl2$[email protected]..
> does anyone have any idea how to change the background
color of a datagrid
> based on text in the data you get back?
>
> httpservice -> get data(rowdata)
>
> if rowdata.text == someline of data ){
> set background black
> else if ( rowdata.text == someline of data) {
> set background blue.....
>
>
>
> still fairly new so please post good example so that i
may follow..
http://flexdiary.blogspot.com/2008/09/extended-datagrid-with-stylefunction.html

Similar Messages

  • Datagrid questions

    I have a datagrid whereI would like to select multiple rows
    and then copy the rows into another object, manipulate them and the
    shove them into antother data grid. The business process is to take
    a shipment with a single start and end point (a single leg, or
    route, if you will) and then introduce a hub into the route, thus
    breaking a single-route into a two-leg-route, a two-leg-route into
    a three-leg-route, and so on...
    I found a method listed as:
    copySelectedItems(useDataField:Boolean = true):Array which the help
    says "Makes a copy of the selected items in the order they were
    selected.", and it belongs to a ListBase which is a parent class.
    Now, correct me if I'm wrong, but in Java I wouldn't have a problem
    accessing a protected member of a parent class. That doesn't seem
    to work in this case. I have tried to use the method like this:
    private function setSelection(event:Event):void {
    var list:Array =
    event.currentTarget.copySelecteditems(true);
    var list2:Array = list;
    The exception is this:
    ReferenceError: Error #1069: Property copySelecteditems not
    found on mx.controls.DataGrid and there is no default value.
    at
    Pooling/setSelection()[F:\Eclipse6Workspaces\Services\Pooling\src\Pooling.mxml:27]
    at
    Pooling/__shipGrid_itemClick()[F:\Eclipse6Workspaces\Services\Pooling\src\Pooling.mxml:49 ]
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at
    mx.core::UIComponent/dispatchEvent()[E:\dev\flex_3_beta2\sdk\frameworks\projects\framewor k\src\mx\core\UIComponent.as:8915]
    at
    mx.controls.listClasses::ListBase/mouseClickHandler()[E:\dev\flex_3_beta2\sdk\frameworks\ projects\framework\src\mx\controls\listClasses\ListBase.as:8661]
    I'm not sure what is the root of this issue, or if it's just
    a matter of me not understanding actionScript. I can make the
    process work by iterating through the selected items, and that's
    not too bad, but it would be great if I could make the shortcut
    method work.
    I appreciate everyone's help, thanks...

    Okay, I'll answer my own question. The selectedItems property
    of the dataGrid returns an array.
    var list:Array = event.currentTarget.selectedItems;
    ...does exactly what I need.
    I don't feel too smart after this one!
    Cheers,

  • Simple dataProvider for dataGrid question

    I have a question about accessing some values from an
    xmllist. I have a piece of xml that is returned from an httpservice
    that looks similar to this.
    <topnode>
    <list>
    <item>value</item>
    <item>value2</item>
    <item>value3</item>
    </list>
    </topnode>
    I'm interested in creating a datagrid to display the values
    of each list.item, so: value, value2, value3. I'm not sure what my
    data provider should look like in this case since there are no
    nodes underneath the repeating node.
    I can create an xml list like:
    myList = event.result.list.item
    but this gives me an xmllist with values of [0].item.value,
    [1].item.value etc. I'm just unsure how to setup my datagrid to
    extract values from the item node.
    I think if my xml looked like the following I could access it
    like:
    (in my httpservice result handler)
    myList = event.result as XML
    (the datagrid provider would look like)
    dataProvider={myList.item}
    (and the column would have an entry like this)
    dataField="name"
    <topnode>
    <list>
    <item>
    <name>bob</name>
    </item>
    <item>
    <name>stan</name>
    </item>
    <item>
    <name>bill</name>
    </item>
    </list>
    </topnode>
    But in my case, the value I'm extracting is the value set at
    the top level node that repeats. Maybe I'm missing something
    obvious here.
    Any thoughts?

    Thanks again for responding. I've tried that, but when I do
    all the values show up in the first row of the datagrid. Which
    looks like this:
    <item>value</item>
    <item>value2</item>
    <item>value3</item>
    Perhaps I'm making an incorrect assumption below:
    [Bindable]
    public var myList:XMLList;
    myList = event.result.list;
    <mx:DataGrid dataProvider="{myList}" width="100%">
    <mx:columns>
    <mx:DataGridColumn headerText="Names"
    dataField="item"/>
    </mx:columns>
    </mx:DataGrid>
    xml from server:
    <topnode>
    <list>
    <item>value</item>
    <item>value2</item>
    <item>value3</item>
    </list>
    </topnode>

  • Right click on datagrid question

    Hi guys
    I'm trying to get the columnIndex on a right click on a datagrid, so that I can use it when I select an item from my custom contextMenu.
    Currently...
    data_grid.addEventListener(ListEvent.ITEM_ROLL_OVER, dataGridRollOver);
    private function dataGridRollOver(event:ListEvent):void    {  lastRollOverRow = event.index;  lastRollOverColumn = event.columnIndex; }
    Then in my contextMenu function, I use lastRollOverRow and lastRollOverColumn
    It works fine if I right click, select a contextMenu option, then choose another row and repeat etc...
    However, say I right click, decide I've clicked on the wrong column, don't choose anything from the contextMenu, and then my next action is to right click on the correct column - the above event listener doesn't fire again (I presume because the contextMenu has focus), so my vars don't get updated.
    Is there a way to give focus back to the DG on a consecutive right click before re-displaying the contextMenu?
    I notice I don't need to set up an event listener to catch the right click for the datagrid's contextMenu. Is there something I can change so I can do something first before the contextMenu pops up?
    Cheers for your help.

    I'm a little confused mate. I thought that was what I already had set up (I forgot to mention that when the datagrid's RIGHT_CLICK function is triggered, I make sure the menu appears a few pixels left and up so that the mouse is over it), but are you saying that during creation, I need to apply a one-off event listener to the grid to initialize things as well as the one I already have that is listening to see if the user rolls off the entire grid:  rightClickMENU.addEventListener(MouseEvent.MOUSE_OUT, rightClickMenuRollOff); ?
    Re-reading my post, maybe I was a bit tired writing it!!!  Let me explain a little more clearly:
    - mainClass (where my datagrid is) calls and creates new instance of rightClickMENU, then calls a function to do this:
    addChild(rightClickMENU);
    rightClickMENU.visible = false;
    rightClickMENU.addEventListener(MouseEvent.MOUSE_OUT, rightClickMenuRollOff);
    (rightClickMENU class creates a container movieclip, then a bunch of rollover buttons, and addChilds each button to it's container - so the container is in the rightClickMENU class)
    - in mainClass, put this listener on datagrid: rightClickMENU.addEventListener(MouseEvent.MOUSE_OUT, rightClickMenuRollOff);
    - in mainClass, my roll on /roll off functions do this:
    private function showRightClickMenu(event:MouseEvent):void
                var X = event.localX * 4.3015;//default DG width is 272.  So set up correct right click position ratio 1170/272 = 4.3015.
                var Y = event.localY * 2.2513;//default DG height is 191    
                //with my datagrid pos offset, the coords below end up showing the menu with the mouse about three pixels in from the top corner:
                rightClickMENU.x = X+13; rightClickMENU.y = Y+75;
                rightClickMENU.visible = true;
    private function rightClickMenuRollOff(event:MouseEvent):void //menu roll out
                rightClickMENU.visible = false;
    Can you please explain a little more what you mean in your post?

  • ItemRenderer by gridCell, DataGrid questions

    Hi All,
    I am using a DataGrid with 3 columns to display data. 1st colum is just a label - non editable text, 2nd column is where I want to set/unset an itemRenderer (in this case a comboBox), 3rd column is a label - non editable or a text editable field.
    Here is my problem,  I want to be able to set/unset the item rederer by cell.  Meaning, right now you can only set it by column but I don't want all my rows to have the combo box renderer, i want it to be based on some data.  So, let say for row 0 is set to the comboBox redenrer but for row 1 it is just set to the default label renderer.  All the examples I have found you can only set the special renderer to the entire column.
    Also, for column 3 i have it define as editable (user can edit/enter text in the cell) but again you can set it to the entire column, it is posible to set it by cell.
    Many thanks in advance!

    You can try overriding createColumnItemRenderer, but some folks find it easier to have a single renderer that will show a combobox or label based on the data.
    Alex Harui
    Flex SDK Developer
    Adobe Systems Inc.
    Blog: http://blogs.adobe.com/aharui

  • Another Datagrid question

    Hi folks!
    I am trying to take some XML data I have retrieved from
    HTTPService request and display it on a datagrid.
    I understand the basic idea is to bind the result to an
    array, and then parse out that array somehow so that the datagrid
    can read it. If that is wrong please correct me.
    So far I have
    <mx:Script>
    <![CDATA[
    import mx.collections.ArrayCollection;
    [Bindable]
    private var myData:ArrayCollection;
    ]]>
    </mx:Script>
    This part isn't working
    <mx:HTTPService id="loginService"
    url="
    http://localhost/magic94scripts/mgrqcgi94.exe"
    method="POST"
    useProxy="false"
    result="myData = resultObj.catalog as ArrayCollection">
    Can somebody tell me what I've missed here?
    Mr. Dummy

    Thanks Tracy,
    I'll take a look at cflex.net and see if I can find that
    example.
    When I insert resultFormat="e4x" into my test app, it stops
    working. Currently I'm populating the Datagrid like this:
    <mx:DataGrid id="myDG2"
    dataProvider="{loginService2.lastResult.catalog.record}"
    x="643" y="128" width="613" height="658">
    <mx:columns>
    <mx:DataGridColumn headerText="Name" dataField="name"
    />
    <mx:DataGridColumn headerText="Status" dataField="status"
    />
    <mx:DataGridColumn headerText="Type" dataField="type"
    />
    <mx:DataGridColumn headerText="Category"
    dataField="category" />
    </mx:columns>
    </mx:DataGrid>
    With loginService2 being my HTTPService call.

  • Advanced datagrid question

    Hi All,
    I have an ADG displaying items in groups showing totals for each group using:
              private function summFunc(cursor:IViewCursor, dataField:String, operation:String):Number{
                    var sumAll:Number = 0;
                    while (!cursor.afterLast)
                        if (dataField == "Amount")
                            sumAll += Number(parseFloat(cursor.current["Amount"]));
                        cursor.moveNext();
                    return sumAll;
              <mx:dataProvider>
                <mx:GroupingCollection id="groupedData" source="{acSampleADG}" >
                    <mx:Grouping>
                        <mx:GroupingField name="Series" >
                            <mx:summaries>
                                <mx:SummaryRow summaryPlacement="last" summaryObjectFunction="summObjFunc">
                                    <mx:fields>
                                        <mx:SummaryField dataField="Amount" summaryFunction="summFunc" />
                                    </mx:fields>
                                </mx:SummaryRow>
                            </mx:summaries>
                        </mx:GroupingField>
                    </mx:Grouping>
                </mx:GroupingCollection>
            </mx:dataProvider>
    Amount column is editable. If I change the value for an item the total for the group is not updating.
    How can I refresh that value?
    Thanks
    Johnny

    I figure out to skip the error in my ITEM_EDIT_END event.
    Now if I use groupedData.refresh() it puts the old values back. Is this a bug?
    Any ideas?
    Johnny
    Here is my fuction for  ITEM_EDIT_END event.
    private function update_ADG_values(event:AdvancedDataGridEvent):void{
        var grid:AdvancedDataGrid = event.target as AdvancedDataGrid;
        if(event.dataField=="Amount"){
            acSampleADG.refresh();
            myADG.validateNow();
            var myEditor:TextInput = TextInput(event.currentTarget.itemEditorInstance);
            var newVal:Number = parseFloat(myEditor.text.replace(",",""));
            var oldVal:Number = Number(event.itemRenderer.data[event.dataField]);
            if (event.reason == DataGridEventReason.CANCELLED || event.reason == DataGridEventReason.OTHER || oldVal == newVal) {
                event.preventDefault();
                grid.destroyItemEditor();
                return;
            groupedData.refresh();

  • Mulitple row edit in Datagrid question

    Hi
    I'm playing around with different ways to edit a column in multiple rows, and I'm wondering if there is a standard way of doing this?
    Currently, to edit one row, I'm doing this (simplified idea of my function):
    private function data_gridClicked(event:ListEvent):void
         var row = Number(event.rowIndex);
         var col = Number(event.columnIndex);
         var colName:String  =  event.target.columns[event.columnIndex].dataField;
         switch(colName)
              case "Read":
                   event.item[colName] = "Y"; break;
              case "Delete":
                   data_grid.dataProvider.removeItemAt( event. rowIndex );  break;
    So if you want to set multiple rows of "Read" to be "Y", or delete multiple rows, is it a matter of using data_grid.selectedIndices to get which rows are clicked, and set up each switch condition to loop through the rows to make the changes?
    What I'm finding using data_grid.selectedIndices in the above function is that it contains the indices PREVIOUSLY clciked on.  So if I click on row 3, ir returns -1, and then if I click on row 10, it returns 3 etc...
    Can someone please point me in the right direction?
    Cheers

    According to the help docs...
    "The click event is dispatched before the value of the component is changed. To identify the row and column that were clicked, use the properties of the event object; do not use the selectedIndex and selectedItem properties."
    So if you want to know which column or row was clicked, then the click event is probably what you need to use.  But since using that will not lead to the correct selectedItem/selectedIndex, I am not sure what needs to be done other than maybe to have both listeners at work for you.

  • DataGrid sort efficiency questions

    Hi,
    I guess I have two specific questions:
    1. Is sorting a DataGrid faster/slower/same by applying a
    sortCompareFunction to a specific column vs. applying a Sort object
    directly to the underlying dataprovider?
    2. It says in the following link that if you use a
    labelFunction on a column, you must also use a sortCompareFunction:
    dataGridColumn.sortCompareFunction
    ASDOC
    Is this really true - anyone know why?
    Thanks!
    -Noah

    Alexander,
    In Flex 3 sorting is controlled by the collections rather than the controls. This provides greater flexibility overall despite making it hard to adjust to. To get or set a sort on the DataGrid in Flex 3, use the sort property of its dataProvider:
    ListCollectionView(dataGrid.dataProvider).sort
    You can both read and write to the sort property. When you write to it, you have to call refresh() after for it to apply. Refer to the documentation on the ListCollectionView class for how to properly get and set its sort property.
    Thanks,
    Philip

  • Questions about Spark DataGrid (Header Font Styles, Header Gradient)

    Just starting out in 4.5 SDK, and just a tad confused on the Spark DataGrid.
    1) Trying to set the font style for just the header, but don't see those properties in the designer....as they appear to apply to every part of the DataGrid.
    2) Want to set a linear gradient for the header utilizing two specific colors, alphas and ratios.  Not sure where to set them now.
    I think that is it for now.  From what I have done with it so far, I love it....just obviously not as much user documentation as the MX DataGrid.
    Thanks in advance!
    Bill

    You can do per column header renderers by setting the headerRenderer property on the column. But if you want to swap out all the headers, the header renderer has to be specified in the skin. One neat trick you can do is subclass the DataGridSkin and replace the "headerRenderer" declaration. This also works with the other skin parts.
    <?xml version="1.0" encoding="utf-8"?>
    <skins:DataGridSkin xmlns:fx="http://ns.adobe.com/mxml/2009"
                    xmlns:s="library://ns.adobe.com/flex/spark"
                    xmlns:mx="library://ns.adobe.com/flex/mx"
                    xmlns:skins="spark.skins.spark.*">
        <fx:Declarations>
            <!-- See DataGridSkin for other possible parts -->    
            <fx:Component id="headerRenderer">
                <s:CustomGridHeaderRenderer />
            </fx:Component>
        </fx:Declarations>
    </skins:DataGridSkin>
    -Kevin

  • Question about Using States in DataGrid Item Renderer

    I have a DataGridColumn with an ItemRenderer that extends the
    Box component. The default display is a Text component. When the
    user clicks on the text component, I change the State to add a
    PopUpMenuButton child, and make the Text component invisible. This
    works fine. However, I only want to allow one PopUpMenuButton to be
    visible in the DataGrid at a time (similar to how an itemEditor
    works). I don't want to use an itemEditor, because I've run into
    too many problems trying to get that to work in this instance.
    I am implementing IDropInListItemRenderer in my itemRenderer,
    in order to access the listData property, which will give me the
    owner (DataGrid), but I don't know how to "turn off" the "editing"
    state in other itemRenderers in the DataGrid.
    How can I accomplish this?
    Thanks.

    Here we go. I simply added an Listener for Change Events in
    the listData.owner - if it is triggered, i update the currentState
    to null. Works like a charm. Much easier than trying to access the
    itemRenderers in the column and resetting them all. Better on
    performance too.

  • Datagrid with comboBox headerRenderer question

    Hi All,
    I have a comboBox as header renderer in my datagrid.
    How can I fire a function that it is in my main form (where the datagrid is) when I change the selected item in the comboBox?
    Thanks
    Johnny

    Why my HTML Code didn't show.
    <?xml version="1.0" encoding="utf-8"?>
    <mx:ComboBox xmlns:mx="http://www.adobe.com/2006/mxml"
                 labelField="label" dataProvider="{acCombo}" rowCount="20"
                 change="onSelectionChange(event)" creationComplete="init()">
        <mx:Script>
            <![CDATA[
                import mx.collections.ArrayCollection;
                import mx.controls.dataGridClasses.DataGridColumn
                import mx.rpc.events.ResultEvent;
                [Bindable]private var acCombo:ArrayCollection = new ArrayCollection ([{id:1, label:"Private"},{id:2, label:"Public"}]);
                private var _ownerData:Object;
                public function init():void
                    //init code
                override public function set data(value:Object):void
                    if (value is DataGridColumn ){
                    }else
                        super.data = value
                override public function get data():Object
                    return _ownerData;
                override public function setFocus():void
                    super.setFocus();
                    open();
                private function onSelectionChange(e:ListEvent):void
            ]]>
        </mx:Script>
    </mx:ComboBox>

  • DataGrid mxml question.

    When I declare a datagrid in mxml, clearly I can also declare
    the columns.
    I'm working on created my own custom grid class that inherits
    from DataGrid but, when I try to declare it in mxml I can no longer
    use mxml to define the grid columns.
    I dug through DataGrid.as looking for some sort of meta data
    that described what was allowed in mxml or something but couldn't
    find anything.
    Anyone else tried to do this before?
    Regards,

    "ctzn99" <[email protected]> wrote in
    message
    news:gfkll2$m4l$[email protected]..
    > When I declare a datagrid in mxml, clearly I can also
    declare the columns.
    >
    > I'm working on created my own custom grid class that
    inherits from
    > DataGrid
    > but, when I try to declare it in mxml I can no longer
    use mxml to define
    > the
    > grid columns.
    >
    > I dug through DataGrid.as looking for some sort of meta
    data that
    > described
    > what was allowed in mxml or something but couldn't find
    anything.
    >
    > Anyone else tried to do this before?
    <yourNameSpace:columns>
    <!--datagrid columns-->
    </yourNameSpace:columns>
    You can see that in action here:
    http://flexdiary.blogspot.com/2008/09/extended-datagrid-with-stylefunction.html

  • Newbie Flex Question about ComboBox in DataGrid

    Heya!
    Just downloaded Flex today and pleasantly surprised at how
    cool it is. Can any of you fine gents and girls help me out? Why
    doesn't this give me an editable column in my data grid?

    It's a pretty safe assumption that no raw editor except the OEM version will remember the in-camera settings, aside from white balance.
    Why's that? Because those settings don't really do anything anyway - they are just advance instructions for the converter.

  • DataGrid not reflecting changes after INSERT into Table. Delete from Table does.

    Wow, it's been a while.
    Hope you guys can help.
    This is my DataGrid:
    <DataGrid DataContext="{StaticResource TableAssetsViewSource}" ItemsSource="{Binding}" x:Name="TableAssetsDataGrid" AutoGenerateColumns="False" EnableRowVirtualization="True" Margin="15,10,10,10" RowDetailsVisibilityMode="VisibleWhenSelected" Grid.Column="1" HeadersVisibility="Column" CanUserResizeRows="False" IsReadOnly="True">
    <DataGrid.CellStyle>
    <Style TargetType="DataGridCell">
    <Setter Property="BorderThickness" Value="0"/>
    </Style>
    </DataGrid.CellStyle>
    <DataGrid.Columns>
    <DataGridTextColumn x:Name="NodeColumn" Binding="{Binding node}" Header="VS Number" Width="*"/>
    <DataGridTextColumn x:Name="SerialColumn" Binding="{Binding serial}" Header="Serial Number" Width="*"/>
    <DataGridTextColumn x:Name="NameColumn" Binding="{Binding name}" Header="Asset Name" Width="*"/>
    <DataGridTextColumn x:Name="TypeColumn" Binding="{Binding type}" Header="Asset Type" Width="*"/>
    <DataGridTextColumn x:Name="_dateColumn" Binding="{Binding date}" Header="Date Allocated" Width="*"/>
    <DataGridTextColumn x:Name="PoColumn" Binding="{Binding po}" Header="Purchase Order" Width="*"/>
    </DataGrid.Columns>
    </DataGrid>
    This is where I add a new Row to the Table:
    Private Sub Button_Click_1(sender As Object, e As RoutedEventArgs)
    Dim cbblocation As ComboBox = Me.FindName("LocationComboBox")
    Dim row As DataRowView = DirectCast(cbblocation.SelectedItem, DataRowView)
    Dim cbbtext As String = row.Item("node")
    Dim cbbtype As ComboBox = Me.FindName("comboBoxType")
    Dim cbbtext2 As String = cbbtype.Text
    Dim RETAILISOAMDDataSet As Retail_ISO_AMD.RETAILISOAMDDataSet = CType(Me.FindResource("RETAILISOAMDDataSet"), Retail_ISO_AMD.RETAILISOAMDDataSet)
    Dim RETAILISOAMDDataSetTableAssetsTableAdapter As Retail_ISO_AMD.RETAILISOAMDDataSetTableAdapters.tableAssetsTableAdapter = New Retail_ISO_AMD.RETAILISOAMDDataSetTableAdapters.tableAssetsTableAdapter()
    RETAILISOAMDDataSetTableAssetsTableAdapter.AddNewAsset(cbbtext, txbSerial.Text, txbName.Text, cbbtext2, Date.Today, txbPO.Text)
    node = cbbtext
    Dim mp As New MainPage
    mp.RefreshGrid(node)
    Me.Close()
    End Sub
    The RefreshGrid method:
    Public Sub RefreshGrid(node As String)
    Dim RETAILISOAMDDataSet As Retail_ISO_AMD.RETAILISOAMDDataSet = CType(Me.FindResource("RETAILISOAMDDataSet"), Retail_ISO_AMD.RETAILISOAMDDataSet)
    Dim RETAILISOAMDDataSetTableAssetsTableAdapter As Retail_ISO_AMD.RETAILISOAMDDataSetTableAdapters.tableAssetsTableAdapter = New Retail_ISO_AMD.RETAILISOAMDDataSetTableAdapters.tableAssetsTableAdapter()
    RETAILISOAMDDataSetTableAssetsTableAdapter.FillByNode(RETAILISOAMDDataSet.tableAssets, node)
    Dim TableAssetsViewSource As System.Windows.Data.CollectionViewSource = CType(Me.FindResource("TableAssetsViewSource"), System.Windows.Data.CollectionViewSource)
    Dim be As BindingExpression = BindingOperations.GetBindingExpression(TableAssetsViewSource, CollectionViewSource.SourceProperty)
    be.UpdateTarget()
    End Sub
    And this is what I use to delete a row from the table (and without doing anything special, the DataGrid auto-updates with the changes):
    Private Sub Button_Click_4(sender As Object, e As RoutedEventArgs)
    If TableAssetsDataGrid.SelectedIndex = -1 Then
    MsgBox("You have selected nothing to Delete!", MsgBoxStyle.OkOnly, "Nothing Selected")
    Else
    Dim dgv As DataGridTextColumn = Me.FindName("NodeColumn")
    Dim row As DataRowView = DirectCast(Me.TableAssetsDataGrid.SelectedItem, DataRowView)
    Dim dgvText As String = row.Item("node")
    Dim dgv2 As DataGridTextColumn = Me.FindName("SerialColumn")
    Dim row2 As DataRowView = DirectCast(Me.TableAssetsDataGrid.SelectedItem, DataRowView)
    Dim dgvText2 As String = row.Item("serial")
    Dim dgv3 As DataGridTextColumn = Me.FindName("NameColumn")
    Dim row3 As DataRowView = DirectCast(Me.TableAssetsDataGrid.SelectedItem, DataRowView)
    Dim dgvText3 As String = row.Item("name")
    Dim dgv4 As DataGridTextColumn = Me.FindName("TypeColumn")
    Dim row4 As DataRowView = DirectCast(Me.TableAssetsDataGrid.SelectedItem, DataRowView)
    Dim dgvText4 As String = row.Item("type")
    Dim dgv5 As DataGridTextColumn = Me.FindName("_dateColumn")
    Dim row5 As DataRowView = DirectCast(Me.TableAssetsDataGrid.SelectedItem, DataRowView)
    Dim dgvText5 As String = row.Item("date")
    Dim dgv6 As DataGridTextColumn = Me.FindName("POColumn")
    Dim row6 As DataRowView = DirectCast(Me.TableAssetsDataGrid.SelectedItem, DataRowView)
    Dim dgvText6 As String = row.Item("po")
    Dim RETAILISOAMDDataSet As Retail_ISO_AMD.RETAILISOAMDDataSet = CType(Me.FindResource("RETAILISOAMDDataSet"), Retail_ISO_AMD.RETAILISOAMDDataSet)
    Dim RETAILISOAMDDataSetTableAssetsTableAdapter As Retail_ISO_AMD.RETAILISOAMDDataSetTableAdapters.tableAssetsTableAdapter = New Retail_ISO_AMD.RETAILISOAMDDataSetTableAdapters.tableAssetsTableAdapter()
    RETAILISOAMDDataSetTableAssetsTableAdapter.RemoveAsset(dgvText, dgvText2, dgvText3, dgvText4, dgvText5, dgvText6)
    Dim cbb As ComboBox = Me.FindName("cbbLocation")
    Dim row7 As DataRowView = DirectCast(cbb.SelectedItem, DataRowView)
    Dim cbbtext As String = row.Item("node")
    RefreshGrid(cbbtext)
    End If
    End Sub
    --------- End of Edit
    It is bound to a Dataset which gets it's data from a SQL Database.
    Loading the Data and Filtering the data based on certain conditions work 100%. The problem I am having is as follows:
    I have a form on the Page that takes input and inserts a row into the Database. When this happens, the DataGrid won't automatically reflect the changes (even if I recall the Fill Method of the Dataset). No matter what I do, I have to refresh the entire page
    and THEN Fill the Dataset to see any changes.
    This is what strikes me as odd...
    When I do a delete row operation on the Database (Custom Method on the Dataset with conditions), and just Fill the Dataset again (without doing anything special), the row deletes and the changes is reflected IMMEDIATELY.
    What am I doing wrong here? Why would Delete Row reflect the changes on the DataGrid but no Insert Row?
    Thanks in Advance.
    (P.S. I am very rusty with my developing skills, I haven't done this in YEARS)

    >>And what about the the most important question, how exactly is TableAssetsViewSource defined in the XAML markup and what is
    its Source property set or bound to? And what about the reproducable sample...?
    Here is the Markup of the TableAssetsViewSource:
    <Page.Resources>
    <local:RETAILISOAMDDataSet x:Key="RETAILISOAMDDataSet"/>
    <CollectionViewSource x:Key="TableRegionsViewSource" Source="{Binding tableRegions, Source={StaticResource RETAILISOAMDDataSet}}"/>
    <CollectionViewSource x:Key="TableLocationsViewSource" Source="{Binding tableLocations, Source={StaticResource RETAILISOAMDDataSet}}"/>
    <CollectionViewSource x:Key="TableAssetsViewSource" Source="{Binding tableAssets, Source={StaticResource RETAILISOAMDDataSet}}"/>
    </Page.Resources>
    The ItemsSource of the DataGrid is bound to the TableAssetsViewSource:
    <DataGrid DataContext="{StaticResource TableAssetsViewSource}" ItemsSource="{Binding}" x:Name="TableAssetsDataGrid" AutoGenerateColumns="False" EnableRowVirtualization="True" Margin="15,10,10,10" RowDetailsVisibilityMode="VisibleWhenSelected" Grid.Column="1" HeadersVisibility="Column" CanUserResizeRows="False" IsReadOnly="True">
    Just remember, this code was auto-generated with the drag & drop onto the Page, so I did little in terms of setting the actual bindings.
    All in all, what I have done so far works as intended, except that when I want to add a row to the table it does not reflect, and that it only shows after refreshing/restarting the application.
    I will try and put together a reproducable sample.

Maybe you are looking for