how can I set ForegroundHoverStyleProperty is nothing when mouse over the cell
the code doesn't work:
Dim foregroundHoverStyle As New Style(GetType(ContentPresenter)) foregroundHoverStyle.Setters.Add(New Setter(DataRecordCellArea.ForegroundHoverStyleProperty, Nothing)) Dim cellStyle As New Style(GetType(DataRecordCellArea)) cellStyle.Setters.Add(New Setter(DataRecordCellArea.ForegroundHoverStyleProperty, foregroundHoverStyle))
thanks!!!
Hi There,
I apologize that no one has yet answered this post. We were inundated with more posts than we had resources to cover. Since that time we have been adding people to the task of making sure every post gets a reply from an Infragistics employee.
As far as I can tell there is no way to remove the hover affect. However you can set the Foreground brush to the same color as the non-active Foreground brush in the XAML in a CellValuePresenter style. This style can be applied to individual CellValuePresenter styles for each Field or you can assign it implicitly to all Fields, as demonstrated in the following XAML example.
<Style TargetType="{x:Type igDP:CellValuePresenter}"> <!--To assign the foreground brush when the mouse enters the field.--> <Setter Property="ForegroundHoverStyle"> <Setter.Value> <Style> <Setter Property="TextBlock.Foreground" Value="{DynamicResource CellValueForegroundStyle}"/> </Style> </Setter.Value> </Setter></Style>
One thing to note is that the default Foreground brush applied to each cell is the CellValueForegroundStyle brush. This is defined in the Defaults.xaml (look in the DataPresenterHulk_Brushes.xaml file).
Let me know if you need further assistance with this.
Thanks!
Hi Curtis,
I tried the above solution, it working only for one cell... the Foreground Color changes for the rest of cell's in row. Can you please suggest with solution to completely disable ForegroundHover color change effect?
Thanks,
Shakti
If you check out one of my blog posts, you'll find an example that demonstrates how to override several brushes. You'll find that there is more than one hover brush which you can customize.http://community.infragistics.com/blogs/curtis_taylor/archive/2010/10/26/xamdatagrid-101-part-2.aspx