Hint Assist not disappearing when Text value is set on MaterialDesignDataGridTextColumnPopupEditingStyle
See original GitHub issueI am creating dynamic columns for my DataGrid, so I am creating a number of MaterialDataGridTextColumn
in code behind. I am modifying the MaterialDesignDataGridTextColumnPopupEditingStyle
to allow the TextBox
to have a hint property:
Style style = (Style)FindResource("MaterialDesignDataGridTextColumnPopupEditingStyle");
var editingStyle = new Style(typeof(TextBox), style)
{
Setters =
{
new Setter(HintAssist.HintProperty, "Enter Score"),
new Setter(MarginProperty, new Thickness(8)),
}
};
foreach (string name in columnNames)
{
var binding = new Binding("Attributes[" + name + "].Value")
{
UpdateSourceTrigger = UpdateSourceTrigger.LostFocus,
ValidatesOnDataErrors = true,
StringFormat = "0.0;;#"
};
var mdTxtCol = new MaterialDataGridTextColumn
{
Header = name,
Binding = binding,
EditingElementStyle = editingStyle,
ElementStyle = centerTextSetter,
};
caseGrid.Columns.Add(mdTxtCol);
}
This successfully produces the pop up like so:
And as you type a value in the textbox, the hint property disappears, as it should:
However, the problem is that when this cell re-enters the edit mode while it contains a value, the hint property should disappear, but it doesn’t:
As you can see, both the entered value and the hint property are shown.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:5 (5 by maintainers)
Top Results From Across the Web
How to disappear the hint in TextInputEditText on receiving ...
Try to set focus change listener on EditText and hide hint programmatically when focus is true and show again hint if focus is...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I am experiencing this problem as well, although I am setting the Hint in XAML. It is easy to reproduce the issue with the Demo program by altering the
EditingElementStyle
of theName
column as follows:This leads to the behavior @AmitBhatnagar24 noted previously. Here is a screencast illustrating the problem:
Note that the Hint disappears when typing anything in the box. It reappears, however, when selecting the cell again.
I believe the XAML is adding setters not replacing the entire set, so I think it avoids the issue that @Keboo mentioned.
See also Gitter chat about issue