locked
Binding to a matrix RRS feed

  • Question

  • Hi. I would like to know if it is possible to bind a bidimensional matrix of business objects (the same property) to a bidimensional matrix of labels at design time. My impression is that it is not possible. Even if I could see the matrix like a set of rows, in order to add a data source for each row, my impression is that it is not possible as well because I can not bind a label to a specific element of the row, at design time I mean. So, I have the impression that I should implement it by code behind. Thanks.
    Friday, January 4, 2013 9:39 AM

Answers

  • Speculor,

    You are writting in code behind, this gives me the impression that you state this for a solution where an engine is running a not connected User Interface (mostly in fact a Web page).

    Because it is disconnected it is mostly impossible to bind it to a more dimensional data container of any format. (Or you should do that on the client side by sending the container with that).

    If the UI is connected to the data, then the DataBinding is standard for so called simple binding controls in columns and for complex bindable controls in matrixes (DataGridView, DataGrid, ListBox, Combobox)


    Success
    Cor

    • Proposed as answer by The Thinker Friday, January 4, 2013 1:30 PM
    • Marked as answer by Mike Feng Monday, January 7, 2013 10:03 AM
    Friday, January 4, 2013 10:49 AM

All replies

  • Speculor,

    You are writting in code behind, this gives me the impression that you state this for a solution where an engine is running a not connected User Interface (mostly in fact a Web page).

    Because it is disconnected it is mostly impossible to bind it to a more dimensional data container of any format. (Or you should do that on the client side by sending the container with that).

    If the UI is connected to the data, then the DataBinding is standard for so called simple binding controls in columns and for complex bindable controls in matrixes (DataGridView, DataGrid, ListBox, Combobox)


    Success
    Cor

    • Proposed as answer by The Thinker Friday, January 4, 2013 1:30 PM
    • Marked as answer by Mike Feng Monday, January 7, 2013 10:03 AM
    Friday, January 4, 2013 10:49 AM
  • Hi and thanks for your answer. May be you do not believe it, but I have to say that I do not know exactly what I can do with a DataGrid. Also because I have always seen it in a DataTable scenario solved with autogenerated code. And from your answer, I understand that it is more flexible then I thought. So, I am going to see that topic paying more attention.


    • Edited by speculor Friday, January 4, 2013 12:15 PM
    Friday, January 4, 2013 12:14 PM