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
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.
Vanya Pavlova
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
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
I have prepared small example which illustrates this approach.
Please take a look at the attachment and let me know how it goes.
Vanya Pavlova
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
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
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?
Vanya Pavlova
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>