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
130
Smart table generation with (unfixed) min./max. values
posted

Hello,

I was wondering if you can give me some advice on how to achieve the following:

The user is asked (e.g. by 3 textblocks with content "Min. Value", "Max. Value" and "step size") to enter the min./max values and the step size he wishes to be used. The only thing that is fixed is the amount of columns (e.g. 2 in this case).

For example:

The user enters "Min. Value = 20", "Max. Value = 100", "Step Size = 10". 

The table generated should now have 9 rows with the values 20 - 100 in the first column.

The second column should calculate values depending on the values in the first row.

Furthermore both columns should be boundable (I.e. unbound column for the second row is most likely not going to work).

Unfortunately I have to stick with XamGrid.

It would be really nice if you could help me achieving this. Thank you.

Kind regards,

Julian

Parents
  • 140
    Offline posted

    Hello Julian,

    I have been investigating into your requirement to dynamically generate a data source for the XamGrid and I would recommend using a DataTable for this. You can create the DataTable dynamically based on the user's input and then set the ItemsSource of the XamGrid to this DataTable's DefaultView.

    Let me know if you need additional assistance.

    Regards.

    Nicholas

  • 130
    Offline posted in reply to Nicholas Parr

    Hello Nicholas,

    thank you for the reply.

    I've been looking to this:

    https://www.infragistics.com/samples/wpf/grid/binding-to-data-table

    However, in this example nothing is being calculated dynamically depending on the values in the first column entered by the user. This is also a requirement that I have. Otherwise I could just stick to TextColumns but (apparently) I can't calculate values (depending on first column value), show them and at the same time enable twoway binding. It would be nice if this could be done using the MVVM pattern.

    I've been trying to use the ValueConverter for this but the twoway binding is not working then. Thank you in advance.

    For clarification why I would appreciate this to be done with TextColumns: The ItemsSource of my XamGrid is already set to to XamComboEditor's SelectedValue with Twoway bindings.

    Kind regards,

    Julian

Reply Children