Quantcast
Channel: Windows Forms Data Controls and Databinding forum
Viewing all articles
Browse latest Browse all 2535

Bind Properties to DataGridView

$
0
0

Hi,

I have a class called "car" with - I have no ideia how to say this in english - "data members" as the following:

  1. Public pneu As classDoor
  2. Public mat As classTire
  3. Public length AsDouble

And so on. All the related classes have null constructors. I have a tab control where each tab is equivalent a one of this features. The tab "Tire" with respect to "pneu", for example, has the following properties:

  1. PublicProperty materialh AsString()
  2. Set(value AsString())
  3. mat = value
  4. EndSet
  5. Get
  6. Return mat
  7. EndGet
  8. EndProperty
  9. PublicProperty diameterh AsString()
  10. Set(value AsString())
  11. diam = value
  12. EndSet
  13. Get
  14. Return diam
  15. EndGet
  16. EndProperty

As you can realize the "data members" are arrays and I can resize them dynamically using "Redim". What I want to do is to display these properties on a DataGridView - BUT NOT THE ENTIRE OBJECT, JUST SOME PROPERTIES. Each row of the datagridview is one of these properties - again, not all - and the number of columns depends on another parameter I have. And everytime I change the values on cells I would like to change the value of the property on my object - something like a binding. I was able to do these two tasks separately (the binding and the need to input only some properties) using stuff like BindingSource, but never on the same time. Can someone help ? It seems simple, but I just can´t do it.

Att,

Ricardo S.


Viewing all articles
Browse latest Browse all 2535

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>