Reputation: 1
Hello I have a gridview which looks like:
Boundfield(string), Boundfield(decimal), button1, button2, button3, button4, button5, label
button1, 2, 3, 4, 5 and label are inside a template field.
Based on what button is pressed:
This should work out seperate sums based on each row I can imagine it to auto generate the sum for every label in the gridview which i don't want.
Is this possible and if so how could you go about doing it?
Upvotes: 0
Views: 220
Reputation: 9607
Are you sure you don't want to do these calculations upstream? You may not have permission to modify the datasource to include these calculations, but if you do, pls. consider doing them there.
Upvotes: 0
Reputation: 374
Assuming the ItemsSource is bound to some custom type(class) that represents the rows in the GridView, add another bound property with a default value for the label. When the user clicks on one of the buttons, update the label's property for that row's index in the collection of your type, done!
Upvotes: 0