GithubHelp home page GithubHelp logo

akgulebubekir / xamarin.forms.datagrid Goto Github PK

View Code? Open in Web Editor NEW
260.0 260.0 76.0 4.76 MB

DataGrid Component For Xamarin.Forms Projects

License: MIT License

C# 100.00%
datagrid xamarin xamarin-components xamarin-forms xamarin-library

xamarin.forms.datagrid's Introduction

Hey ๐Ÿ‘‹, I'm Ebu

Hej ๐Ÿ‘‹, Jag รคr Ebu

Merhaba ๐Ÿ‘‹, Ben Ebu

  • Software Engineer at Boeing since August 2018.
  • Mostly working on .net, Maui, WPF, WinForms, WinUI, FlaUI, Xamarin, Python.

I โค Open-Source


Follow me on

ย ย  ย ย  ย ย  ย ย  ย ย 


Recent Activity

  1. ๐Ÿ—ฃ Commented on #170 in akgulebubekir/Maui.DataGrid
  2. ๐Ÿš€ Published release Maui.DataGrid 4.0.3 in akgulebubekir/Maui.DataGrid
  3. ๐ŸŽ‰ Merged PR #7 in akgulebubekir/PdfSharp.Maui
  4. โŒ Closed PR #169 in akgulebubekir/Maui.DataGrid
  5. ๐Ÿ—ฃ Commented on #3 in akgulebubekir/PdfSharp.Maui

Does my projects make your life easier?

You may consider to show me your interest and keep my motivation high. Buying me a coffee will keep me awake while developing cool projects that make life easier.

xamarin.forms.datagrid's People

Contributors

0rupp avatar akgulebubekir avatar assemhakmeh avatar mmasdivins avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

xamarin.forms.datagrid's Issues

Data template in a column in c#

Hello everybody.
I've added this grid to my project and i use it from C# programmatically.
Everything work fine but when i want to set a data template it doesn't work anymore.
This is my data grid:

public class myDataGrid: ScrollView
	{
		public DataGrid grid;
		public string _queriesId;
		public myDataGrid(string queryId )
		{
			System.Diagnostics.Debug.WriteLine("myDataGrid - costructor queryId: " + queryId);
			_queriesId = queryId;
			grid = new DataGrid();
			grid.Columns = generateColumn();
			grid.BorderColor = GlobalVariables.BackColorGrigio1();
			grid.BackgroundColor = Color.White;
			grid.HeaderBackground = GlobalVariables.BackColorGrigioDark();
			grid.HeaderTextColor = Color.White;
			grid.HeaderBordersVisible = false;
			grid.SelectionEnabled = true;

			var pc = new PaletteCollection();
			pc.Add(GlobalVariables.TextColorGrigio1());
			grid.RowsTextColorPalette = pc;
			grid.HeaderHeight = 40;
			grid.ActiveRowColor = GlobalVariables.BackColorAzzurro1();
			grid.VerticalOptions = LayoutOptions.FillAndExpand;
			Orientation = ScrollOrientation.Horizontal;
			Content = grid;
			System.Diagnostics.Debug.WriteLine("myDataGrid - costructor end");
		}
		private ColumnCollection generateColumn()
		{

			System.Diagnostics.Debug.WriteLine("myDataGrid - generateColumn start");
			var columns = new ColumnCollection();
			var queries = QueriesListData.getQueryById(_queriesId);
//is a dictionary of dictionary where i have the name of the column of the table from DB and in the dictionary i have the configuration. When i have a date i want to set up the format but it can also be empty
			var fields = queries.qFieldsList;
			foreach (var field in fields)
			{
				if (field.Value["visible"] == "true")
				{
					var column = new DataGridColumn();
					column.Title = field.Value["headerText"];
					column.PropertyName = field.Key;
					if (field.Value["width"] != "*")
					{
						column.Width = int.Parse(field.Value["width"]);
					}
					if (field.Value["tipo"] == "data")
					{
						System.Diagnostics.Debug.WriteLine("myDataGrid - generateColumn tipo data");
						column.CellTemplate = new DataTemplate(() =>
						{
							var grr = new Grid();
							grr.ColumnDefinitions.Add(new ColumnDefinition { Width = new GridLength(1, GridUnitType.Star) });

							var nameLabel = new Label { FontAttributes = FontAttributes.Bold,Text="ciao" };

							nameLabel.SetBinding(Label.TextProperty, field.Key);

							grr.Children.Add(nameLabel);

							return new ViewCell
							{
								View = grr
							};
						});




					}
					else {
						

						if (field.Value["tipo"] == "int")
						{
							column.HorizontalContentAlignment = LayoutOptions.EndAndExpand;
						}
						else if (field.Value["tipo"] == "double")
						{
							column.HorizontalContentAlignment = LayoutOptions.EndAndExpand;
						}
						else if (field.Value["tipo"] == "string")
						{
							column.HorizontalContentAlignment = LayoutOptions.StartAndExpand;
						}
					}
					columns.Add(column);
				}
			}

			System.Diagnostics.Debug.WriteLine("myDataGrid - generateColumn end");
			return columns;

		}
	}

Empty data template?

Hello - was just wondering if there was the ability to specify what to display when there is no data displayed in the grid?

Binding to List<T>

When I try to use { Binding SomeAttribute } it doesn't work
.<dg:DataGridColumn Title="Detalhar" Width="2*" PropertyName="Cor" > <DataTemplate> <Button BorderColor="Gray" Text="{Binding Cor}" /> </DataTemplate> </dg:DataGridColumn>

Background Color Update

Great control, thanks for your hard work. Unfortunately, I am having an issue where the selected row's background color is not being updated on click/tap. However, if I select it then re-sort, modify my bound list, etc it will then correctly update and change the background color of the previously selected row.

I poked around in the code but couldn't see anything obvious. Any thoughts?

Increased CPU and memory usage?

Thanks for this control, solid addition to Xamarin. I am, however, running into one little snag: I have the ItemsSource bound to my collection and things work great until I start adding some items. That is, I am bound to an initially empty ObservableCollection and am adding items to it via the UI and seeing, after getting in 10 or so entries, my memory usage begin to climb dramatically and my app begin to become more sluggish. I can limit this effect DRAMATICALLY by removing the use of the internal list and binding the internal ListView directly to my ObservableCollection but that has some unfortunate repercussions as you can probably guess (sorting to name one) as well as the introduction of a delightful flickering...

Is nobody else seeing anything similar or is everyone else using it with a fairly static collection? Any thoughts/insights would be greatly appreciated.

CarouselPage with

I'm working on a CarouselPage that has multiple grids created through ItemTemplate and my ViewModel. I'm unable to get the refresh command working in this scenario. The pull down of the grid causes no refresh to execute.

<CarouselPage x:Name="CarouselPageStraddleMarkets" Title="StrdPx" ItemsSource="{Binding Path=WebStraddleMarketsSet}">
    <CarouselPage.ItemTemplate>
      <DataTemplate>
        <ContentPage>
          <ContentPage.Content>
            <StackLayout Orientation="Vertical">
              <Button x:Name="ButtonStraddleMarkets" Text="{Binding Path=Name}" Margin="5"/>
              <dg:DataGrid RowHeight="25" HeaderHeight="25" SelectionEnabled="False" ItemsSource="{Binding Path=StraddleMarkets}" HeaderFontSize="10" FontSize="8"
                            IsRefreshing="{Binding Path=IsRefreshing}" PullToRefreshCommand="{Binding Path=RefreshCommand}">
                <dg:DataGrid.Columns>
                  <dg:DataGridColumn Title="Sym">
                    <dg:DataGridColumn.CellTemplate>
                      <DataTemplate>
                        <ContentView>
                          <Label Text="{Binding Path=Sym}" FontSize="Small"/>
                        </ContentView>
                      </DataTemplate>
                    </dg:DataGridColumn.CellTemplate>
                  </dg:DataGridColumn>
                  <dg:DataGridColumn Title="Strike">
                    <dg:DataGridColumn.CellTemplate>
                      <DataTemplate>
                        <ContentView>
                          <Label Text="{Binding Path=Strk}" FontSize="Small"/>
                        </ContentView>
                      </DataTemplate>
                    </dg:DataGridColumn.CellTemplate>
                  </dg:DataGridColumn>
                 </dg:DataGrid.Columns>
                </dg:DataGrid>
               </StackLayout>
              <ContentPage.Content>
             </ContentPage>
            </DataTemplate>
          </CarouselPage.ItemTemplate>
         <CarouselPage>

Any chance this can be looked into or maybe I'm implementing the XAML incorrectly?

Row color depending on the content

I know that is possible to change the cell background color depending on the content with a converter, as showed on the example. But, is there a way to change the color of the full row depending on the value of one cell?

Footer

Is there facility to specify a header and footer?

Horizontal scroll crashes UWP App

When I added DataGrid in a ScrollView, and set Scroll Orientation to HORIZONTAL, the UWP crash and the exception was:

"System.Runtime.InteropServices.COMException: Error HRESULT E_FAIL has been returned from a call to a COM component.
at Windows.UI.Xaml.UIElement.Measure(Size availableSize)
at Xamarin.Forms.Platform.UWP.VisualElementRenderer2.MeasureOverride(Size availableSize) at Windows.UI.Xaml.UIElement.Measure(Size availableSize) at Xamarin.Forms.Platform.UWP.VisualElementRenderer2.MeasureOverride(Size availableSize)
at Windows.UI.Xaml.UIElement.Measure(Size availableSize)
at Xamarin.Forms.Plat"

DataGrid.txt

Tap event

Is it possible to register some method on tap event?
I was not able to find something like this.

Please add an ItemSelected event

An ItemSelected event would be beneficial as this can be used to wire up additional commands to respond to selection.

I have these changes available if you will accept pull requests.

DataGrid binding crashes UWP app

I am creating an application with Xamarin using the shared definition, and my application should run on Android and as an UWP app. I had followed the sample showed in DataGrid's repository, and it works very well on Android, but I am having an issue when I try to run as a UWP app. The issue is that, when I run as a UWP app with a populated List and try to binding this list on the DataGrid, the app crashes, showing this Exception:

"System.Runtime.InteropServices.COMException: Error HRESULT E_FAIL has been returned from a call to a COM component.
at Windows.UI.Xaml.UIElement.Measure(Size availableSize)
at Xamarin.Forms.Platform.UWP.VisualElementRenderer`2.MeasureOverride(Size availableSize)
at Windows.UI.Xaml.UIElement.Measure(Size availableSize)
at Xamarin.Forms.Platform.UWP.VisualElementRenderer`2.MeasureOverride(Size availableSize)
at Windows.UI.Xaml.UIElement.Measure(Size availableSize)
at Xamarin.Forms.Plat"

As I had said this exception only occur on UWP, and only happens when this List is populate. The list is create in this way:

private List<TableValue> _tableValues;

public List<TableValue> TableValues
{
   get { return _tableValues; }
   set
   {
      TableValues= value;
      OnPropertyChanged(nameof(TableValues));
   }
}

private List<TableValue> CreateTableValues()
{
    return new List<TableValue>{
        new TableValue{Val1="", Val2="", Val3="", Val4="", Val5="", Val6="", Val7=""}
    };
}

public async Task PopulateItems()
{
    _tableValues = CreateTableValues();
    UpdateProperty();
}

This list is create inside of the MVVM class of the View. The DataGrid element is create in the View in that way:

private ScrollView CreateTable()
{
   table = new DataGrid();
   table.Columns.Clear();
   table.Columns.AddRange(CreateColumns());
   table.SelectionEnabled = true;
   table.BackgroundColor = Color.White;
   table.SetBinding(DataGrid.ItemsSourceProperty, new Binding("TableValues"));
   table.HeaderBackground = Color.FromHex("#D4D0C8");
   table.HeaderFontSize = 18;
   table.HeaderTextColor = Color.FromHex("#08098F");

   StackLayout tableStack = new StackLayout
   {
       BackgroundColor = Color.White,
       HeightRequest = 850,
       VerticalOptions = LayoutOptions.FillAndExpand
   };
   tableStack.Children.Add(table);

   var scroll = new ScrollView
   {
       BackgroundColor = Color.White,
       Margin = new Thickness(5, 5, 5, 5),
       Content = tableStack,
       Orientation = ScrollOrientation.Horizontal,
       HorizontalOptions = LayoutOptions.FillAndExpand,
       VerticalOptions = LayoutOptions.FillAndExpand
   };

   return scroll;
}

Sorting Image Bug

The Sorting image for indicatin ascending or descending order only appears the first time you click on a column.
If you order by one column and then order by a different column the arrow image won't appear on that new column. If you order by the first column again the ordenation works but the arrow image will never appear again on any column. Only works the first time a column is selected.
I even tried progamatically trying to clear the datagrid but still no arrow. Something like:
dataGrid.ItemsSource = null;
dataGrid.IsSortable = false;
dataGrid.ItemsSource = OrderList;
dataGrid.IsSortable = true;
dataGrid.ForceLayout();

Column title binding

Hi,

I've tried to bind the column title without success:
<dg:DataGridColumn Title="{Binding MyTitle}" PropertyName="Key"/>

Is there any other way to change a column title at runtime ?

Thanks
David

.NETStandard support

It appears that this library is not supported with .NETStandard, is there any workaround? I installed the package as it was described in the README for this NuGet package for all the Xamarin.Forms platform-specific (iOS, Android, UWP) projects and then added Xamarin.Forms.DataGrid.dll as a reference to the .NETStandard project, but I am still getting a runtime error when I try to access the XAML page with the data grid on it. The error is very generic - just an unhandled exception occurred.

How to assign event to a cell tapping

Hi,
thanks in advance for your help.
I would like to execute code (specific for the cell) when the user taps onto a datagrid cell.
Is It possible?

Thankyou

Gianmichele

Row color selected item

I have a problem on ios with deselecting an item. In the background the binding is null, but the surface still shows the selection. Any idea how to fix that?

Futhermore is there a possibilty to show the vertical/horizontal lines of the grid even with empty rows?

how to get the name of image.

How to get the name of image in logo column.on image.gesture event i want to open an image.Thats only possible i get on click event.my image gesture event is working.But i cant collect the name of image on the clicked column.

Thanks

[UWP] RowsBackgroundColorPalette doesn't work with dynamic palette.

We set RowsBackgroundColorPalette property with dynamic resource. In first load it is working according to theme, but when we change the theme, the datagrid color does not change.

<dg:PaletteCollection x:Key="DataGridRowBackground">
    <Color>#FFFFFF</Color>
</dg:PaletteCollection>

<dg:DataGrid x:Name="dataGrid" RowsBackgroundColorPalette="{DynamicResource DataGridRowBackground}"/>

No borders

I would like to have no borders.

Off course I can simulate no borders by using the background-color as border-color, but this won't work when the headers have a different background-color. An option to specify border-width (with optional 0) would be useful in more situations.

Great control!

How to show enum values as a text

Hi
I'm creating an enum column that show the enums values translated using a resource.
I'm doing a celltemplate like this:

private static DataTemplate GetCellTemplete(Assembly assembly)
        {
            return new DataTemplate(() =>
           {
               var label = new Label
               {
                   HorizontalTextAlignment = TextAlignment.Start,
                   VerticalTextAlignment = TextAlignment.Center
               };

               label.SetBinding(Label.TextProperty, new Binding("."));

               label.PropertyChanging += (sender, args) =>
               {
                   if (args.PropertyName == nameof(label.Text))
                   {
                       var value = label.Text;
                       if (!String.IsNullOrWhiteSpace(value))
                       {
                           value = GetTranslator(assembly).Get(value);
                           label.SetValue(Label.TextProperty, value);
                       }
                   }
               };

               return label;
           });
        }

But the label.Text doesn't update with the new value and show the enum value.

How can I change the text for cell based in some conditions?

*Sorry for english mistakes

Align header

I need to align header depending to column, so when I have 2 items in header and 2 columns, columns are align to left and right side I want to do the same with header items. Is it possible?

Binding Columns Bug

Hi, Thank you very much for your wonderful control.
I found a bug that occurs when Binding to Columns property.
This is NullReferenceException.
In this file:
DataGrid.xaml.cs Columns in null
To repair, I added checks for null

if(Columns == null)
{
    return;
}

foreach (var col in Columns)
{......

Before foreach.
and it worked)))

The type initializer for 'Xamarin.Forms.DataGrid.DataGrid' threw an exception.

Anyone else is seeing this? The whole exception contents are:

   System.TypeInitializationException: The type initializer for 'Xamarin.Forms.DataGrid.DataGrid' threw an exception. ---> System.Reflection.TargetException: Exception of type 'System.Reflection.TargetException' was thrown.
   at System.Reflection.RuntimeMethodInfo.ThrowNoInvokeException()
   at System.Reflection.RuntimeMethodInfo.InvokeArgumentsCheck(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at Xamarin.Forms.ImageSource.FromResource(String resource, Assembly sourceAssembly)
   at Xamarin.Forms.DataGrid.DataGrid..cctor()
   --- End of inner exception stack trace ---
   at Xamarin.Forms.DataGrid.DataGrid.get_HeaderBackground()

Digging deeper in the InnerException, it shows:

   System.Reflection.TargetException: Exception of type 'System.Reflection.TargetException' was thrown.
   at System.Reflection.RuntimeMethodInfo.ThrowNoInvokeException()
   at System.Reflection.RuntimeMethodInfo.InvokeArgumentsCheck(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at Xamarin.Forms.ImageSource.FromResource(String resource, Assembly sourceAssembly)
   at Xamarin.Forms.DataGrid.DataGrid..cctor()

I have even downloaded a copy of Xamarin.Forms.DataGrid and placed it alongside the rest of my projects, in my solution (instead of using the NuGet version), so that I could trace into it. I have confirmed that the exception is raised the getter of HeaderBackground in DataGrid.xaml.cs, line:192

public Color HeaderBackground
{
	get { return (Color)GetValue(HeaderBackgroundProperty); }
	set { SetValue(HeaderBackgroundProperty, value); }
}

However, it seems it is not DataGrid's fault, but Xamarin's. An important note, it only happens in UWP projects (Android works fine and I have no way to test iOS platform).

Can someone confirm this issue? If so, a comment in Is ImageSource.FromResource() working for UWP ? would be much appreciated.

SelectionEnabled incorrect reference

The SelectionEnabledProperty is incorrectly referencing SelectedItem in the BindableProperty.Create method.

I have this change available if you will accept pull requests.

Height of grid inside a ScrollView

Hi,
I have placed two DataGrid's inside a StackLayout which in located in a ScrollView.
On iOS everything looks normal when when using Android I get a large bottom padding that I cannot understand.
Both grids have this problem. Strange thing is that the second DataGrid seems to get about the double amount of bottom margin as the first.

...
     <dg:DataGrid.RowsBackgroundColorPalette>
             <dg:PaletteCollection>
                    <Color>#222</Color>
                    <Color>#333</Color>
             </dg:PaletteCollection>
     </dg:DataGrid.RowsBackgroundColorPalette>
  </dg:DataGrid>

Any ideas or do you need more details?

Hide and freeze columns

How to add an IsVisible property for each column?

How to keep the left column always visible?

Is it possible?

How to Clear DataGrid

Dear akgulebubekir
I am using the grid in my project and its working.I am stuck here on one point.I want to clear all the rows and reload the data again.But i could not succeed.Sirens is my datasource.

       Sirens.Clear();
        Sirens = null;
        Sirens=new List<ClsSirensModel>();
             
        foreach (Feature feature in _selectedFeatures)
        {
             SirenObj = new ClsSirensModel();
             SirenObj.Logo = "password.png";
              Sirens.Add(SirenObj);
      }

       <dg:DataGrid x:Name="DataGrid" ItemsSource="{Binding Sirens}" SelectionEnabled="True" SelectedItem="{Binding SelectedSiren}" RowHeight="30" HeaderHeight="50" BorderColor="#CCCCCC" HeaderBackground="#E0E6F8" ActiveRowColor="#8899AA">

dg:DataGrid.Columns
<dg:DataGridColumn Title="Region" PropertyName="RegionNameAr" Width="2.0*"/>
</dg:DataGridColumn>
<dg:DataGridColumn Title="Logo" VerticalContentAlignment="Center" PropertyName="Logo" Width="50" HorizontalContentAlignment="Center" SortingEnabled="False">
dg:DataGridColumn.CellTemplate


<Image.GestureRecognizers>

                                    </TapGestureRecognizer>
                                </Image.GestureRecognizers>
                            </Image>
                        </DataTemplate>
                         </dg:DataGridColumn.CellTemplate>
                      </dg:DataGridColumn>
              </dg:DataGrid.Columns>

</dg:DataGrid>
but grid not clear.Please help.

Thanks in advance.

Catching sort errors

How to handle sorting errors? For example a DataGridColumn with a StackLayout which contains Date and Time Picker.

Updating ItemsSource after sorting won't update grid

When I update (add or remove items) my binding collection, which is attached to ItemsSource, changes are reflected in the datagrid.

However, after a header is clicked for sorting, changes to my collection won't update the datagrid anymore.

DataGrid 1.5.0
XF 2.3.2.127

Row height auto

Is there a way to set the row height to "Auto". I have a collection where some of the rows contains a lot of data, and others that dont, so it will be usefull for me to adapt the height depending on the length of the content.

Cannot scroll when it is inside a ScrollView. Any solutions?

The structure is, ScrollView - StackLayout - DataGrid. The page has other views, so it is long. This is why I used a StackLayout to stack them. Since it is long, it needs to be scrolled. That is why I put the StackLayout inside a ScrollView.

I set the DataGrid's height to 300. When there are many items, I can see a scrollbar inside the DataGrid, but when I try to scroll it, the outer ScrollView scrolls, so I cannot view the bottom items of DataGrid.

Is there any solution? Or should I avoid using a ScrollView?

Pickers Won't Display Changes in DataGrid

Not able to get Pickers refresh their display normally while nested inside of a DataGrid. The values can bind with the object model and thus the database but the displayed value turns blank white inside of a DataGrid. If I sort one of the columns the picker display will refresh when the views redraw themselves.

Tried with Xamarin Forms Picker, XLabs Bindable Picker, and the Bindable Picker found here https://forums.xamarin.com/discussion/30801/xamarin-forms-bindable-picker (this one gets the closest to working right).

`     <dg:DataGrid x:Name="DgSkills" ItemsSource="{Binding Skills}" SelectedItem="{Binding SelectedItem}"
                   BorderColor="#CCCCCC" HeaderBackground="#E0E6F8" SelectionEnabled="false"
                   Grid.Row="0">
        <dg:DataGrid.Columns>
          <dg:DataGridColumn Title="Skill Name" PropertyName="SkillName" Width="2*">
            <dg:DataGridColumn.CellTemplate>
              <DataTemplate>
                <Entry Text="{Binding SkillName}" HorizontalOptions="FillAndExpand"  VerticalOptions="FillAndExpand" />
              </DataTemplate>
            </dg:DataGridColumn.CellTemplate>
          </dg:DataGridColumn>
          <dg:DataGridColumn Title="Ability" Width="*"  >
            <dg:DataGridColumn.CellTemplate>
              <DataTemplate>
                  <views:BindablePicker SelectedIndex="{Binding TargetStat, Mode=TwoWay}" ItemsSource="{StaticResource ModStatStrings}" HorizontalOptions="FillAndExpand"  VerticalOptions="FillAndExpand" />
              </DataTemplate>
            </dg:DataGridColumn.CellTemplate>
          </dg:DataGridColumn>
          <dg:DataGridColumn Title="Total Bonus" PropertyName="TotalBonus"  Width="*">
            <dg:DataGridColumn.CellTemplate>
              <DataTemplate>
                <Entry Text="{Binding TotalBonus}" HorizontalOptions="FillAndExpand"  VerticalOptions="FillAndExpand" />
              </DataTemplate>
            </dg:DataGridColumn.CellTemplate>
          </dg:DataGridColumn>
          <dg:DataGridColumn Title="Ranks" PropertyName="Ranks"  Width="*">
            <dg:DataGridColumn.CellTemplate>
              <DataTemplate>
                <Entry Text="{Binding Ranks}" HorizontalOptions="FillAndExpand"  VerticalOptions="FillAndExpand" />
              </DataTemplate>
            </dg:DataGridColumn.CellTemplate>
          </dg:DataGridColumn>
          <dg:DataGridColumn Title="Misc." PropertyName="MiscMod"  Width="*">
            <dg:DataGridColumn.CellTemplate>
              <DataTemplate>
                <Entry Text="{Binding MiscMod}" HorizontalOptions="FillAndExpand"  VerticalOptions="FillAndExpand" />
              </DataTemplate>
            </dg:DataGridColumn.CellTemplate>
          </dg:DataGridColumn>
        </dg:DataGrid.Columns>
      </dg:DataGrid>`

2016-06-28 18_43_39-pathfindercharactersheet running - microsoft visual studio
2016-06-28 18_43_53-character sheet for pathfinder

As you can see when the item is selected, the display goes blank with a picker (this also applies to normal Xamarin Forms Pickers). I believe the issue is with the grid implementation.

How to use from an Activity

I have an activity based Android app and I would like to display some data on an activity. I set the page content by the function SetContentView (XAML)...

How can I use the DataGrid ? I don't have a ContentPage....

Active row not working on UWP

I have tested ActiveRowColor attribute and it works in Android, but not in UWP. Are there any workarounds for this issue?

Scroll in both directions?

What would you recommend for scrolling in both directions on a grid that is wider than the screen? I tried putting the data grid in a horizontal ScrollView and this technically works, but the device has a hard time figuring out whether the user wants to vertically scroll the data grid or horizontally scroll the ScrollView. Example:

<ScrollView Orientation="Horizontal">
    <dg:DataGrid ItemsSource="{Binding Items}" SelectionEnabled="False" 
        ...
    </dg:DataGrid>
</ScrollView>

The result is that the horizontal ScrollView seems to be more sensitive so while scrolling vertically if you slide even slightly horizontal, the horizontal scroll takes over. At that point the vertical scrolling stops. This leaves a very annoying user experience. Is there a better way to do this? Ideally, I'd like to be able to just scroll in both directions at the same time.

How to clear sorting image?

Thank you! Version 1.9.3 works. It solved my previous issue.
Now I just need to know how do I clear the sorting image?
If I update the datagrid I want to be able to erase the image and only appear again if feild is tapped.

Binding ItemsSource to ObservableCollection<T> doesn't work.

Hello,
After binding ObservableCollection to ItemsSource I cannot see my data.
On the other hand binding to List works fine.
I've found part of code which I believe causes binding problem (from dataGrid.xaml.cs):
//ObservableCollection Tracking if (n is INotifyCollectionChanged) (n as INotifyCollectionChanged).CollectionChanged += (list, arg) => { if (list == (b as DataGrid).ItemsSource && self._listView.ItemsSource != list) self.SortItems(self.SortedColumnIndex, false); }; else { self._listView.ItemsSource = n as IEnumerable; if (self.IsSortable && self.SortedColumnIndex >= 0) self.SortItems(self.SortedColumnIndex, false); }
Best regards,
Adam

SelectedRow highlight

A feature request here: could you add a way to highlight the selected row? At least in UWP there's no way to see what row is currently selected. Could you create a bindable property like "IsSelected" or so?

Thanks!

Header/Title is not showing from c# code

I try to add Header on columns. if it's from XAML is working.
but when I try to add from c# code. the header is empty. here is my code. looks like the Title property is not working.
public void SetDGColoumns()
{
int colNum=App.currentSheet.FieldInfoList.Count;
RecordsDG.Columns.Clear();
for (int k = 0; k < colNum; k++)
{
DataGridColumn dgc = new DataGridColumn();
dgc.Title = App.currentSheet.FieldInfoList[k].FieldName;
dgc.PropertyName = "DataFields[" + k + "].FieldValue";
RecordsDG.Columns.Add(dgc);
}
}

ObservableCollection issue

Hi guys,

We are trying the gird and encountered a bit unusual issue. When we just bind to list property, the grid appears and shows the results. We can select items. However, the grid does not refresh, when the list property has member added or removed. We then tried to use an ObservableCollection. In this case, when the grid first appears, only the headers are seen. When the headers are clicked for sorting after that the content of the grid appears. In this case removing or adding to collection triggers the refresh. Do you have any suggestion on what we may be doing wrong?

CellTemplate binding issue

Datagrid's BindingContext doesn't work in CellTemplate!

When I set CellTemplate and BindingContext of a DataGridCell, I expect to bind that context and show data regarding that, but it doesn't.

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.