3
I have an application in WPF
, where there is a window with a datagrid
with multiple lines, having only records. In this window there is also a button and I need the user, when clicking the button, to appear in each line of the datagrid
one checkbox
.
After the user has finished the checklist, he will click again on the button that will call a function, traversing the lines of the datagrid
and checking which ones are checked to take action only on the checked records.
Friend focus the question on the problem you want the solution, it seems you are describing a feature you want someone to implement. If possible put the code thingy as well.
– rubStackOverflow
Hstackoverflow I’m a little new in WPF but know c#, I really needed a function to do this.
– jp_almeida
I tried this but it didn’t work:private void btnExcluir_Click(Object Sender, Routedeventargs and) { for (var i = 0; i < dgPedidos.Items.Count; i++) { Checkbox ck = new Checkbox(); dgPedidos.Items.Add(ck); } }
– jp_almeida
Gives this error: Operation is not Valid while Itemssource is in use. Access and Modify Elements with Itemscontrol.Itemssource Instead.
– jp_almeida
@jp_almeida Vê this. Then you have to adapt to your case: You need to add Datagridcheckboxcolumn to Columns and not Checkbox to Items as in one of your comments.
– Carlos Martins