Silverlight 3 – RIA Services

I started playing with the beta bits of the RIA Services and started to create a simple app, where list of customers will be displayed in a DataGrid  and a page size of 10 and will be edited using DataForm.

This is the XAML I had

<UserControl xmlns:dataControls=”clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data.DataForm”  xmlns:data=”clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data”  x:Class=”SilverlightApplication10.MainPage”
    Width=”800″ Height=”600″>
    <Grid Margin=”10″ x:Name=”LayoutRoot” Background=”White”>
        <riaControls:DomainDataSource x:Name=”source” LoadSize=”100″   LoadMethodName=”LoadCustomers” AutoLoad=”True”>
                <domain:NorthwindContext />
             <dataControls:DataPager PageSize=”10″   Source=”{Binding Data, ElementName=source}” />
        <data:DataGrid x:Name=”datagrid1″ ItemsSource=”{Binding Data, ElementName=source}” IsReadOnly=”True” AutoGenerateColumns=”False” >
                <data:DataGridTextColumn Header=”Customer ID” Binding=”{Binding CustomerID}”/>
                <data:DataGridTextColumn  Header=”Contact Name” Binding=”{Binding ContactName}”/>
                <data:DataGridTextColumn  Header=”Contact Title” Binding=”{Binding ContactTitle}”/>
            <!–<dataControls:DataForm WrapAfter=”4″ AutoEdit=”True”     Header=”Customer Details”  CurrentItem=”{Binding ElementName=datagrid1, Path=SelectedItem}” Grid.Row=”1″></dataControls:DataForm>–>


everything  looks good,  clicked the button in the pager to go to the lastpage, there are only 91 records, so not sure if the pager is displaying loadsize/pagesize as number of pages, but I get this. cannot go to the first page. looks like it knows there are is no data in Page 10, and but the UI is not reflecting that.  if we click the next button in the pager we go to 2nd page


When the loadsize is specified to something less than 91 (say 30), I can see data for 3 pages but when I navigate to 4th page, I dont  get data

I uncommented the DataForm and ran the sample


I noticed the following

1. Pager functionality not there

2. AutoEdit  on the DataForm is set to true, so it goes into edit mode and displays Save and Cancel buttons. Cancel is grayed out and it shows there are some pending changes. if we select another Item in the datagrid everything is good.

3. If I remove the AutoEdit  on DataForm  pager seems to work, but when I go to next page, Datagrid doesnt select the first item by default so the DataForm is empty


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s