Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1160
How do I change the selected cell background color & get rid of cell splitters?
posted

Hi!

Enclosed is a screen shot of a xamDatagrid that I've been able to modify with the various property setters and triggers.  However I can't get the selected cell to changed color from the default (?) blue.  The grid is set for

 

SelectionTypeCell="None" SelectionTypeField="None" SelectionTypeRecord="None"

So should cells even be getting selected???  I've tried various triggers and other suggestions in this forum but the behavior and color never changes from the blue.  What's the trick?  Is there a particular theme I should be using?

Secondly I've been able to make the splitters in the grid rows disappear except for when the mouse is hovered over the row - see the second row of the grid data.  How do I make that disappear - I only want the user to be able to see/use the splitters in the headers.

Thanks!

Glenn

screenshot.zip
  • 69686
    posted

    Hello Glenn,

    Regarding the first question, you need to look at the Default Style for the CellValuePresenter in the DefaultStyles directory in the Infragistics folder on your computer. There you can find what property in the CellValuePresenter is responsible for this blue color. Using the default style as a base style, you can make your own and override it ( for example if you set theme Theme="Office2k7Black" it would be orange).

    Regarding the grid splitters, I was able to remove them by just copying the default Style for the CellValuePresenter and removing the following lines:

    <Setter Property="ForegroundActiveStyle" Value="{StaticResource BlackForegroundStyle}" />

            <Setter Property="ForegroundAlternateStyle" Value="{StaticResource DarkGrayForegroundStyle}" />

            <Setter Property="ForegroundPrimaryStyle" Value="{StaticResource DarkGrayForegroundStyle}" />

            <Setter Property="ForegroundSelectedStyle" Value="{StaticResource BlackForegroundStyle}" />

            <Setter Property="ForegroundFieldSelectedStyle" Value="{StaticResource BlackForegroundStyle}" />

    Let me know if that helps you,

    Alex.