16,022,737 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Visual Basic questions
View Javascript questions
View .NET questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by hardover (Top 20 by date)
hardover
15-Mar-24 19:15pm
View
Don't understand your view of my tone. If you are referring to "not the place for arguments" I was prefacing my statement with that to show that I didn't want it to seem argumentative.
Otherwise, what tone? Apologies if you were offended by something.
hardover
14-Mar-24 18:02pm
View
Not the place for arguments, but it is in fact bound and I have tested before and after list selection to confirm it.
Again thanks for your interest and energy. I am going this way.
hardover
13-Mar-24 15:42pm
View
I realize that something like a realtime count will not stay current. I don't need to see anything like that in the interface. What I am concerned with is the integrity of the SelectedTags List<>. I am managing that through the routines:
OnSelectionChanged (of the internal collection)
AddSelections
RemoveSelections
hardover
12-Mar-24 19:53pm
View
I'll take a look. Thanks
hardover
12-Mar-24 19:09pm
View
Appreciate your concern, but I said somewhere in here that I am managing the changes to the visible list back into the "selected" List. I have tested this and it works nicely. You might say this is unnecessary work due to not using an ObservableCollection, but the Tag does not have the needed Selected Property for the multiselect list and the Tag can't be changed.
hardover
12-Mar-24 17:57pm
View
I understand that the binding is triggered when the list is assigned to the property; and that any subsequent changes will not be noticed. In this particular case, however, I am only using the List<> internally in the control. I AM using an ObservableCollection<> for the presentation and updating of the interface.
After going through ComboBox example, I see that you have assumed I needed to be educated on the use of ObservableCollection/INotifyPropertyChanged/…; I do understand these things. While I appreciate your time to offer this information, it is not related to the question I have raised here.
I have solved the problem. See solution posted.
hardover
7-Mar-24 16:21pm
View
Thank you for looking at my issue. I will certainly study what you have presented here as soon as I can; most likely over the weekend. Your note at the beginning, however, must mean more that it seems. My sample solution proves that List<> binds to a dependency property without issue when the control is used stand-alone. Would you expound on your point there for me when you can? Thank you.
hardover
4-Mar-24 16:40pm
View
Gerry, I think I see why you might think I don't have properties. Maybe I should have shown a lot more code here even while being encouraged to minimize it. My bad.
If you are still inclined to help, please take a look at my github repo to see all of the code for the solution.
hardover
2-Mar-24 18:53pm
View
just a classification item (observable)
public int TagID
public string Name
public string Description
hardover
30-May-23 17:11pm
View
I hope what I think is not what your meant. I'll just accept the comment as an eloquent, meaning, idiomatic I was not aware of.
hardover
30-May-23 17:09pm
View
Thank you that appears to be exactly what I needed. Great help!
hardover
25-Aug-22 16:18pm
View
I implemented your update in your first response code that I had working. It works as advertised. The differences in what you are doing here and what I have are (1) the base class for the control is Label, where mine is UserControl, (2) and used the UserControl partial class structure to have XAML to work with in the UC. Yours works as I had expected mine to work. Do you think these differences contribute to my problem? There are bindings being created in mine, but the lists are empty when used in the DataGrid?
hardover
24-Aug-22 16:21pm
View
OK. Thanks for input.
hardover
23-Aug-22 15:49pm
View
@Graeme_Grant: Thank you for you effort here, but what you are doing here misses my problem. As I said
"The UC here is trivial and does nothing meaningful. But eventually I want a UC that does. It will need to take a bound List<t> and use it. That is why this demo tries to bind a List."
I have checked my bindings. I DO want to do this with a usercontrol.
"Notice that the UC works as planned when it is used on the MainWindow but does not when used in the DataGrid."
Can we just focus on why it fails in the DataGridRow?
The solution code can be found at: https://github.com/hardoverton/BindingTest
hardover
23-Aug-22 14:59pm
View
@salty06: Sorry I don't understand your point. This example is just a proof of concept for using a UC in a DataGridRowColumn. I need to understand why it works on the MainWindow and not in the DataGridTemplateColumn. Any ideas?
hardover
11-Aug-22 16:48pm
View
Tags is a collection in every row of the DataEntries collection. The tags collection is a list of selected tags from a larger domain of alltags. alltags are handled inside the usercontrol. Tags is used to set the selections for the listview of the UC
hardover
10-Aug-22 15:35pm
View
Thank you. I see all of your points. So the Tags collection does exist in the viewmodel as a collection object DataEntry in the collection DataEntries. How should I make a reference to that?
Also, the first two TextColumns are using the standard binding reference to properties of DataEntry and working fine.
In most of what I have tried, there is no binding failure noted. I do know that SelectedTags DP is not bound only when the UC is used on the DataGrid. That is why I didn't include the UC code because I felt it would be too much and distracting.
The one thing I keep thinking of is a number of mentions that a DataGridTemplateColumn does not appear in the Visual Tree. I assume this is in reference to using a relative source reference. But I don't know what to do with that info.
hardover
5-Aug-22 18:13pm
View
Dave K, what is the best way to get a description and the code so you can see it? I have a .RAR file with the VS solution and in is a doc the describes intent and results. I don't see a way to attach a file to the question.
hardover
5-Aug-22 16:37pm
View
Thank you for your response. I realize more detail is required. I will soon post a simplified example of what I am seeing. I would appreciate our input at that time.
hardover
9-Jun-22 15:26pm
View
This is a good recommendation. Thank you. It is squarely in the "should have thought of that" category.
I implemented it and it left me with only a one-line call for each event handler in the View code-behind. This allows the move to one instance of the common code which is now in the static class.
Show More