rad mej

rad mej

  • NA
  • 2
  • 0

Add a button dynamically from binding

Jan 30 2010 2:02 AM
hi!
I think I have a little problem with creating button in WPF ,so here is my problem.

I have a grid that contain two RowDefinition,in the first one we are binding manually button (that contain a text and an image) and for each   button   we have to add a even handler.
In the second RowDefinition we have a number of buttons that contain also a text and an image also an even handler.
If the user clicks on a button from the first RowDefinition then we have to know the ID of that button in order to filter the second RowDefinition.
Example:   if we have in our data base product and product_category
in the first RowDefinition we will put the product category ,when the user click in a one product_category(I mean the specific button) then we will add in the second RowDefinition all the product that belong in that product_category ,
one's it's done I should also know for each button in the second RowDefinition some information (that shouldn't be shown for the user like the price of that product) in order to have some calculation.
that's it
I think it's a little complicated be I will be grateful if I have some help especially I'm a beginner


Answers (1)