{"id":23820333,"url":"https://github.com/newky2k/dscomponents","last_synced_at":"2025-09-07T03:31:16.690Z","repository":{"id":25097255,"uuid":"28518322","full_name":"newky2k/dscomponents","owner":"newky2k","description":"Mobile Data Grid for NET.iOS and NET.Android 8.0 and above","archived":false,"fork":false,"pushed_at":"2024-11-21T21:07:05.000Z","size":2893,"stargazers_count":5,"open_issues_count":0,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-06T22:48:31.283Z","etag":null,"topics":["android","dotenv","ios"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/newky2k.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-12-26T18:42:03.000Z","updated_at":"2024-11-21T19:23:18.000Z","dependencies_parsed_at":"2023-01-14T08:00:32.692Z","dependency_job_id":null,"html_url":"https://github.com/newky2k/dscomponents","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/newky2k%2Fdscomponents","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/newky2k%2Fdscomponents/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/newky2k%2Fdscomponents/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/newky2k%2Fdscomponents/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/newky2k","download_url":"https://codeload.github.com/newky2k/dscomponents/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":232165974,"owners_count":18482034,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","dotenv","ios"],"created_at":"2025-01-02T07:34:49.430Z","updated_at":"2025-01-02T07:34:50.068Z","avatar_url":"https://github.com/newky2k.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"DSGridView is a fast lightweight and customisable data grid component for all your data presentation needs.\n\n# DSGridView Features\n\n* Customisable themes  \n    * Can be set globally or for each instance of DSGridView   \n    * Cross-platform for use across supported platforms  \n    * Easy to implement your own themes or override elements of the default ones   \n* Works on .NET 8.0 iOS and Android (Beta) Native\n    * MAUI support in development  \n* Cross-plafrom support for Datasources    \n* High performance loading and rendering - 100,000 records as quick as 20\n* Low memory footprint\n* Support for standard .Net DataSet and DataTable objects\n* Lightweight and simple to use\n* Support for Hot-Swapping between DataTables in a DataSet\n* Column sorting with themeable sort indicator\n* Events for Row and Cell selection - Including Double Tap\n* Works from an XIB, as a view or a view controller\n* Support Text,Image, Boolean Cells and Custom views  \n    * Formatters provided for Image and Boolean Cells to configure appearance  \n    * Custom views can also be used in cells, including entry of data  \n\n# Android Beta #\n\nAndroid support is currently considered beta.  There may be elements that do not function as expected and performance on large datasets is, currently, not as good as it is on iOS.  \n\nIf you find any issues then please get in contact so we can get them fixed, details are in the \"Contact Us\" section below.\n\n## Upgrade Notes\n\nVersion 2.0 received a number of changes that could stop your application from compiling. This is in order to provide cross-platform support for future Android and Windows Phone releases.  Please check the Getting Started section \"Upgrading from 1.x to 2.x\" for details of how to upgrade your existing project to 2.0.\n\n\n### Upgrading from v2.x to 2.6\n\nTo fix an issue with retaining selection after sorting a column some changes have been implemented.  Please read the upgrade notes in the Getting Started guide for more information.\n\n## Usage\n\nBoth a view and view controller are provided to get you started in as few steps as possible.\n\n### Create DataSource\n\nFor small datasets create a data source object to use with the data grid, a DSDataTable in this case.\n\nAdd the columns first then add the rows of data.\n\n\n\tusing DSoft.Datatypes.Grid.Data;\n\t\n\tpublic override void ViewDidLoad ()\n\t{\n\t\t//create the data table object and set a name\n\t\tvar aDataSource = new DSDataTable(\"ADT\");\n\t\t//add a column\n\t\tvar dc1 = new DSDataColumn(\"Title\");\n\t\tdc1.Caption = \"Title\";\n\t\tdc1.ReadOnly = true;\n\t\tdc1.DataType = typeof(String);\n\t\tdc1.AllowSort = true;\n\t\tdc1.Width = ColumnsDefs[aKey];\n\t\t\n\t\taDataSource.Columns.Add(dc1);\n\t\t   \n\t\t//add a row to the data table\n\t\tvar dr = new DSDataRow();\n\t\tdr[\"ID\"] = loop;\n\t\tdr[\"Title\"] = @\"Test\";\n\t\tdr[\"Description\"] = @\"Some description would go here\";\n\t\tdr[\"Date\"] = DateTime.Now.ToShortDateString();\n\t\tdr[\"Value\"] = \"10000.00\";\n\t\t\n\t\t//set the value as an image\n\t\tdr[\"Image\"] =  UIImage.FromFile(\"first.png\")\n\t\t\n\t\taDataSource.Rows.Add(dr); \n\t\t\n\t\t...\n\t}\n\nFor large datasets you can create a sub-class of `DSDataTable` and then override some of it functions to allow for \"Lazy\" loading of the data.\n\nIf you want to use the `Rows` property of `DSDataTable` to store your `DSDataRow` objects then you only need to override\n\n* GetRowCount\n    * This can be ignored if you want to pre-load your data\n* GetRow(int Index)\n    * This is used to return the DSDataRow from your collection Just-in-Time\n    \n\nIf you want to use your own collection then you will need to override the following methods, to ensure that it uses you custom collection.\n\n* GetRowCount\n* GetRow(int Index)\n* GetRow(string RowId)\n* IndexOfRow(string RowId)\n* GetValue (int RowIndex, string ColumnName)\n* SetValue (int RowIndex, string ColumnName, object Value)\n* SortByColumn(int ColumnIndex)\n\nThis will allow the Grid to load super quick and worry about loading the data when needed.\n\n\tusing DSoft.Datatypes.Grid.Data;\n\t\n\tpublic class MyDataTable : DSDataTable\n\t{\n\t\n\t\tpublic void MyDataTable(String Name) : base(Name)\n\t\t{\n\t\t\t//create and add a column\n\t\t\tvar dc1 = new DSDataColumn(\"Title\");\n\t\t\tdc1.Caption = \"Title\";\n\t\t\tdc1.ReadOnly = true;\n\t\t\tdc1.DataType = typeof(String);\n\t\t\tdc1.AllowSort = true;\n\t\t\tdc1.Width = ColumnsDefs[aKey];\n\t\t\t\n\t\t\tthis.Columns.Add(dc1);\n\t\t}\n\t\t\n\t\tpublic override int GetRowCount ()\n\t\t{\n\t\t\treturn 100000;\n\t\t}\n\t\t\n\t\tpublic override DSDataRow GetRow (int Index)\n\t\t{\n\t\t\tDSDataRow aRow = null;\n\n\t\t\t//check to see if we have a row for this index\n\t\t\tif (Index \u003c Rows.Count)\n\t\t\t{\n\t\t\t\taRow = Rows [Index];\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// create a new one\n\t\t\t\taRow = new DSDataRow ();\n\t\t\t\taRow [\"Title\"] = @\"Test\";\n\t\t\t\tRows.Add (aRow);\n\t\t\t}\n\t\t\t\n\t\t\t///set the values\n\t\t\taRow [\"Description\"] = @\"Some description would go here\";\n\t\t\taRow [\"Date\"] = DateTime.Now.ToShortDateString ();\n\t\t\taRow [\"Value\"] = \"10000.00\";\n\n\t\t\t//see if even or odd to pick an image from the array\n\t\t\tvar pos = Index % 2;\n\t\t\taRow [\"Image\"] = Icons [pos];\n\t\t\taRow [\"Ordered\"] = (pos == 0) ? true : false;\n\n\t\t\treturn aRow;\n\t\t}\t\t\n\t\t\n\t}\n\n### Create Grid View - iOS\n\nCreate the grid view as with any normal iOS View and then set the datasource of the DSGridView object.\n\n\n\tusing DSoft.Datatypes.Grid.Data;\n\tusing DSoft.UI.Grid;\n\t\n\tpublic override void ViewDidLoad ()\n\t{\n\t\t...\n\t\t\n\t\t//Create the grid view, assign the datasource and add the view as a subview\n\t\tvar aGridView = new DSGridView(new RectangleF(0,0,1024,768));\n\t\t\n\t\t//assign the datasource\n\t\taGridView.DataSource = aDataSouce;\n\t\t\n\t\t//add to view\n\t\tthis.View.AddSubview(aGridView);\n\t        \n\t}\n\n### Create Grid View - Android\n\nCreate the grid view as with any normal Android View, either in you layout file or programatically, and then set the datasource of the DSGridView object.\n\nIn your layout file setup view \n\n\t\u003c?xml version=\"1.0\" encoding=\"utf-8\"?\u003e\n\t\u003cLinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n\t    android:orientation=\"vertical\"\n\t    android:layout_width=\"fill_parent\"\n\t    android:layout_height=\"fill_parent\"\u003e\n\t    \u003cdsoft.ui.grid.DSGridView\n\t        android:id=\"@+id/myDataGrid\"\n\t        android:layout_width=\"fill_parent\"\n\t        android:layout_height=\"fill_parent\" /\u003e\n\t\u003c/LinearLayout\u003e\n\t\nIn your Activity build access the view or create one programtically\n\n\tusing DSoft.Datatypes.Grid.Data;\n\tusing DSoft.UI.Grid;\n\t\n\t\tDSGridView mDataGrid;\n\n\t\tprotected override void OnCreate(Bundle bundle)\n\t\t{\n\t\t\tbase.OnCreate(bundle);\n\n\t\t\tSetContentView(Resource.Layout.Main);\n\n\t\t\tmDataGrid = this.FindViewById\u003cDSGridView\u003e(Resource.Id.myDataGrid);\n\n\t\t\t/*\n\t\t\t\tmDataGrid = new DSGridView(this);\n\t\t\t\tmDataGrid.LayoutParameters = new ViewGroup.LayoutParams (FrameLayout.LayoutParams.FillParent, FrameLayout.LayoutParams.FillParent);\n\n\t\t\t\tthis.SetContentView (mDataGrid);\n\t\t\t*/\n\t\t\tif (mDataGrid != null)\n\t\t\t{\n\t\t\t\tmDataGrid.DataSource = new ExampleDataSet (this);\n\t\t\t\tmDataGrid.TableName = \"DT1\";\n\t\t\t}\n\n\n\t\t}\n\t\n### Register for events\n\nOnce the grid is created you can register for the selection events\n\n\n\tusing DSoft.Datatypes.Grid.Data;\n\tusing DSoft.UI.Grid;\n\tpublic override void ViewDidLoad ()\n\t{\n\t\t...\n\t\t        \n\t\t// Add handlers for single and double tap on each cell\n\t\taGridView.OnSingleCellTap += (DSGridCellView sender) =\u003e \n\t\t{\n\t\t\t//do something\n\t\t};\n\t\t\t\n\t\taGridView.OnDoubleCellTap += (DSGridCellView sender) =\u003e \n\t\t{\n\t\t\t//do something\n\t\t};\n\t\t\t\n\t\t//single row selected\n\t\taGridView.OnRowSelect += (DSGridRowView sender, DSDataRow Row) =\u003e \n\t\t{\n\t\t\t//do something\n\t\t};\n\t\t\t\n\t\t//row double tap\n\t\taGridView.OnRowDoubleTapped += (DSGridRowView sender, DSDataRow Row) =\u003e \n\t\t{\n\t\t\t//do something\n\t\t};\n\t        \n\t}\n\n\n### Windows Phone\n\nWe have just completed a major piece of work to transform the existing solution in to more portable and cross-platform codebase.  This has benefits for not just us, but for you as well by making as much of your code reusable across platforms as possible.\n\nWork on windows phone will start shortly, once Android exists beta\n\n### Contact Us  \nIf you like DSGridView then please leave feedback on the Xamarin component store.\n\nIf you have any questions, suggestions or feedback please feel free to contact us via email: gridview at dsoftonline.com or check out our website: http://www.dsoftonline.com\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnewky2k%2Fdscomponents","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnewky2k%2Fdscomponents","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnewky2k%2Fdscomponents/lists"}