Coder Social home page Coder Social logo

datagrid's People

Contributors

ericsink avatar jeremysheeley avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

datagrid's Issues

Problem with ObservableCollection<T>

A user has found a problem using ObservableCollection as the row source for a DataGrid when the type parameter is a subclass of object rather than object itself. The symptom is that no rows get displayed.

Cause of this problem has not yet been isolated. We have previously found similar problems, but the symptoms were different.

The workaround is to set your Rows to a collection of type ObservableCollection.

Here's a replacement for OnAppearing in XamlTest.xaml.cs

protected override void OnAppearing()
        {
             base.OnAppearing();
             Zumero.DataGrid dg = datagrid;
             ObservableCollection<WordPair> oc_wordpairs = new ObservableCollection<WordPair>();
             ObservableCollection<object> oc_objects= new ObservableCollection<object>();
             IList<object> wp_objects = testData.createLotsOfWordPairsWithButtons(dg);
            foreach (object o in wp_objects)
            {
                oc_wordpairs.Add((WordPair)o);
                oc_objects.Add(o);
            }

            //This does not work.
            dg.Rows = (IList<object>)oc_wordpairs;

            //This works.
            //dg.Rows = (IList<object>)oc_objects;

            //This works
            //dg.Rows = wp_objects;
        }

Cell clipping problem when scrolling

Found a problem wherein scrolling, apparently when other controls are present, is "overwriting" the other controls because the cells are not being clipped properly.

The rowheight should be larger than the header height to see this problem easily. Here's the code for XamlTest.xaml that reproduces the problem. Uncomment the Grid stuff to see it flow out in the horizontal direction as well. Originally seen on Android.

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
                       xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:d="clr-namespace:Zumero;assembly=Zumero.DataGrid"
             xmlns:a="clr-namespace:demo;assembly=demo"
                       x:Class="demo.xaml.XamlTest">
     <StackLayout>
    <!--<Button x:Name="btnClickMe" Text="Click Me" />
    <Button x:Name="btnAlsoClickMe" Text="Also click me" />
         <Grid VerticalOptions = "FillAndExpand">
             <Grid.ColumnDefinitions>
                 <ColumnDefinition Width="*" />
                 <ColumnDefinition Width="3*" />
             </Grid.ColumnDefinitions>-->
             <Label Grid.Column="0" Text="No cells should be drawn over this label while scrolling" BackgroundColor="Blue" TextColor="Black" XAlign="Center" YAlign="Center"></Label>
             <d:DataGrid Grid.Column="1" x:Name="datagrid" SelectionMode="Row" BackgroundColor="Pink" ColumnSpacing="2" RowSpacing="2" RowHeight="100" HeaderHeight="50" VerticalOptions = "FillAndExpand">

                 <d:DataGrid.FrozenColumn>
                     <d:Column Width="80">
                         <d:Column.HeaderView>
                             <Label Text="Corner" BackgroundColor="Yellow"></Label>
                         </d:Column.HeaderView>
                         <d:Column.Template>
                             <DataTemplate>
                                 <Label Text="{Binding Spanish}" BackgroundColor="Gray" TextColor="Black" XAlign="Center" YAlign="Center"></Label>
                             </DataTemplate>
                         </d:Column.Template>
                     </d:Column>
                 </d:DataGrid.FrozenColumn>

                 <d:DataGrid.Columns>

                     <d:Column Width="100">
                         <d:Column.HeaderView>
                             <Label Text="English" BackgroundColor="Gray" TextColor="Black" XAlign="Center" YAlign="Center"></Label>
                         </d:Column.HeaderView>
                         <d:Column.Template>
                             <DataTemplate>
                                 <Label Text="{Binding English}" BackgroundColor="White" TextColor="Black" XAlign="Center" YAlign="Center"></Label>
                             </DataTemplate>
                         </d:Column.Template>
                     </d:Column>

                     <d:Column Width="100">
                         <d:Column.HeaderView>
                             <Label Text="Spanish" BackgroundColor="Gray" TextColor="Black" XAlign="Center" YAlign="Center"></Label>
                         </d:Column.HeaderView>
                         <d:Column.Template>
                             <DataTemplate>
                                 <Label Text="{Binding Spanish}" BackgroundColor="{Binding SpanishBackgroundColor}" TextColor="Black" XAlign="Center" YAlign="Center"></Label>
                             </DataTemplate>
                         </d:Column.Template>
                     </d:Column>

                     <d:Column Width="100">
                         <d:Column.HeaderView>
                             <Label Text="Pic" BackgroundColor="Gray" TextColor="Black" XAlign="Center" YAlign="Center"></Label>
                         </d:Column.HeaderView>
                         <d:Column.Template>
                             <DataTemplate>
                                 <Image Source="{Binding ImageName}"/>
                             </DataTemplate>
                         </d:Column.Template>
                     </d:Column>

                     <d:Column Width="200">
                         <d:Column.HeaderView>
                             <Label Text="Button" BackgroundColor="Gray" TextColor="Black" XAlign="Center" YAlign="Center"></Label>
                         </d:Column.HeaderView>
                         <d:Column.Template>
                             <DataTemplate>
                                 <a:myButton BackgroundColor="Green" TextColor="White" Font="Bold,18" Text="{Binding ButtonText}" OneAction="{Binding Action}"/>
                             </DataTemplate>
                         </d:Column.Template>
                     </d:Column>

                     <d:Column Width="100">
                         <d:Column.HeaderView>
                             <Label Text="X" BackgroundColor="Gray" TextColor="Black" XAlign="Center" YAlign="Center"></Label>
                         </d:Column.HeaderView>
                         <d:Column.Template>
                             <DataTemplate>
                                 <Entry Text="{Binding X}"></Entry>
                             </DataTemplate>
                         </d:Column.Template>
                     </d:Column>

                     <d:Column Width="100">
                         <d:Column.HeaderView>
                             <Label Text="X * 2" BackgroundColor="Gray" TextColor="Black" XAlign="Center" YAlign="Center"></Label>
                         </d:Column.HeaderView>
                         <d:Column.Template>
                             <DataTemplate>
                                 <Label Text="{Binding DoubleX}" BackgroundColor="White" TextColor="Black" XAlign="Center" YAlign="Center"></Label>
                             </DataTemplate>
                         </d:Column.Template>
                     </d:Column>
                 </d:DataGrid.Columns>
             </d:DataGrid>
<!--         </Grid>-->
    </StackLayout>
</ContentPage>

data grid row height auto resizing

        <d:DataGrid Rows="{Binding FeatureAttributes, Mode=TwoWay}" BackgroundColor="Black" HeaderHeight="25" RowHeight="Auto">

The RowHeight property when set to Auto, crashes the application. If given an integer, it works fine. I need the data grid to be resized based on the content. Could you please suggest a solution or fix the issue?

No Scrolling on IPhone 6 Devieces

The scrolling works on IPad, IPod touch and the IPhone 6 simulator, in Xamarin. However, on an IPhone 6 device, the grid does not scroll both, left and right and up and down.

Problem Adding Multiple Controls

The DataGrid does not work when there are multiple controls on a ContentPage.

The headers show, but the bound data does not. The data shows when the DataGrid is the only control on the page

I am using Xamarin Studio on a Mac and am running the App on a simulator.
Xamairn.Forms version 1.5.0.6447

The page is set up like this:
A StackLayout with two StackLayouts inside it. Inside the first StackLayout is a label with some text. Inside the second StackLayout is the DataGrid.

Binding exception

Hi, by following the Getting Started document i succeed in using the grid, however the scroll it terribly slow (100 rows, 5 cols with only a label inside). In the ouput log i can see that an exception is raized for each cells:

Binding: 'MYPROPERTY' property not found on 'Myapp.ViewModels.ViewModelTest', target property: 'Xamarin.Forms.Label.Text'

  • The DataGrid.Row point to my observablecollection
  • The label Binding seems correct (<Label Text="{Binding MYPROPERTY}" )
  • Is see the data in runtime, just slow down due to the multiple exceptions

any clue ?
Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.