Home Forums WPF controls Xceed DataGrid for WPF Cell Blink Support

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #23992 |

    We are trying to evaluate WPF grid control for our XMAL based system
    implementation. I am trying to achieve a grid cell blink (change background
    color of the cell momentarily and then turn it back to the original color).I read that your grid has cell blink functionality (I am not sure whether this is true for WPF grid).

    Can you please help me with this? If you can provide me a code sample then
    that will be great! .We want to implement a real time grid with frequent
    update to the cell data. So I am curious about how well the grid can
    withstand to frequent refresh scenario.

    Many Thanks in Advance
    Toshendra

    Imported from legacy forums. Posted by Toshendra (had 663 views)

    Xceed Support
    Member
    Post count: 5658

    There is no Built-In Blinking support in the WPF data grid… However, it should be pretty easy to create your own custom blinking by using Triggers on a custom Cell style…

    Imported from legacy forums. Posted by Marcus [Xceed] (had 258 views)

    User (Old forums)
    Member
    Post count: 23064

    Can I create a template and assign it to column? I want to change the background color of cell when data changes happens. I want to do this from code behind not from xmal.If possible can you please send me the sample code?
    Many Thanks in Advance
    Toshendra

    Imported from legacy forums. Posted by Toshendra (had 273 views)

    User (Old forums)
    Member
    Post count: 23064

    I am not sure how to change the background color to s new color, AND BACK, but I do something similar. In the code below, the object that is mapped onto the row has a property “PreviousTickDirection” and if that string is “RED” and if the datacell in question is the “PreviousPriceString” field (that is this cell is in the column titled “PreviousPriceString”), then the background will be set to red, and the foreground to white.

    <Style TargetType=”{x:Type xcdg:DataCell}”>
    <Style.Triggers>
    <MultiDataTrigger>
    <MultiDataTrigger.Conditions>
    <Condition Binding=”{Binding Path=PreviousTickDirection}” Value=”RED” />
    <Condition Binding=”{Binding RelativeSource={RelativeSource Self}, Path=FieldName}” Value=”PreviousPriceString” />
    </MultiDataTrigger.Conditions>
    <Setter Property=”Background”>
    <Setter.Value>
    <SolidColorBrush Color=”#993333″/>
    </Setter.Value>
    </Setter>
    <Setter Property=”Foreground”>
    <Setter.Value>
    <SolidColorBrush Color=”#ffffff”/>
    </Setter.Value>
    </Setter>
    </MultiDataTrigger>

    </Style.Triggers>
    </Style>

    Imported from legacy forums. Posted by Michael (had 405 views)

    User (Old forums)
    Member
    Post count: 23064

    Take a look at animations also.

    Here’s a simple example in code on the TextChanged event of a TextBox that will blink for 3 seconds from AliceBlue to Red when the text changes, and then stay Red:

    <code>
    private ColorAnimation m_colorAnimation;
    private SolidColorBrush m_brush;
    void XceedDataGridNavigator_Loaded(object sender, RoutedEventArgs e)
    {
    m_brush = new SolidColorBrush();
    m_brush.Color = Colors.AliceBlue;
    m_colorAnimation = new ColorAnimation(Colors.AliceBlue, Colors.Red, new Duration(TimeSpan.FromSeconds(0.25)));
    m_colorAnimation.RepeatBehavior = new RepeatBehavior(12.0);
    m_textBox_currentPosition.Background = m_brush;
    m_textBox_currentPosition.TextChanged += new TextChangedEventHandler(TextBox_CurrentPosition_TextChanged);
    }

    void TextBox_CurrentPosition_TextChanged(object sender, TextChangedEventArgs e)
    {
    m_brush.BeginAnimation(SolidColorBrush.ColorProperty, m_colorAnimation);
    }
    </code>

    Imported from legacy forums. Posted by Richard (had 355 views)

    User (Old forums)
    Member
    Post count: 23064

    Can you please be more specific about
    m_textBox and XceedDataGridNavigator_Loaded event
    Many Thanks
    Toshendra

    Imported from legacy forums. Posted by Toshendra (had 271 views)

    Xceed Support
    Member
    Post count: 5658

    I’ve just posted a blog entry giving an example of one way of doing this, hope it helps: <a href=”http://sweav3r.wordpress.com/2007/09/15/blinking-wpf-datagrid-cells/”>Blinking WPF DataGrid Cells</a>

    Imported from legacy forums. Posted by Simon (had 5820 views)

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.