Need Help with WPF .NET DataGrid
I want to programmatically decide to only show checked column in data grid then I’ll print visuals of window.
I designed whole window on click.
I have attached my observablecollection yo datagrid.
This windows prints a slip for sale.
code link:
https://github.com/Faazlaeeq/jewel_register.git
GitHub
GitHub - Faazlaeeq/jewel_register
Contribute to Faazlaeeq/jewel_register development by creating an account on GitHub.
6 Replies
so, whats the issue?
Here user will select what columns he wants to print which will display in this windows datagrid
But as I have generated this window with code not xml I managed to attach itemsource to datagrid but I can decide which columns to show and what not
This method does not work, gives a null reference error
so, have you checked whats null?
I am getting datagrid.columns.count 0
Although i am setting item source before getting column in index
Is says index out of range
then that means, that the columns have not been generated yet