Populating a DataGridView with Webservices

akerstiensakerstiens Member Posts: 15
edited 2009-07-29 in NAV Three Tier
Hello All:

I have been working on a C# program utlizing the new Web Services. What I want to do is populate and create new rows in a datagridview. I have been searching the web for some sample code, but have not been able to find any.

The only goal I have is use the readmultiple function of webservices from a page and have the datagridview populate with the results.

Thank you for your help in advanced!!

Aaron Kerstiens

Comments

  • Ravi_ThakkarRavi_Thakkar Member Posts: 392
    Hello Aron,

    Do you want to make any transactions from the WEB into the database through Gridview or just for viewing the Records in Gridview control??
    Ravi_Thakkar
    Ahmedabad, Gujarat, India
    E Mail : ravi.thakkar@hotmail.com
  • akerstiensakerstiens Member Posts: 15
    Sorry for the delay in awnsering your question. What I am doing is only reading the list of from WS.

    Example of code:

    WS[] Record = WS.ReadMultiple(filters, null, 100);
    {
    foreach (WS Record in Records)
    {
    Add a row to a Grid (WS.Field);
    }

    }
  • freddy.dkfreddy.dk Member, Microsoft Employee Posts: 360
    I think you can do:

    DataGrid.DataSource = WS.ReadMultiple(filters, null, 0);
    Freddy Kristiansen
    Group Program Manager, Client
    Microsoft Dynamics NAV
    http://blogs.msdn.com/freddyk

    The information in this post is provided "AS IS" with no warranties, and confers no rights. This post does not represent the thoughts, intentions, plans or strategies of my employer. It is solely my opinion.
  • freddy.dkfreddy.dk Member, Microsoft Employee Posts: 360
    If you want not to show all columns, you can build a datatable with the content of the array (create the columns you need) and then set the datatable as datasource on the grid.
    Freddy Kristiansen
    Group Program Manager, Client
    Microsoft Dynamics NAV
    http://blogs.msdn.com/freddyk

    The information in this post is provided "AS IS" with no warranties, and confers no rights. This post does not represent the thoughts, intentions, plans or strategies of my employer. It is solely my opinion.
  • akerstiensakerstiens Member Posts: 15
    Thank you all for your help I the "DataGrid.DataSource = WS.ReadMultiple(filters, null, 0);" was the key!!

    Again Many Thanks!!!!!!!! :mrgreen:
  • b2amolb2amol Member Posts: 64
    Hello Akerstiens,

    I am having a similar situation, did you use an intermediate data element? If you dont mind could you post your solution please?

    Thank you,

    Amol
Sign In or Register to comment.