Mohammad Azam
2009-Jun-17 22:32 UTC
[Ironruby-core] Converting an Object to Collection to Bind to DataGridView
Hi, I have the following code which I am using to bind an object to the Window Forms dataGridView control: def bind_customes_to_grid(customer) $gvCustomers.DataSource = customer end Now, I need to convert the customer into a collection so it can be binding to the DataGridview control. How can I do that? -- Posted via http://www.ruby-forum.com/.
Mohammad Azam
2009-Jun-17 22:34 UTC
[Ironruby-core] Converting an Object to Collection to Bind to DataGridVi
Here is one possible solution: def bind_customes_to_grid(customer) list = Array.new list[0] = customer $gvCustomers.DataSource = list end -- Posted via http://www.ruby-forum.com/.
Mohammad Azam
2009-Jun-17 22:36 UTC
[Ironruby-core] Converting an Object to Collection to Bind to DataGridVi
Here is another version: def bind_customes_to_grid(customer) $gvCustomers.DataSource = Array.new.push(customer) end -- Posted via http://www.ruby-forum.com/.
Jimmy Schementi
2009-Jun-17 22:56 UTC
[Ironruby-core] Converting an Object to Collection to Bind to DataGridVi
Did you take a look at how the example I sent you worked? http://github.com/jschementi/railsconf09/blob/master/8-ardb/app.rb ~js> -----Original Message----- > From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core- > bounces at rubyforge.org] On Behalf Of Mohammad Azam > Sent: Wednesday, June 17, 2009 3:36 PM > To: ironruby-core at rubyforge.org > Subject: Re: [Ironruby-core] Converting an Object to Collection to Bind to > DataGridVi > > Here is another version: > > def bind_customes_to_grid(customer) > > $gvCustomers.DataSource = Array.new.push(customer) > > end > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core