Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
195
Binding table-like data to XamSpreadsheet
posted

Is there a way to bind a collection to the rows / columns in a worksheet of a XamSpreadsheet control?

(Like you would on a XamDataGrid via the DataSource property)

for example, to bind to an object like the one below, and display the data along columns:

public class SimpleTupleDataCollection : ObservableCollection<Tuple<double,double>>

{
public SimpleTupleDataCollection()
{
this.Add(new Tuple<double, double>(-0.8,1));
this.Add(new Tuple<double, double>(-1.8, 3.2));
this.Add(new Tuple<double, double>(-4.8, 3.0));
}
}

Thanks,

   - Nicolas

Parents
No Data
Reply
  • 34810
    Offline posted

    Hello Nicolas,

    Thank you for your post.

    Currently, the XamSpreadsheet requires a Workbook as its "ItemsSource," and the worksheets of workbook objects do not have an available property that can be bound to collections or other table-like data structures. However, something that you could do is create a Worksheet object, loop through your data collection, and place this Worksheet in a Workbook element, which you can then give to the XamSpreadsheet. A tutorial on how to create a Worksheet and populate its cells can be found here: http://help.infragistics.com/doc/WPF/2015.2/CLR4.0/?page=IGExcelEngine_Creating_a_Workbook.html.

    If you would like to see data binding support for Worksheets added in the future, consider suggesting a new product idea at http://ideas.infragistics.com. As an Infragistics user, you can create or vote on product ideas that you find most interesting. This product ideas site allows you to be in direct communication with our product management team, track the progress of your idea at any time, read comments from other developers in the community, and see if someone from the product team has additional questions for you regarding your idea.

    Please let me know if you have any other questions or concerns on this matter.

    Sincerely,
    Andrew
    Associate Developer
    Infragistics Inc.
    www.infragistics.com/support

Children
No Data