Git Product home page Git Product logo

Comments (2)

JohnTheDeep avatar JohnTheDeep commented on July 3, 2024

Page code

<ContentPage.Content>
        <StackLayout>
            <Label Text="Welcome to Xamarin.Forms!"
                VerticalOptions="CenterAndExpand" 
                HorizontalOptions="CenterAndExpand" />
            <dg:DataGrid FontSize="12" ItemsSource="{Binding Path=_cashBoxOperations}" SelectionEnabled="True" SelectedItem="{Binding Path=SelectedOperation}"
               RowHeight="80" HeaderHeight="50" BorderColor="#CCCCCC" HeaderBackground="#E0E6F8"
               PullToRefreshCommand="{Binding RefreshCommand}" IsRefreshing="{Binding IsRefreshing}">
                <dg:DataGrid.HeaderFontSize>
                    <OnIdiom  x:TypeArguments="x:Double">
                        <OnIdiom.Tablet>15</OnIdiom.Tablet>
                        <OnIdiom.Phone>13</OnIdiom.Phone>
                    </OnIdiom>
                </dg:DataGrid.HeaderFontSize>
                <dg:DataGrid.Columns>
                    <dg:DataGridColumn Title="Дата" PropertyName="Date" Width="2*"/>
                    <dg:DataGridColumn Title="Взято" PropertyName="Taken" Width="2*"/>
                    <dg:DataGridColumn Title="Тип" PropertyName="Type" Width="2*"/>
                    <dg:DataGridColumn Title="До" PropertyName="LessIn" Width="2*"/>
                    <dg:DataGridColumn Title="После" PropertyName="Less" Width="2*"/>
                </dg:DataGrid.Columns>
                <dg:DataGrid.RowsBackgroundColorPalette>
                    <dg:PaletteCollection>
                        <Color>#F2F2F2</Color>
                        <Color>#FFFFFF</Color>
                    </dg:PaletteCollection>
                </dg:DataGrid.RowsBackgroundColorPalette> 
                <dg:DataGrid.Resources>
                    <ResourceDictionary>
                        <conv:StreakToColorConverter x:Key="StreakToColorConverter"/>
                    </ResourceDictionary>
                </dg:DataGrid.Resources>
            </dg:DataGrid>
        </StackLayout>

    </ContentPage.Content>
</ContentPage>

VM of Page

 public class SecondPageVM : BaseViewModel
    {
        private CashBoxOperations _SelectedOperation;
        public CashBoxOperations SelectedOperation
        {
            get => _SelectedOperation;
            set
            {
                SetProperty(ref _SelectedOperation, value);
                Application.Current.MainPage.DisplayAlert("Error",$"{SelectedOperation.Id + " " + SelectedOperation.Date}","Ok");
            }
        }
        private ObservableCollection<CashBoxOperations> _cashBoxList;
        public ObservableCollection<CashBoxOperations> _cashBoxOperations
        {
            get => _cashBoxList;
            set => SetProperty(ref _cashBoxList, value);
        }
        public Controller _controller;
        private Salons _selectedSalon;
        public Salons SelectedSalon
        {
            get => _selectedSalon;
            set => SetProperty(ref _selectedSalon, value);
        }
        public SecondPageVM(Salons _sel)
        {
            SelectedSalon = _sel;
            _controller = new Controller();
            _cashBoxOperations = _controller.GetOperations(SelectedSalon);
        }
    }

from xamarin.forms.datagrid.

akgulebubekir avatar akgulebubekir commented on July 3, 2024

should be fixed with latest package

from xamarin.forms.datagrid.

Related Issues (20)

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.