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

[Solved] Showing Loading Panel

10 Answers 424 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Dan
Top achievements
Rank 1
Dan asked on 15 May 2009, 01:17 PM
I'm loading a grid via a wcf service which unfortunately takes a second or two to complete, and I was wondering if there was a way to invoke the grid's loading panel programmatically when the service fires and remove it when its binding is completed.

Thanks in advance,

Lars

10 Answers, 1 is accepted

Sort by
0
Dan
Top achievements
Rank 1
answered on 15 May 2009, 02:45 PM
Another quick question:  Is there a way to disable selection all together?

Thanks again
0
Milan
Telerik team
answered on 18 May 2009, 02:34 PM
Hello Lars Solberg,

Currently there is no way to manually control the loading indicator and our selection mechanism cannot be disabled.
Are any of those limitations a show-stopper for you?
I could think of only one workaround to disable our selection machanism but it will also disable features like editing. The trick is to set the IsHitTestVisible property to false.

<Grid.Resources> 
    <Style x:Key="CustomStyle" TargetType="grid:GridViewRow">  
        <Setter Property="IsHitTestVisible" Value="False"/>  
    </Style> 
</Grid.Resources> 
<telerikGrid:RadGridView x:Name="RadGridView1" RowStyle="{StaticResource CustomStyle}">  
</telerikGrid:RadGridView> 

Thanks for your valuable feedback - I have updated your telerik points.

Greetings,
Milan
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Dan
Top achievements
Rank 1
answered on 18 May 2009, 03:23 PM
Hi Milan,

Thanks for the response, I don't believe these things should be show stoppers.  I have a grid with a child table so I was looking to have only one record (between the parent/child tables) selected at a time, and I believe I've come up with a solution for that.  I do have a couple more questions about the grids though:

    1.  Is there anyway to have the columns fill the child grids? (see screen shot)
    2.  Is there anyway to remove the row indicator column in child grids (see screen shot)
    3.  How would I go about removing the child grid's header row background gradient?
    4.  Is there anyway to edit the grouping row?, I'd like to add a textbox with a description to the grouping.

My code for the child tables

Xaml:

 

<telerikGridView:RadGridView.HierarchyChildTemplate> 
                <DataTemplate> 
                    <StackPanel Background="White" Height="auto" > 
                        <telerikGridView:RadGridView Margin="10,10,10,10" CanUserFreezeColumns="False" VerticalGridlinesVisibility="Collapsed" 
                            ShowGroupPanel="False"  IsFilteringAllowed="False"  Background="White" 
                            ColumnsWidthMode="Fill" SelectionChanged="RadGridView_SelectionChanged"  Loaded="RadGridView_Loaded">  
                        </telerikGridView:RadGridView> 
                    </StackPanel> 
                </DataTemplate> 
            </telerikGridView:RadGridView.HierarchyChildTemplate> 

CS:

var relation = new TableRelation();  
            relation.FieldNames.Add(new FieldDescriptorNamePair("JobDate""JobDate"));  
            relation.FieldNames.Add(new FieldDescriptorNamePair("JobID""JobID"));  
            var definition = new GridViewTableDefinition();  
            definition.AutoGenerateFieldDescriptors = false;  
 
            var column = new GridViewDataColumn();  
            column.DataMemberBinding = new Binding("Supervisor");  
            column.HeaderText = "Supervisor";  
            definition.FieldDescriptors.Add(column);  
 
            column = new GridViewDataColumn();  
            column.DataMemberBinding = new Binding("LaborCost");  
            column.HeaderText = "Labor Cost";  
            column.DataFormatString = "{0:c}";  
            definition.FieldDescriptors.Add(column);  
 
            column = new GridViewDataColumn();  
            column.DataMemberBinding = new Binding("EquipmentCost");  
            column.HeaderText = "EQ Cost";  
            column.DataFormatString = "{0:c}";  
            definition.FieldDescriptors.Add(column);  
 
            column = new GridViewDataColumn();  
            column.DataMemberBinding = new Binding("SiteCost");  
            column.HeaderText = "Site Cost";  
            column.DataFormatString = "{0:c}";  
            definition.FieldDescriptors.Add(column);  
 
            column = new GridViewDataColumn();  
            column.DataMemberBinding = new Binding("SiteID");  
            column.HeaderText = "Site";  
            definition.FieldDescriptors.Add(column);  
 
            definition.IsReadOnly = true

Thanks for all of your help!

0
Dan
Top achievements
Rank 1
answered on 18 May 2009, 09:19 PM
I think i've come across a grouping bug.  A little background...I'm using the latest internal build (0508) and I have the december drop of silverlight's data dlls.  I have declaritively set grouping, and after the grid binds, this shows in the immediate window:

System.Windows.Data Error: BindingExpression path error: 'VerticalGridlinesVisibility' property no found on 'SPECIALTY ITEMS' 'Telerik.Windows.Data.AggregateResult' (HashCode=23150067). BindingExpression: Path='VerticalGridlinesVisibility' DataItem='SPECIALTY ITEMS' (HashCode=23150067); target element is 'Telerik.Windows.Controls.GridView.GridViewAggregateResultCell' (Name=''); target property is 'VerticalLineVisibility' (type 'System.Windows.Visibility')..

System.Windows.Data Error: BindingExpression path error: 'VerticalGridlinesBrush' property no found on 'SPECIALTY ITEMS' 'Telerik.Windows.Data.AggregateResult' (HashCode=23150067). BindingExpression: Path='VerticalGridlinesBrush' DataItem='SPECIALTY ITEMS' (HashCode=23150067); target element is 'Telerik.Windows.Controls.GridView.GridViewAggregateResultCell' (Name=''); target property is 'VerticalLineFill' (type 'System.Windows.Media.Brush')..

System.Windows.Data Error: BindingExpression path error: 'VerticalGridlinesThickness' property no found on 'SPECIALTY ITEMS' 'Telerik.Windows.Data.AggregateResult' (HashCode=23150067). BindingExpression: Path='VerticalGridlinesThickness' DataItem='SPECIALTY ITEMS' (HashCode=23150067); target element is 'Telerik.Windows.Controls.GridView.GridViewAggregateResultCell' (Name=''); target property is 'VerticalLineThickness' (type 'System.Double')..

If there are too many levels of grouping it will just exit the application.  Any help would be greatly appreciated, this is much more important than the other questions I've had as I have a presentation to give this week.

Thanks again for all of your help.

0
Dan
Top achievements
Rank 1
answered on 20 May 2009, 04:02 PM
The grouping bug seems to occur when any field in a column that is being aggregated is null, I hope this helps.

Lars
0
Milan
Telerik team
answered on 21 May 2009, 04:51 PM
Hello Lars Solberg,

You have correctly set the ColumnsWidthMode property to Fill. Unfortunately there is a know inssue with that mode when hierachy is involved. There is a possible workaround, though - if you set a concrete width of your child grid your columns should fill all of the available space.

You can use the RadGridView.RowIndicatorVisibility property to control the visibility of the indicator . If you set it to Collapsed the indicator will not be displayed.

The gradient that you see on our header row is also applied to every header cell. In order to remove it you have to change the background of every header row and every header cell. Our columns have a propetry called HeaderCellStyle that can be use to change the appearance of the header cells but since you are using autogenerated columns in you should do that in code-behind.
First you should hook up to the RadGridView.RowLoaded event and in the event handler do something like that:

private void RadGridView_RowLoaded(object sender, RowLoadedEventArgs e)  
{  
    GridViewHeaderRow row = e.Row as GridViewHeaderRow;  
 
    if(row == null)  
        return;  
 
    row.Background = new SolidColorBrush(Colors.Transparent);  
 
    foreach (var cell in row.Cells)  
    {  
        cell.Background = new SolidColorBrush(Colors.Transparent);  
    }  

GridViewDataControl and RadGridView expose a property called GroupRowStyle that allows you to customize the look of our group rows. I have attached a sample project that demonstrated how you can change the looks of the group row.

We are currently looking into the binding errors that you have reported and we will update you on the matter as soon as posible.

All the best,
Milan
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Ronald
Top achievements
Rank 1
answered on 05 Jun 2009, 03:31 PM
Hello Milan,

Is there an ETA to fix the issue with the ColumnsWidthMode property?  We're running into the same problem that Lars mentions in his "item 1".

Thanks,
Ron
0
Milan
Telerik team
answered on 10 Jun 2009, 12:07 PM
Hi Ronald,

We aim to fix this problem for Q2 SP1. Is it possible to use the fixed size workaround that I have mentioned in my last post? Is the workaround applicable to your scneraio?

Sincerely yours,
Milan
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Ronald
Top achievements
Rank 1
answered on 10 Jun 2009, 12:44 PM
I'm actually not inserting a child grid.  My RadGridView is nested pretty deep...and the columns don't fill the grid.  The workaround you mentioned doesn't work in my situation.
0
Milan
Telerik team
answered on 11 Jun 2009, 08:03 AM
Hi Ronald,

Well, if the RadGridView is in a panel that provides an infinite width to the grid, there is no way to determine the right column sizes that will fill the grid. Still, there might be a workaround that you can use.

<Grid x:Name="LayoutRoot" Background="White">    
    <Grid.RowDefinitions>   
        <RowDefinition Height="Auto"/>    
    </Grid.RowDefinitions>   
    <Grid.ColumnDefinitions>   
        <ColumnDefinition Width="Auto"/>    
    </Grid.ColumnDefinitions>   
    <StackPanel Grid.Row="0" Grid.Column="0" SizeChanged="StackPanel_SizeChanged" >   
        <telerikGrid:RadGridView x:Name="RadGridView1" ColumnsWidthMode="Fill">    
        </telerikGrid:RadGridView>   
    </StackPanel>   
</Grid> 

In this situation the fill mode will not work correctly. If you subscribe to the SizeChanged event of the parent StackPanel you will be able to determine the concrete size of the parent. You can use this size to limit the size of the grid:

private void StackPanel_SizeChanged(object sender, SizeChangedEventArgs e)    
{    
    FrameworkElement element = (FrameworkElement)VisualTreeHelper.GetChild((DependencyObject)sender, 0);    
   
    element.Width = e.NewSize.Width;    
    element.Height = e.NewSize.Height;    

Hope this works for your scenario.

Greetings,
Milan
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
GridView
Asked by
Dan
Top achievements
Rank 1
Answers by
Dan
Top achievements
Rank 1
Milan
Telerik team
Ronald
Top achievements
Rank 1
Share this question
or