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

[Solved] DataBinding inside the Grid

3 Answers 128 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.
Parameswari
Top achievements
Rank 2
Parameswari asked on 19 Aug 2011, 08:19 AM
Hi,
  My  issue is ,at Runtime the design part of the grid appears first without data,  it takes about 5-6 seconds to display data inside the grid . Is there  any other option to view both the Grid design  and data at sametime ? And Progress  bar should be viewed until it displays design (with data)
Thanks,
Parameswari

3 Answers, 1 is accepted

Sort by
0
Vanya Pavlova
Telerik team
answered on 19 Aug 2011, 08:48 AM
Hello Parameswari,

 

In general if  RadGridView loads the data with a delay you may set the RadGridView's IsBusy property to true. Then the default GridViewLoadingindicator would appear. When you load the data the BusyIndicator will not be shown if you set this property to False. However I am not quire how this is applicable in your scenario. May you please share with us how the grid is bound to in your case? For the time being I may suggest you to take a look at the following online demo of our RadDomainDataSource control.


Greetings,
Vanya Pavlova
the Telerik team

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

0
Parameswari
Top achievements
Rank 2
answered on 19 Aug 2011, 10:49 AM
Hi Vanya,
     I have sent my Entire xaml for your reference.The Client should view the design And data at same time, Give me some suggestion regarding this issue.  We are using Usercontrol Resources, Is this will slowdown the grid performance?

Thanks
Parameswari
<UserControl x:Class="BusinessAccounting.View.Invoice.InvoiceListing"
    mc:Ignorable="d"
    d:DesignHeight="300" d:DesignWidth="499"
             xmlns:telerik="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls"
              xmlns:telerikschema="http://schemas.telerik.com/2008/xaml/presentation"
             xmlns:telerikQuickStart="clr-namespace:Telerik.Windows.Controls.QuickStart;assembly=Telerik.Windows.Controls"
             xmlns:telerikGridView="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.GridView"
             xmlns:RadDataPager="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Data"
              xmlns:telerikDocking="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Docking"
             xmlns:GridViewFooter="clr-namespace:Telerik.Windows.Controls.GridView;assembly=Telerik.Windows.Controls.GridView"
             xmlns:teleric="http://schemas.telerik.com/2008/xaml/presentation"
             xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
             xmlns:Converter="clr-namespace:BusinessAccounting.Helpers.Converters"
             xmlns:Icons="clr-namespace:BusinessAccounting.ViewModel.Common" >
  
  
    <UserControl.Resources>
        <Icons:IconViewModel x:Key="iconviewmodel"/>
        <Converter:BusinessPhone x:Key="businessphone"/>
        <Converter:PhoneFormat x:Key="phoneformat"/>
  
        <Style TargetType="GridViewFooter:GridViewFooterCell">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate>
                        <Border BorderBrush="LightGray" BorderThickness="0,0,1,0" >
                            <!--<Image VerticalAlignment="Stretch" Stretch="None" HorizontalAlignment="Stretch" Source="./Images/emptygridline.png" />-->
                        </Border>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
            <Setter Property="Background" Value="Transparent"/>
        </Style>
        <Style TargetType="GridViewFooter:GridViewFooterRow">
            <Setter Property="MinHeight" Value="1"/>
            <Setter Property="Background" Value="Transparent"/>
            <Setter Property="BorderThickness" Value="0,0,0,0"/>
        </Style>
    </UserControl.Resources>
  
    <Grid>
           <Grid.RowDefinitions>
            <RowDefinition Height="25"/>
            <RowDefinition Height="*"/>           
            </Grid.RowDefinitions>
  
            <HyperlinkButton x:Name="Hyp_AddNewInvoice" Grid.Row="0" Content="Add a new Invoice" Foreground="#FF154A93" Margin="10,5,0,5" Width="120"  HorizontalAlignment="Left" Command="{Binding NewInvoiceCommand}"/>
            <telerik:RadBusyIndicator x:Name="BusyIndicator" Grid.Row="1" BusyContent="Loading data..." DisplayAfter="0" AllowDrop="True" IsIndeterminate="True" Background="Transparent" BorderBrush="Transparent" BorderThickness="0">
            <telerikGridView:RadGridView x:Name="dtgInvoiceList" Margin="0" RowHeight="19" Grid.Row="1" 
                                         BorderThickness="0,1,0,0" IsReadOnly="True" 
                                         AutoGenerateColumns="False" VerticalAlignment="Top"  
                                         HorizontalAlignment="Stretch" IsFilteringAllowed="False" 
                                         ShowColumnHeaders="True"  ShowGroupPanel="False" 
                                         CanUserSelect="True" CanUserSortColumns="True" 
                                         CanUserFreezeColumns="False" IsEnabled="True" 
                                         CanUserResizeColumns="True" RowIndicatorVisibility="Collapsed"
                                         ItemsSource="{Binding Path=SalesHeaderforInvoice, Mode=TwoWay}"                                         
                                         SelectedItem="{Binding Path=SelectedInvoice, Mode=TwoWay}"    
                                         ScrollMode="RealTime"
                                         ScrollViewer.HorizontalScrollBarVisibility="Auto" ScrollViewer.VerticalScrollBarVisibility="Auto">
                <i:Interaction.Triggers>
                    <i:EventTrigger EventName="RowActivated">
                        <i:InvokeCommandAction Command="{Binding EditCommand}" />
                    </i:EventTrigger>
                </i:Interaction.Triggers>
  
                <telerikGridView:RadGridView.Columns >
                    <telerikGridView:GridViewDataColumn Header="Type" Width="75" DataMemberBinding="{Binding TransactionName}"/>
                    <telerikGridView:GridViewDataColumn Header="Date" Width="74" DataMemberBinding="{Binding TransactionDateTime}" DataFormatString = "{}{0:MM/dd/yyyy}" />
                    <telerikGridView:GridViewDataColumn Header="No." Width="30" DataMemberBinding="{Binding SalesHeaderID}" SortingState="Descending"/>
                    <telerikGridView:GridViewDataColumn Header="Customer Name" Width="2*" DataMemberBinding="{Binding Customer.CustomerName}"/>
                    <telerikGridView:GridViewDataColumn Header="Due Date" Width="74" DataMemberBinding="{Binding DueDate}" DataFormatString = "{}{0:MM/dd/yyyy}"/>
                    <telerikGridView:GridViewDataColumn Header="Total Price" Width="1*" DataMemberBinding="{Binding TotalAmount}" TextAlignment="Right" DataFormatString = "{}{0:c2}" />
                    <telerikGridView:GridViewDataColumn Header="Balance" Width="1*" DataMemberBinding="{Binding Balance}" TextAlignment="Right" DataFormatString = "{}{0:c2}"/>
                    <telerikGridView:GridViewDataColumn Header="Currency" Width="1*" DataMemberBinding="{Binding Currency.CurrencyDescription}"/>
                    <telerikGridView:GridViewDataColumn Header="Total Price(USD)" Width="1*" DataMemberBinding="{Binding TotalAmountCurrency}" TextAlignment="Right" DataFormatString = "{}{0:c2}"/>
                    <telerikGridView:GridViewDataColumn Header="Phone" Width="1*" DataMemberBinding="{Binding Phone.PhoneNumber, Converter={StaticResource phoneformat}}"/>
                </telerikGridView:RadGridView.Columns>
            </telerikGridView:RadGridView>
        </telerik:RadBusyIndicator>               
    </Grid>
</UserControl>
0
Vanya Pavlova
Telerik team
answered on 19 Aug 2011, 11:40 AM
Hi Parameswari,

 
When you have questions related to the performance of RadGridView the xaml snippet is not ehough to determine what might be causing such a behavior. It is essential for us to know  how this control is bound to and the code-behind would help is to determine might be causing such delay etc. It would be much more appropriate to submit new support ticket and attach your application there. 


We will take a look at it and we will do our best to provide you with an appropriate solution.


Greetings,
Vanya Pavlova
the Telerik team

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

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