We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Dictionnary to SfDataGrid

Thread ID:

Created:

Updated:

Platform:

Replies:

125028 Jul 15,2016 09:39 AM Jul 26,2016 03:28 AM Xamarin.Forms 5
loading
Tags: SfDataGrid
Rosemond Jordan
Asked On July 15, 2016 09:39 AM

Hi, 

It's possible to transform Dictionnary<string, List<string>> in SfDatagrid. Where Columns = Keys and rows = values ? 

I'm forced to use an ObservableCollection ? 

There is a limit of rows or columns ? 

Thank's :) 


Vimal Prabhu Manohkaran [Syncfusion]
Replied On July 18, 2016 09:00 AM

Hi Rosemond,

Thanks for contacting Syncfusion Support.

We have checked your query “To set a Dictionary<string,List<string>> as the ItemsSource of the SfDataGrid”, this is not possible since the dictionary provides only two properties Key and Value which will be considered as the MappingName for the SfDataGrid columns. Hence only two columns will be created when a dictionary is set as itemssource to the SfDataGrid. We have prepared a sample based on your requirements where we have loaded four key value pairs as input. Please refer the screenshot below that renders the output when a dictionary is set as ItemSource to the grid.



Regards,
Vimal Prabhu


Rosemond Jordan
Replied On July 19, 2016 09:36 AM

Ok thank's. 

So have a sample for transform XML to DataGrid ? 

With a XML like : 

<Table1>
    <nom>Null</nom>
    <IdPays>FR</IdPays>
    <IdCategorie>2</IdCategorie>
    <IdModeInscription>P</IdModeInscription>
    <IdCivilite>Null</IdCivilite>
  </Table1>
  <Table1>
    <nom>BLANCHE</nom>
    <IdPays>CI</IdPays>
    <IdCategorie>V</IdCategorie>
    <IdModeInscription>P</IdModeInscription>
    <IdCivilite>MME</IdCivilite>
  </Table1>
... 

Where each <node> except "<Table1>" are columns ? Knowing that i have a different number of node every time ? 

Thank's 


Vimal Prabhu Manohkaran [Syncfusion]
Replied On July 20, 2016 08:42 AM

Hi Rosemond,

Thanks for the update.

We have checked your query. We have prepared a sample based on your requirements where we have parsed a XML file and have set your XML data as the ItemsSource of the SfDataGrid. Please find the sample from the below link.

Sample Link : http://www.syncfusion.com/downloads/support/forum/125028/ze/XMLdata-1263811514

If your requirements are different from the solution we have provided, we kindly request you to explain your requirement in an elaborate clear way so that we can help you better.

Regards,
Vimal Prabhu

Rosemond Jordan
Replied On July 22, 2016 09:06 AM

Thank's. 



Vimal Prabhu Manohkaran [Syncfusion]
Replied On July 26, 2016 03:28 AM

Hi Rosemond,

Thank you for your response. Please let us know if you may require further assistance.

Regards,
Vimal Prabhu
 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;