This is a migrated thread and some comments may be shown as answers.

flash or blinking row

12 Answers 1185 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Rocio
Top achievements
Rank 1
Rocio asked on 20 Sep 2012, 07:26 AM
Hello, I am newbie with telerik controls, and I am doing a app with a GridView, I would like to make some rows blink or flash, but I can't find anything about it, Is there an easy way?
Hope somebody can help me.
Thanks!

12 Answers, 1 is accepted

Sort by
0
Pavel Pavlov
Telerik team
answered on 20 Sep 2012, 07:37 AM
Hi Rocio,

I guess you need to make the row blink based on a certain value within .

In general the recommended approach would be to set a style for the row using a RowStyleSelector.
Within the style targeting GridViewRow I believe you may set an animation to toggle the background color thus the blinking effect.

Regards,
Pavel Pavlov
the Telerik team

Time to cast your vote for Telerik! Tell DevPro Connections and Windows IT Pro why Telerik is your choice. Telerik is nominated in a total of 25 categories.

0
Rocio
Top achievements
Rank 1
answered on 20 Sep 2012, 07:52 AM
Hello Pavel, thanks for you quick response, I used the RowStyleSelector for my background color, but when I applied it the scroll or the "next Page" navigation didn't work, so I decided to change the background color on the RowLoaded event with:
e.Row.Background = new SolidColorBrush(Colors.Blue);

I was thinking in something like that for the blinking, but I can try your recomendation, could you be more specific? because I haven't worked with style selectors, and any little example would be great
Thanks a lot!
0
Pavel Pavlov
Telerik team
answered on 20 Sep 2012, 08:53 AM
Hi,

When you apply the following style to a row, it will  start blinking:
<Style TargetType="telerik:GridViewRow" >
          <Style.Setters>
              <Setter Property="Background" Value="Red" />
          </Style.Setters>
          <Style.Triggers>
              <Trigger Property="Visibility" Value="Visible">
                  <Trigger.EnterActions>
                      <BeginStoryboard>
                          <Storyboard >
                              <ColorAnimation Storyboard.TargetProperty="Background.Color"
                                              Duration="0:0:0.2"  From="White" To="Red" RepeatBehavior="Forever" AutoReverse="True"/>
                          </Storyboard>
                      </BeginStoryboard>
                  </Trigger.EnterActions>
              </Trigger>
          </Style.Triggers>
      </Style>


Kind regards,
Pavel Pavlov
the Telerik team

Time to cast your vote for Telerik! Tell DevPro Connections and Windows IT Pro why Telerik is your choice. Telerik is nominated in a total of 25 categories.

0
Rocio
Top achievements
Rank 1
answered on 20 Sep 2012, 09:41 AM
Hello Pavel, thanks for your response, I have consulted telerik examples about how to add this style to my grid, and I am a bit confused, I have to create a <Grid.Resources> section, and put  the style in there:

<Grid.Resources>
<Style Key="BlinkStyle" TargetType="telerik:GridViewRow" >
          <Style.Setters>
              <Setter Property="Background" Value="Red" />
          </Style.Setters>
          <Style.Triggers>
              <Trigger Property="Visibility" Value="Visible">
                  <Trigger.EnterActions>
                      <BeginStoryboard>
                          <Storyboard >
                              <ColorAnimation Storyboard.TargetProperty="Background.Color"
                                              Duration="0:0:0.2"  From="White" To="Red" RepeatBehavior="Forever" AutoReverse="True"/>
                          </Storyboard>
                      </BeginStoryboard>
                  </Trigger.EnterActions>
              </Trigger>
          </Style.Triggers>
      </Style>
</Grid.Resources>

But I am not sure about how to apply it to some columns, the examples uses Conditional style selectors, in my case I only need one rule, because I only have one style to apply, but I don't know what the first line refers to, and in my case what to use as ConditionConverter, and how to "say" to it wich rows have to be blinking

<Examples:UnitPriceConveter x:Key="converter" />
          <Examples:ConditionalStyleSelector x:Key="selector" ConditionConverter="{StaticResource converter}">
                <Examples:ConditionalStyleSelector.Rules>
                    <Examples:ConditionalStyleRule Style="{StaticResource BlinkStyle}">
                        <Examples:ConditionalStyleRule.Value>
                            <sys:Boolean>True</sys:Boolean>
                        </Examples:ConditionalStyleRule.Value>
                    </Examples:ConditionalStyleRule>                   
                </Examples:ConditionalStyleSelector.Rules>
            </Examples:ConditionalStyleSelector>

Thanks again
0
Pavel Pavlov
Telerik team
answered on 20 Sep 2012, 10:46 AM
Hi,

You said you need the row blinking, but then you need it just for some columns. Do you need just a cell blinking ?

Also what is the condition that relates to the cell /row blinking ?  Once we clear these , I will gather a small runnable project for you .

Greetings,
Pavel Pavlov
the Telerik team

Time to cast your vote for Telerik! Tell DevPro Connections and Windows IT Pro why Telerik is your choice. Telerik is nominated in a total of 25 categories.

0
Rocio
Top achievements
Rank 1
answered on 20 Sep 2012, 10:53 AM
Hello Pavel, I think I haven't explained myself properly, I'm sorry.
I have a grid with some columns, and depending on the value of the first column is how I decide if the entire row should blink or not.

I have read your example of Style Selectors, and I get that I have to create a class that inherits from StyleSelector, is it right? and in that class I have to override the SelectStyle method, depending on the item I have to return an style or the other, but I don't know how to create the style with the trigger and the animation programmatically like with the background color.
Thanks!
0
Accepted
Pavel Pavlov
Telerik team
answered on 25 Sep 2012, 11:54 AM
Hi,

I am attaching a small example where the row will blink for all items with price < 100.

Hope this helps.

All the best,
Pavel Pavlov
the Telerik team

Time to cast your vote for Telerik! Tell DevPro Connections and Windows IT Pro why Telerik is your choice. Telerik is nominated in a total of 25 categories.

0
Rocio
Top achievements
Rank 1
answered on 04 Oct 2012, 07:13 AM
Hello Pavel, and thanks for your response, I finally proved it and it totally worked for me.
Thanks again!
0
INS software
Top achievements
Rank 1
answered on 25 Aug 2015, 01:57 AM

Good Answer.

Good job~.

0
INS software
Top achievements
Rank 1
answered on 06 Sep 2015, 08:32 PM

Good answer and sample~.

I have a question. How can I change color in From/To of stroryboard of your sample?

0
Maya
Telerik team
answered on 07 Sep 2015, 12:35 PM
Hello,

Do you want to change them runtime based on some condition or just change the value of white/red ? 

Regards,
Maya
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
KAPIL
Top achievements
Rank 1
answered on 11 Oct 2017, 04:30 AM

I need same behaviour in simple dataGrid ..as you explained using telerik control..

thanks,

Kapil

Mob - 9891882171

Tags
GridView
Asked by
Rocio
Top achievements
Rank 1
Answers by
Pavel Pavlov
Telerik team
Rocio
Top achievements
Rank 1
INS software
Top achievements
Rank 1
Maya
Telerik team
KAPIL
Top achievements
Rank 1
Share this question
or