C
C#12mo ago
FaazLaeeq

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.
No description
No description
No description
6 Replies
Insire
Insire12mo ago
so, whats the issue?
FaazLaeeq
FaazLaeeqOP12mo ago
No description
FaazLaeeq
FaazLaeeqOP12mo ago
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
Insire
Insire12mo ago
so, have you checked whats null?
FaazLaeeq
FaazLaeeqOP12mo ago
I am getting datagrid.columns.count 0 Although i am setting item source before getting column in index Is says index out of range
Insire
Insire12mo ago
then that means, that the columns have not been generated yet
Want results from more Discord servers?
Add your server