How to bind BubbleSeries data provider?

Hi,
I have a bubbleChart and multiple bubble series inside it. Initially I set the data provider of each of my series. Later, when I update the array collections (to which my bubble series's data provider was binded), bubble series' data provider is not updated.
<mx:BubbleChart>
     <mx:BubbleSeries dataprovider={arr[0]}>
     </mx:BubbleSeries>
     <mx:BubbleSeries dataprovider={arr[1]}>
     </mx:BubbleSeries>
     <mx:BubbleSeries dataprovider={arr[2]}>
     </mx:BubbleSeries>
</mx:BubbleChart>
In actionscript, arr[0],arr[1] and arr[2] are updated. I want to see updated bubbleseries too, but in vain.
I have marked arr as bindable.
Please help..
Thanks,
Tanu

Hi Tanu Jain,
If you have no problem updating the values there itself.. then you can do one thing...But the way you are trying to update the things is however correct but it will not update the values for BubbleSeries. The reason is why because the each object and its properties in the expenses array collection are not Bindable as since the objects in the expenses array collection are generic objects.
In order to make the objects bindable you can make use of a seperate class and make all the properties Bindable as needed so that you can acheive things you needed.
And one more thing here to note is ...when you are assiging the dataProvider the first time in the for loop you are using the below line of code...
bubbleSeries.dataProvider = expenses.getItemAt(i);
But in the click handler you are reassigning the dataProvider as expenses = expenses1; by doing so you are assigning/adding new items to your expenses ArrayCollection but the binding you assigned to the bubbleSeries dataProvider are different items so there is no possibility of updating the values to the BubbleSeries by this approach so you should update the values there itself by making use of external Bindable class so that Bubble Series gets updated correctly.
Actually I got this sorted out yesterday itself but you said as you are having some 200 - 300 series it is taking more time delay to get updated by reassigning the dataProvider by looping through the series as I suggested in my previous post. By updating the values there itself say if you have some 300 - 400 rows in your expenses ArrayCollection then you need to loop through all the rows(300 - 400 times)  and update all the properties within that Object.
Any way try this example below which I am explaining above...hope this is less expensive when compared to reassigning the dataProvider again..
<!-- Bindable class BubbleSeriesVO -->
package
[Bindable]
public class BubbleSeriesVO
        public var Month:String;
        public var Profit:Number;
        public var Expenses:Number;
        public var amt:Number;
  public function BubbleSeriesVO()
<!-- Application Source Code -->
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" minWidth="955" minHeight="600" creationComplete="init()">
    <mx:Script>
        <![CDATA[
            import mx.charts.series.BubbleSeries;
            import mx.collections.ArrayCollection;
            /* [Bindable]
            public var expenses:ArrayCollection = new ArrayCollection([
                {Month:"Jan", Profit:2000, Expenses:1500,amt:200},
                {Month:"Feb", Profit:1000, Expenses:200,amt:340},
                {Month:"Mar", Profit:1500, Expenses:500,amt:500}
            [Bindable]public var expenses:ArrayCollection;
            [Bindable]public var expenses1:ArrayCollection;
            /* [Bindable]
            public var expenses1:ArrayCollection = new ArrayCollection([
                {Month:"Jan", Profit:2500, Expenses:1500,amt:1000},
                {Month:"Feb", Profit:1500, Expenses:200,amt:2000},
                {Month:"Mar", Profit:2000, Expenses:500,amt:1500}
            private function createExpensesCollection():void
             //Creating expenses ArrayCollection
             expenses = new ArrayCollection();
             var bubbleVO:BubbleSeriesVO = new BubbleSeriesVO();
             bubbleVO.Month = "Jan";
             bubbleVO.Profit = 2000;
             bubbleVO.Expenses = 1500;
             bubbleVO.amt = 200;
             expenses.addItem(bubbleVO);
             bubbleVO = new BubbleSeriesVO();
             bubbleVO.Month = "Feb";
             bubbleVO.Profit = 1000;
             bubbleVO.Expenses = 200;
             bubbleVO.amt = 340;
             expenses.addItem(bubbleVO);
             bubbleVO = new BubbleSeriesVO();
             bubbleVO.Month = "Mar";
             bubbleVO.Profit = 1500;
             bubbleVO.Expenses = 500;
             bubbleVO.amt = 500;
             expenses.addItem(bubbleVO);
             //Creating expenses1 ArrayCollection
             expenses1 = new ArrayCollection();
             bubbleVO = new BubbleSeriesVO();
             bubbleVO.Month = "Jan";
             bubbleVO.Profit = 2500;
             bubbleVO.Expenses = 1500;
             bubbleVO.amt = 1000;
             expenses1.addItem(bubbleVO);
             bubbleVO = new BubbleSeriesVO();
             bubbleVO.Month = "Feb";
             bubbleVO.Profit = 1500;
             bubbleVO.Expenses = 200;
             bubbleVO.amt = 2000;
             expenses1.addItem(bubbleVO);
             bubbleVO = new BubbleSeriesVO();
             bubbleVO.Month = "Mar";
             bubbleVO.Profit = 2000;
             bubbleVO.Expenses = 500;
             bubbleVO.amt = 1500;
             expenses1.addItem(bubbleVO);
            private function init():void
             createExpensesCollection();
                var bubbleSeriesColl:Array = new Array();
                for(var i:int = 0; i < expenses.length; i++)
                    var bubbleSeries:BubbleSeries = new BubbleSeries();
                    bubbleSeries.xField = "Profit";
                    bubbleSeries.yField = "Expenses";
                    bubbleSeries.radiusField = "amt";
                    bubbleSeries.dataProvider = expenses.getItemAt(i);
                    bubbleSeriesColl.push(bubbleSeries);               
                myChart.series = bubbleSeriesColl;               
            private function clickHandler():void
                //expenses = expenses1;
                for(var i:int = 0; i < expenses1.length; i++)
                 if(i >= expenses.length)
                  break;
                 (expenses.getItemAt(i) as BubbleSeriesVO).Month = (expenses1.getItemAt(i) as BubbleSeriesVO).Month;
                 (expenses.getItemAt(i) as BubbleSeriesVO).Profit = (expenses1.getItemAt(i) as BubbleSeriesVO).Profit;
                 (expenses.getItemAt(i) as BubbleSeriesVO).Expenses = (expenses1.getItemAt(i) as BubbleSeriesVO).Expenses;
                 (expenses.getItemAt(i) as BubbleSeriesVO).amt = (expenses1.getItemAt(i) as BubbleSeriesVO).amt;
                expenses.refresh();
                //updateBuubleSeries();
            private function updateBuubleSeries():void
              for(var i:int = 0; i < myChart.series.length; i++)
                    myChart.series[i].dataProvider = expenses.getItemAt(i);
        ]]>
    </mx:Script>
    <mx:BubbleChart id="myChart" showDataTips="true">          
    </mx:BubbleChart>
    <mx:Button label="change Data" click="clickHandler()" />
</mx:Application>
Thanks,
Bhasker

Similar Messages

  • How to creat a Data provider  based on different fields in SAP BW ?

    Hi,
    Experts,
    There are  20 fields  of  Plant Maintainace  like : 
    SWERK
    BEBER
    STORT
    TPLNR
    EQUNR
    INGRP
    QMDAT   ---peroid
    STTXT
    QMDAT  - Date of Notification
    QMNUM
    QMTXT
    QMART
    AUSVN
    AUZTV
    AUSBS
    AUZTB
    AUSZT
    ERNAM
    QMDAB
    AUFNR
    I  want to creat a  Report based upon these fields  ?
    For that I h'v  checked the relevant Fields to the   existing standard  Datasource  in Bw side   &
    Checked  cubes   created  based upon these Datasource  in Bw side !
    i h'v found  some fields are  existing different cubes & some are  missing .
    How to creat a Data provider  based on different fields in SAP BW ?
    plz suggest      !!!!!!!
    Thanx,
    Asit
    Edited by: ASIT_SAP on Jul 15, 2011 6:25 AM
    Edited by: ASIT_SAP on Jul 15, 2011 6:27 AM
    Edited by: ASIT_SAP on Jul 15, 2011 12:37 PM

    Hi Lee, Please see below..
    DECLARE @Machine2 TABLE
    DispatchDate DATE
    INSERT INTO @Machine2 VALUES ('2014/02/01'), ('2014/02/02'), ('2014/02/03')
    DECLARE @DateFrom DATE
    SELECT @DateFrom = DATEADD(D,1,MAX(DispatchDate)) FROM @Machine2
    SELECT @DateFrom AS DateFrom
    Please mark as answer, if this has helped you solve the issue.
    Good Luck :) .. visit www.sqlsaga.com for more t-sql code snippets and BI related how to articles.

  • How to bind Dimension data to SDK Component

    Hi Guys,
    I am trying to create a Cascading box component with the help of SDK development using eclipse.
    I don't know how can I get the dimension data to my component.
    when I am using data binding property type as "resultCellList" then I am able to bind the Measures' data to the component.
    Can anybody suggest me how to bind dimension data to my SDK component?

    In the menu under Help Contents, there is an SDK section with examples that spell this out for you.
    There is also an easier to read and print PDF on the SAP Help site here:
    http://help.sap.com/businessobject/product_guides/AAD14/en/ds14SP02_dev_guide_en.pdf
    Also premade samples here:
    http://help.sap.com/businessobject/product_guides/AAD14/en/DS_14SP02_SDK_SAMPLES.zip
    Main DS Help Site:
    SAP BusinessObjects Design Studio 1.4 SP02 – SAP Help Portal Page
    SDK Community Site with other examples and Open Source links:
    SCN Design Studio SDK Development Community

  • How to change the data provider of the tree with the selection of combobox

    This is my XML data in a file named `nodesAndStuff.xml`.
        <?xml version="1.0" encoding="utf-8"?>
        <root>
            <node label="One" />
            <node label="Two" />
            <node label="Three" />
            <node label="Four" />
            <node label="Five" />
            <node label="Six" />
            <node label="Seven" />
            <node label="Eight" />
            <node label="Nine" />
        </root>
    The component using this data source is an `XMLListCollection` which is bound to a spark `ComboBox` and the code for that is:
        <s:Application name="Spark_List_dataProvider_XML_test"
            xmlns:fx="http://ns.adobe.com/mxml/2009"
            xmlns:s="library://ns.adobe.com/flex/spark"
            xmlns:mx="library://ns.adobe.com/flex/halo"
            initialize="init();">
        <fx:Script>
            <![CDATA[
                private function init():void {
                    xmlListColl.source = nodes.children();
    private function closeHandler(event:Event):void {
                    myLabel.text = "You selected: " +  ComboBox(event.target).selectedItem.label;                 myData.text = "Data: " +  ComboBox(event.target).selectedItem.data;
            ]]>
        </fx:Script>
        <fx:Declarations>
            <fx:XML id="nodes" source="nodesAndStuff.xml" />
        </fx:Declarations>
        <mx:ComboBox id="cmbList" dataProvider="{ListXLC}" labelField="STOREVALUE"  close="closeHandler(event);"/>
         <s:dataProvider>
            <s:XMLListCollection id="xmlListColl" />
         </s:dataProvider>
    </mx:ComboBox>
    <mx:VBox width="250" color="0x000000">
                <mx:Text  width="200" color="blue" text="Select a type of credit card."/>
                <mx:Label id="myLabel" text="You selected:"/>
                <mx:Label id="myData" text="Data:"/>
            </mx:VBox> 
    <mx:Tree id="myTree" width="50%" height="100%" visible="false" />
    </s:Application>
    now another of my xml for example this is one.xml
    <?xml version="1.0" encoding="utf-8"?>
    <root>
        <node label="Eleven" />
        <node label="Twelve" />
        <node label="Thirteen" />
        <node label="Fourteen" />
        <node label="Fifteen" />
        <node label="Sixteen" />
        <node label="Seventeen" />
        <node label="Eightteen" />
        <node label="Nineteen" />
    </root>
    and another one is two.xml
    <?xml version="1.0" encoding="utf-8"?>
    <root>
        <node label="twety one" />
        <node label="twety two" />
        <node label="twety three" />
        <node label="twety four" />
        <node label="twety five" />
        <node label="twety six" />
        <node label="twety seven" />
        <node label="twety eight" />
        <node label="twety nine" />
    </root>
    Now I have added my tree just below the list and I have saved counting from 10 to 19 in `one.xml`, 20 to 29 in `two.xml` and so on in different XML file. I have no clue how to connect the XML containing counting from 10 to 19 as the single node in tree at the selection of label one in list and make its visiblity true.this all are dependent on combobox as on selection of item in combobox will lead to change the dataprovider of tree at runtime. i.e on selecting value one in combobox one.xml should be the data provider for tree control. Can anyone help me on this

    This is my XML data in a file named `nodesAndStuff.xml`.
        <?xml version="1.0" encoding="utf-8"?>
        <root>
            <node label="One" />
            <node label="Two" />
            <node label="Three" />
            <node label="Four" />
            <node label="Five" />
            <node label="Six" />
            <node label="Seven" />
            <node label="Eight" />
            <node label="Nine" />
        </root>
    The component using this data source is an `XMLListCollection` which is bound to a spark `ComboBox` and the code for that is:
        <s:Application name="Spark_List_dataProvider_XML_test"
            xmlns:fx="http://ns.adobe.com/mxml/2009"
            xmlns:s="library://ns.adobe.com/flex/spark"
            xmlns:mx="library://ns.adobe.com/flex/halo"
            initialize="init();">
        <fx:Script>
            <![CDATA[
                private function init():void {
                    xmlListColl.source = nodes.children();
    private function closeHandler(event:Event):void {
                    myLabel.text = "You selected: " +  ComboBox(event.target).selectedItem.label;                 myData.text = "Data: " +  ComboBox(event.target).selectedItem.data;
            ]]>
        </fx:Script>
        <fx:Declarations>
            <fx:XML id="nodes" source="nodesAndStuff.xml" />
        </fx:Declarations>
        <mx:ComboBox id="cmbList" dataProvider="{ListXLC}" labelField="STOREVALUE"  close="closeHandler(event);"/>
         <s:dataProvider>
            <s:XMLListCollection id="xmlListColl" />
         </s:dataProvider>
    </mx:ComboBox>
    <mx:VBox width="250" color="0x000000">
                <mx:Text  width="200" color="blue" text="Select a type of credit card."/>
                <mx:Label id="myLabel" text="You selected:"/>
                <mx:Label id="myData" text="Data:"/>
            </mx:VBox> 
    <mx:Tree id="myTree" width="50%" height="100%" visible="false" />
    </s:Application>
    now another of my xml for example this is one.xml
    <?xml version="1.0" encoding="utf-8"?>
    <root>
        <node label="Eleven" />
        <node label="Twelve" />
        <node label="Thirteen" />
        <node label="Fourteen" />
        <node label="Fifteen" />
        <node label="Sixteen" />
        <node label="Seventeen" />
        <node label="Eightteen" />
        <node label="Nineteen" />
    </root>
    and another one is two.xml
    <?xml version="1.0" encoding="utf-8"?>
    <root>
        <node label="twety one" />
        <node label="twety two" />
        <node label="twety three" />
        <node label="twety four" />
        <node label="twety five" />
        <node label="twety six" />
        <node label="twety seven" />
        <node label="twety eight" />
        <node label="twety nine" />
    </root>
    Now I have added my tree just below the list and I have saved counting from 10 to 19 in `one.xml`, 20 to 29 in `two.xml` and so on in different XML file. I have no clue how to connect the XML containing counting from 10 to 19 as the single node in tree at the selection of label one in list and make its visiblity true.this all are dependent on combobox as on selection of item in combobox will lead to change the dataprovider of tree at runtime. i.e on selecting value one in combobox one.xml should be the data provider for tree control. Can anyone help me on this

  • How to bind the data from user table into user report

    Hi All,
      Please assist me to bind the data from user table into user report. I did create an user table with data and create a user report template (using Query Print Layout). How can I display my data into report format which I created before? Any sample program or document I can refer?
    Platform: SAPB1 2005A
    Add On Language: VB.Net 2003
    Thanks.
    rgds
    ERIC

    Hi Ibai,
      Thanks for your feed back. I give you an example.
    Let say now i wanna print employee list, so i will go
    1. Main Menu -> Reports -> HR -> Employee List
    2. Choose the Selection Criteria -> OK
    3. Matrix will display (Employee List)
    4. I can print the report click on print button
    5. Printing report
    My target
    1. Main Menu -> Eric_SubMenu -> Employee List
    2. Matrix will display (Employee List)
    3. Print button
    4. Print report
    My problem
    Now I would like to use my own report format. My own report format means I wanna add on my logo or do some customization within the employee report. So how I am going to do? I only able to display the employee list in matrix. How do I create a new report format and display it.
    Thanks.
    rgds
    ERIC

  • How to bind list data to XML Web service request

    How do I bind specific columns in a DataGrid to the Web
    service request? I'm having trouble finding any documentation that
    addresses that specific pattern, i.e. sending a complex list to the
    server via a Flex Web service send() command. I'm fairly new to
    Flex programming and don't know if what I want to do is possible.
    Here what I've been able to do so far.
    1. Using a Web service called a service on the server and
    retrieved a complex list.
    2. Poplulated a DataGrid with the result
    3. The user has selected multiple rows from the DataGrid
    using a checkbox column
    4. The user pressed a button that calls a Web service send().
    This Web service should only send data from only two columns and
    only for those rows the user has checked.
    5. I can loop over the DataGrid and find the selected rows
    and put them in another ArrayCollection called 'selectedRows'.
    The issue is that I don't know how to bind 'selectedRows' to
    the Web service. Right now I'm reading up on "Working with XML" in
    the Programming with ActionScript 3.0 chapter. But I'm just fishing
    here. No bites yet.

    Don't bind. Build the request object programatically, as you
    are doing with your selectedRows AC, and send(myObject) that.
    Tracy

  • How-to bind binary data into textbox

    can i bind binary data into the textbox....
    coz..i get human unreadable character
    [B@184b867#     binary data - byte array
    supposingly ..i just need to convert to bytes.toString() to see the content...
    yet i try but..it still return this weird character...any idea...
    OutMailBean outMailBean = new OutMailBean();
    outMailBean.setHost(request.getParameter("SMTP").trim());
    outMailBean.setPort(request.getParameter("port").trim());
    outMailBean.setMessages(request.getParameterValues("message"));    //string[]
    //convert to byte array
    outMailBean.setMessage(util.convertStringBufferToByteArr(bean.getMessages()));
    //insert into table
    Statement stmt = con.createStatement();
    try {
    ResultSet rs = stmt.executeQuery(squery);
    try {
    while (rs.next()) {
    OutMailBean outMailBean = new OutMailBean();
    outMailBean.setEmailId(rs.getString("EMAILID"));
    outMailBean.setDateIn(rs.getString("DATEIN"));
    outMailBean.setMessage(rs.getBytes("MESSAGE"));
    System.err.println(rs.getBytes("MESSAGE").toString());
           //this will return human unreadable form........
    OutMailAckBean outMailAckBean = new OutMailAckBean();
    outMailAckBean.setAckDelivery(rs.getString("ACKDELIVERY"));     
    outMailAckBean.setReceipient(rs.getString("RECEIPIENT"));
    beanList.add(outMailBean);
    beanList.add(outMailAckBean);
                        } finally {
                             rs.close();
                   } finally {
                        stmt.close();
    Message was edited by:
            yzme yzme
    Message was edited by:
            yzme yzme

    Hi yzme,
    You need to convert the binary data to characters, a String, before you can properly display it. You say that <i>System.err.println(rs.getBytes("MESSAGE").toString());</i> prints human unreadable stuff. Maybe you need to use another character encoding, like this
    byte[] message = rs.getBytes("MESSAGE");
    String s = new String(message, "UTF-8"); // or "ISO-8859-1"
    It all depends on how the original email message, presumably text, was stored in the database. There's no general way to convert a byte[] to a String and vice versa.
    BTW, if you populate your OutMailBean using <i>outMailBean.setMessages(request.getParameterValues("message"));</i> then you're actually saying an email can have several messages and OutMailBean contains a <i>String[] messages</i> attribute. Then, you call the <i>outMailBean.setMessage</i> method which implies an email has one message and according to you comment OutMailBean contains a <i>byte[] message</i> attribute. The question is of course how you convert the <i>String[] messages</i> attribute to the <i>byte[] message</i> attribute. In other words, what does <i>util.convertStringBufferToByteArr</i> exactly do? It doesn't even convert a <i>StringBuffer</i>, but a <i>String[]</i>. What you probably want to do is something like
    //OutMailBean bean
    String[] messages = bean.getMessages();
    StringBuffer sb = new StringBuffer();
    for (int j = 0; j < messages.length; j++) {
      sb.append("message ").append(j).append("rn");
      sb.append(messages[j]).append("rnrn");
    bean.setMessage(sb.toString().getBytes("UTF-8"));
    Kind regards,
    Sigiswald

  • How to bind dynamic data to JNet

    Develop tools: NWDS 7.1
    Server: Windows2000
    Does anyone have experiences with using JNET within Webdynpro Project ?
    In our case, we use JNet to generate a hierachical network diagram in the Webdypro's GUI. The data source is from the tables in a DB. However, till now, we only know how to let JNet generate the network diagram from a static XML file.
    Since the data in the DB changes all the time, how to let the network diagram reflect the newest data status automatically? That is, how to bind JNet to a dynamic data source then?

    Hi,
    Network UI element is related with Jnet. What you need to start up working with this is you need to create a context structure mentioned below.
    Node:Source
    Element--- xml -> this should be of type binary.
    Place the following code in the init.
    ISimpleTypeModifiable mod = wdContext.nodeSource().getNodeInfo().getAttribute("xml").getModifiableSimpleType();
    IWDModifiableBinaryType bin = (IWDModifiableBinaryType)mod;
    bin.setMimeType(new WDWebResourceType("xml", "application/octet-stream", false));
    ISourceElement element =wdContext.nodeSource().createSourceElement();
    wdContext.nodeSource().addElement(element);
    try
    fileName = WDURLGenerator.getResourcePath(wdComponentAPI.getDeployableObjectPart(), "jnettest.xml");
    element.setXml(readFile(fileName));
    catch (WDAliasResolvingException e)
    You have to place the Jnet test.xml under the mimes folder of your application.
    Place the network element in the view and in the data source specify the context attribute source.xml
    if your xml file complies with the jnet schema your application will render it.
    Pl go through this
    Using the "Network" UI Element
    Regards
    Ayyapparaj

  • How to bind table data to datatable component and show all the table data??

    I bind table to datatable component !
    The datatable has four rows,
    but the datatable alway show the first row data in its four rows,why??

    do you mean at design time or at runtime?
    at design time, the datatable uses generic fields to
    show if data type is numeric, text, date, etc...
    If this is at runtime,
    - what driver are you using?
    - how did you bind the data to the table?
    - what is the resulting code in the Java backing file?
    hth,
    -Alexis

  • How to bind XMLType data in JDBC application

    Hi
    I have an XMLType column.I was updating that column data as
    update DOCUMENT set RECORD_DATA =sys.XMLType.createXML('" + recordData +"') where doc_id = 100
    It was working fine as long as the recordData length is less than 4000 chars.
    If it is beyond 4000 chars it is giving ORA-01704 "String literal too long"error.The documentation says we have to bind the data if it is more than 4000 chars.
    Can anybody give how we can bind XMLType data in Java.
    can we use prepareStatement.setClob( ) or setObject() ?
    I tried to pass the String in setClob and setObject,but it didn't worked.how do we create XMLType object in Java appplication and pass .
    please give the info.
    Thanks in advance.

    You really need to use the OCI driver if you are dealing with XMLType via JDBC.

  • How to bind the data from my data source table to my jsp action form

    I am doing one small application in that i need to bind my data to the database table, that means if i enter any data in my action form fields then it should get appended at database. I have done the binding but it is not appending to the database table. May be i didnt bind the data properly, can anyone help me out in solving this problem. Its very urgent because i have to submit this application today itself. Please help me out from this problem. please tell me from the basics and give me some example.
    Thanking you in advance

    hi,
    try this:
    http://developers.sun.com/prodtech/javatools/jscreator/learning/tutorials/2/inserts_updates_deletes.html
    http://developers.sun.com/prodtech/javatools/jscreator/learning/tutorials/2/dataproviders.html
    regards,
    rpk

  • How to bind several data (more then 7300) to datagrid

    Hello,
    I am trying to  bind to datagrid several data. I created an observablecollection, i stocked data into this collection and then i binded this collection to my datagrid. In xaml file i declared my datacontext. When i did it my visual studio and all application
    on my computer clock. I can't do anything. A simple think that i can do, is to close session and restart .
    I need help.
    Here is some sample:
    code cs ViewModel:
    using System;
    using System.Collections.Generic;
    using System.Text;
    using GestionDeContrats_Offres_ClientsGUI.VueModele;
    using System.Collections.ObjectModel;
    using System.Windows.Data;
    using System.ComponentModel;
    using GestionDeContrats_Offres_Clients.GestionOffres;
    using GestionDeContrats_Offres_Clients.GestionContrats;
    using System.Windows.Input;
    using GestionDeContrats_Offres_Clients.GestionModele;
    using GestionDeContrats_Offres_ClientsGUI.crm;
    using System.Data;
    namespace GestionDeContrats_Offres_ClientsGUI.VueModele
        /// <summary>
        /// </summary>
       public class GestionDeContratVueModele : VueModeleBase
            private readonly ObservableCollection<ContratVueModele> contrats;
            private readonly PagingCollectionView pagingView;
            private GestionDeContrat gestiondecontrat;
           /// <summary>
           /// Constructeur de la classe
           /// GestionDeContratVueModele
           /// </summary>
            public GestionDeContratVueModele() {
                try
                    this.gestiondecontrat = new GestionDeContrat();
                    this.contrats = new ObservableCollection<ContratVueModele>();
                    this.contrats.Clear();
                    foreach (contract contrat in this.gestiondecontrat.ListeDeContrat())
                       // this.contrats.Add(new ContratVueModele());
                             this.contrats.Add(new ContratVueModele() { NOMDUCONTRAT = contrat.title, DATEDEDEBUT = contrat.activeon.Value, DATEDEFIN
    = contrat.expireson.Value, LESTATUT = contrat.statecode.formattedvalue,LESTATUTAVANT=contrat.access_etatavant.name });
                    this.pagingView = new PagingCollectionView(this.contrats, 3);
                    if (this.pagingView == null)
                        throw new NullReferenceException("pagingView");
                    this.currentpage = this.pagingView.CurrentPage;
                    this.pagingView.CurrentChanged += new EventHandler(pagingView_CurrentChanged);
                catch(System.Web.Services.Protocols.SoapException soapEx){
                    soapEx.Detail.OuterXml.ToString();
           /// <summary>
           /// </summary>
           /// <param name="sender"></param>
           /// <param name="e"></param>
            void pagingView_CurrentChanged(object sender, EventArgs e)
                OnPropertyChanged("SelectedContrat");
                Dispose();
                //throw new NotImplementedException();
                    /// <summary>
            /// Propriété permettant de manipuler la
            ///Vue Modèle de la liste des contrats
            /// </summary>
            public ObservableCollection<ContratVueModele> Lescontrats
                get
                    return this.contrats;
           code xaml:
           <UserControl x:Class="GestionDeContrats_Offres_ClientsGUI.VueModele.UserControlGestionContrat"
                 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                 xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
                 xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
                 mc:Ignorable="d"
                 x:Name="GestionContrat"
                 xmlns:local="clr-namespace:GestionDeContrats_Offres_ClientsGUI.VueModele"
                 d:DesignHeight="300"  >
        <UserControl.DataContext>
            <local:GestionDeContratVueModele  />
        </UserControl.DataContext>
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="30"/>
                <RowDefinition Height="40"/>
                <RowDefinition />
                <RowDefinition Height="40"/>
            </Grid.RowDefinitions>
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="320"/>
                    <ColumnDefinition Width="40" />
                </Grid.ColumnDefinitions>
                <TextBox Name="searchtexbox" Grid.Column="0"/>
                <Image Grid.Column="1" Source="/GestionDeContrats_Offres_ClientsGUI;component/Images/16_find.gif" />
            </Grid>
            <ToolBar Grid.Row="1" Name="toolbarcontrat">
                <Button    Name="btNewContrat"  Click="btNewContrat_Click">
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition/>
                            <ColumnDefinition/>
                        </Grid.ColumnDefinitions>
                        <Image Source="/GestionDeContrats_Offres_ClientsGUI;component/Images/plusvert.jpg" />
                        <Label Content="Nouveau" Grid.Column="1"/>
                    </Grid>
                </Button>
                <Button    Name="btCopierContrat" >
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition/>
                            <ColumnDefinition/>
                        </Grid.ColumnDefinitions>
                        <Image Source="/GestionDeContrats_Offres_ClientsGUI;component/Images/editcopy.png" />
                        <Label Content="Copier" Grid.Column="1"/>
                    </Grid>
                </Button>
                <Button    Name="btSupprimerContrat" >
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition/>
                            <ColumnDefinition/>
                        </Grid.ColumnDefinitions>
                        <Image Source="/GestionDeContrats_Offres_ClientsGUI;component/Images/delgreen16.jpg" />
                        <Label Content="Supprimer" Grid.Column="1"/>
                    </Grid>
                </Button>
                <Button    Name="btModifierContrat" >
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition/>
                            <ColumnDefinition/>
                        </Grid.ColumnDefinitions>
                        <Image Source="/GestionDeContrats_Offres_ClientsGUI;component/Images/ico_18_4207.gif" />
                        <Label Content="Modifier" Grid.Column="1"/>
                    </Grid>
                </Button>
            </ToolBar>
            <DataGrid Name="listViewContrat" Grid.Row="2" ItemsSource="{Binding Path=Lescontrats, Mode=OneWay}"  IsSynchronizedWithCurrentItem="True" AutoGenerateColumns="False"
    CanUserReorderColumns="True" CanUserResizeColumns="True" CanUserSortColumns="True" CanUserAddRows="True" CanUserDeleteRows="True">
                <DataGrid.Columns>
                    <DataGridTemplateColumn Header="Nom du contrat" >
                        <DataGridTemplateColumn.CellTemplate>
                            <DataTemplate>
                                <TextBlock Text="{Binding Path=NOMDUCONTRAT, Mode=OneWay}"/>
                            </DataTemplate>
                        </DataGridTemplateColumn.CellTemplate>
                    </DataGridTemplateColumn>
                    <DataGridTemplateColumn Header="Date de début" >
                        <DataGridTemplateColumn.CellTemplate>
                            <DataTemplate>
                                <TextBlock Text="{Binding Path=DATEDEDEBUT, Mode=OneWay}"/>
                            </DataTemplate>
                        </DataGridTemplateColumn.CellTemplate>
                    </DataGridTemplateColumn>
                    <DataGridTemplateColumn Header="Date de fin"  >
                        <DataGridTemplateColumn.CellTemplate>
                            <DataTemplate>
                                <TextBlock Text="{Binding Path=DATEDEFIN, Mode=OneWay}"/>
                            </DataTemplate>
                        </DataGridTemplateColumn.CellTemplate>
                    </DataGridTemplateColumn>
                    <DataGridTemplateColumn Header="Statut" >
                        <DataGridTemplateColumn.CellTemplate>
                            <DataTemplate>
                                <TextBlock Text="{Binding Path=LESTATUT,Mode=OneWay}"/>
                            </DataTemplate>
                        </DataGridTemplateColumn.CellTemplate>
                    </DataGridTemplateColumn>
                    <DataGridTemplateColumn Header="Statut avant" >
                        <DataGridTemplateColumn.CellTemplate>
                            <DataTemplate>
                                <TextBlock Text=""/>
                            </DataTemplate>
                        </DataGridTemplateColumn.CellTemplate>
                    </DataGridTemplateColumn>
                </DataGrid.Columns>
            </DataGrid>
            <StackPanel Grid.Row="3" Orientation="Horizontal">
                <Label Margin="2" Content=""/>
                <Button Content="Suivant" Name="btNext" Margin="2" />
                <Button Content="Précédent" Name="btPrevious" Margin="2"  />
            </StackPanel>
        </Grid>
    </UserControl>
     I include link to this usercontrol into MainWindow.xaml.
    Thanks 
    Regards      

    I think what darnold was trying to say....
    Those very clever people who come up with insights on human behaviour have studied how many records a user can work with effectively.
    It turns out that they can't see thousands of records at once.
    Their advice is that one presents a maximum of 200-300 records at a time.
    What with maybe 40 fitting on a screen at a time. Few people like spending 20 minutes scrolling through a stack of data they're not interested in to find the one record they're after.
    Personally, I would use a treeview, set of combos or some such so the user can select what subset they are interested in and present just that.
    Anyhow.
    If you have a viewmodel which exposes an observable collection<t> as a public property you can bind the itemssource of a datagrid to that.
    Although UI controls have thread affinity, the objects in such a collection do not.
    That means you can use another thread to go get your data, add it to the observable collection, the fact it's an observable collection tells the view as records are added and it will show them. The ui will remain responsive.
    You can do this using skip and take to read a couple hundred records at a time and add those, pause and repeat for the next couple hundred records.  Use linq - skip and take.
    Please don't forget to upvote posts which you like and mark those which answer your question.
    My latest Technet article - Dynamic XAML

  • How to remove the DATA Provider(Query) from the WAD 3.5

    Hi,
         I want to remove the unused dataprovider(query) from the WAD 3.5,
         How to delete the dataprovider.
    Please suggest here

    Go to HTML tab. You will see all the data providers on top. You can delete the unused ones there.

  • I Unable to bind a data provider to a TREE component

    I know this should be easy, but I am trying to switch the following
    myTree.dataProvider=event.result;
    to
    private var treeSource:XML;
    treeSource = event.result;
    myTree.dataProvider = treeSource
    BUT, no matter what XML type I use I keep getting a compilation error 1118: Implicit coercion of a value with static type Object to a possibly unrelated type XML. Obviously I am missing something.

    I have the solution.
    var xmlList:XMLList = XML(event.result).node; 
    myXmlList =
    new XMLListCollection(xmlList);mainTree.dataProvider =
    new XMLListCollection(xmlList);

  • How to get list data and bind to data table or Grid view in share point 2010 using j query

    hi,
    How to bind list data in to data table or  grid view  using Sp Services.
    How to use sp services in share point 2010 lists and document library 

    Hi, You can use List service, SPServices and JQuery to get your requiement done-
    See here for an sample implementation -
    http://sympmarc.com/2013/02/26/spservices-stories-10-jqgrid-implementation-using-spservices-in-sharepoint/
    http://www.codeproject.com/Articles/343934/jqGrid-Implementation-using-SpServices-in-SharePoi
    Mark (creator of SPServices) has some good documentation on how to use SPServices-
    http://spservices.codeplex.com/wikipage?title=%24().SPServices
    SPServices Stories #7 – Example Uses of SPServices, JavaScript and SharePoint
    http://sympmarc.com/2013/02/15/spservices-stories-7-example-uses-of-spservices-javascript-and-sharepoint/
    Hope this helps!
    Ram - SharePoint Architect
    Blog - SharePointDeveloper.in
    Please vote or mark your question answered, if my reply helps you

Maybe you are looking for

  • Free goods process

    Dear All, I refer to the ECC process of issuing free goods w r t a material, using T code VBN1. Is there any similar process in CRM too? Kindly enlighten. Regards, Tariq

  • Item text in Purchase request is not copied to Purchase orders.why?

    que1:Item text in Purchase request is not copied to Purchase orders.why? que.2:where this item text is get stored, i mean to ask which table. please reply asp. SAP Learner.

  • OS X resizing PDF problem.

    hi everyone! i have an indesign file that needs to be resized to 15.24cm x 22.86cm for printing. using the setup option within the file>print dialogue  i am unable to resize it. the options are just greyed out. i dont have any printers installed at t

  • Loading JDBC-Driver from a JSP

    Hi, i want to load a JDBC-Driver fromout my JSP-File, so i used: Class.forName("org.postgresql.Driver"); but when i start it i get a ClassNotFoundException... my jsp-file and the org-directory are stored in <tomcat-dir>\webapps\examples\ so both in t

  • Apache comons logging implemented it a wrapper around it

    hi friends, i have an interesting (unsually )problem regaurding apache commons logging, i am using three classes . one is the logger class where i instantiate the logging instance ie Log log = LogFactory .getLog("some name"); then there is a class ca