Binding Row object to collection

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • emilyjackson
    New Member
    • May 2016
    • 2

    Binding Row object to collection

    I use DAPFOR WPF Grid control can someone tell me how I can bind row object to collection.
  • marrylugard
    New Member
    • May 2016
    • 2

    #2
    I use Dapfor Wpf gridcontrol and it is simplified for users. Base on your question try using this code and it would help.


    C#
    Code:
    private void OnGridControlLoaded(object sender, EventArgs e) 
    { 
        Row row1 = grid.Rows.Add(new object[] { 200, null, "item 1" });
        Row row2 = grid.Rows.Add(new MyCustomClass(33, 33.33, "item 2"));
    
        //Create a collection of custom objects 
        BindingList<MyCustomClass> collection = new BindingList<MyCustomClass>();
        collection.Add(new MyCustomClass(11, 11.11, "subitem 1"));
        collection.Add(new MyCustomClass(22, 22.22, "subitem 2"));
    
        //Bind row1 to the collection 
        row1.ItemsSource = collection; 
    }
    Last edited by Rabbit; May 4 '16, 03:59 PM. Reason: Please use [code] and [/code] tags when posting code or formatted data.

    Comment

    Working...