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

busyindicator on the single row

5 Answers 439 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Michele
Top achievements
Rank 2
Michele asked on 04 Jan 2012, 03:22 PM
hello Telerik,
I'm trying to define a style for a single row... I wish to have a radbusyindicator surrounding each row (i've got an even that takes some time then update a field on the current row)

what sphould I put for template as gridviewrow? should I dfine each column and how?
thanks
Paolo

5 Answers, 1 is accepted

Sort by
0
Vanya Pavlova
Telerik team
answered on 04 Jan 2012, 04:30 PM
Hello,

 


Generally you may predefine the template of GridViewRow and place a single RadBusyIndicator on the top of the row and set its Visibility Property to Collapsed. Then based on your custom logic you may find the BusyIndicator and set its Visibility property to Visible, IsBusy property to True and any relevant settings based on your particular case. 



Kind regards,
Vanya Pavlova
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Michele
Top achievements
Rank 2
answered on 04 Jan 2012, 05:45 PM
Hello Vanya ,
thanks for reply. Can you please provide me an example?

This is my code, what's wrong?
<UserControl [...]>
    <UserControl.Resources>
        <Style x:Key="t1" TargetType="telerik:GridViewRow" >
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="telerik:GridViewRow">
                        <StackPanel>
                            <telerik:RadBusyIndicator x:Name="IsRowBusy">
                                <telerik:GridViewRow Background="BlueViolet"></telerik:GridViewRow>
                            </telerik:RadBusyIndicator>
                        </StackPanel>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>      
    </UserControl.Resources>
    <telerik:RadBusyIndicator x:Name="IsBusy">
        <Grid cal:Action.TargetWithoutContext="{Binding}">
            <Grid.RowDefinitions>
                <RowDefinition Height="*"></RowDefinition>
            </Grid.RowDefinitions>
            <telerik:RadGridView Grid.Row="0" x:Name="DataItems" RowStyle="{StaticResource t1}" AutoGenerateColumns="False"
                                 CanUserInsertRows="False" CanUserDeleteRows="False">
                <telerik:RadGridView.Columns>
             [...]
               </telerik:RadGridView.Columns>
            </telerik:RadGridView>
        </Grid>
    </telerik:RadBusyIndicator>
</UserControl>



Thanks for reply
Paolo
0
Vanya Pavlova
Telerik team
answered on 04 Jan 2012, 05:48 PM
Hello,

 

I have prepared small example which illustrates this approach.
Please take a look at the attachment and let me know how it goes. 


All the best,
Vanya Pavlova
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Michele
Top achievements
Rank 2
answered on 09 Jan 2012, 12:17 PM
Hello Vanya,
I've got still some question about your implementation... I've seen you set the radbusyindicator on true with a trigger
<Trigger Property="IsInEditMode" Value="True">
                            <Setter Property="Visibility" TargetName="EditIndicator" Value="Visible"/>
                            <Setter Property="Visibility" TargetName="b1" Value="Visible"/>
                        </Trigger>

I need to set it at true on my boolean property IsRowBusy... How can I do this?

It seems to me that you always have the busy indicator set to true and you only change the visibility... in my real case I need the busyindicator to contain the whole row and to disable the actions on the row till it finished its elaboration... can you please provide me a sample?
Thanks
0
Vanya Pavlova
Telerik team
answered on 09 Jan 2012, 01:05 PM
Hi Paolo,

 

Thank you for getting back to us and for the detailed info about your requirement! You may easily achieve this result using StyleSelectors, just return the appropriate row style based on the IsRowBusy property value of your underlying businness objects. You may keep two different styles the one with the RadBusyIndicator and the default one. When the condition is met just return the appropriate style. 
Will you verify how this works for you?  



Greetings,
Vanya Pavlova
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
GridView
Asked by
Michele
Top achievements
Rank 2
Answers by
Vanya Pavlova
Telerik team
Michele
Top achievements
Rank 2
Share this question
or