Displaying data table in C# WPF application - c#

I am writing a WPF application in C# that needs to display data in a spreadsheet-like format dynamically. What is the best way to go about this?
The application will be getting data outputted from a fire alarm panel, chopping it up, and then displaying it in a neat table (or at least that's the plan).

Why not use WPF's Datagrid control? It should have all the functionality you need for the requirements you posted, more info here
http://www.wpftutorial.net/DataGrid.html

If you are using .Net 3.5, then please download WPF Toolkit and install to your VS 2008.
If you are using .Net 4.0, you can use the build in DataGrid control which you can select from the toolbox.

i think you might try to use using. Graham Knight is developing a lightweight, high performance data grid for WPF. This data grid, known as WPF Table View, is available on CodePlex under the Microsoft Public License.
It's able to view 100,000+ rows of data with dynamically defined columns and column data templates, as soon as I threw this at the data grid the user experience began to suffer.
http://tableview.codeplex.com/

Related

DataGridView in Xamarin for mobile app (Android/iOS)

I need to create an application where the main activity has to contain numerical data like in a DataGridView in windows form.
I have to display a number of rows that can change over time depending on some calculation (but it will never be less than 8 rows) and 5 columns.
Each cell of this table will contain a value.
When using windows form I was using DataGridView for the purpose of displaying the data and I was able to programmatically add a new row if needed by using the command:
myGridView.Rows.Add()
and to read the information in myGridView:
foreach (DataGridViewRow row in myGridView.Rows)
{
if (row.Cells[1].Value != null)
// do something
}
What is the best way to achieve this in Xamarin? I cannot see the exact same equivalent as DataGridView. Thanks for the help.
No, unfortunately there's not such thing in Xamarin.Forms (neither Xamarin.IOS or Xamarin.Android) and the main reason is that the native platforms (iOS and Android) do not have it as a native control.
In Xamarin.Forms there is a Grid control but its use is mainly for layouts and cannot be Databinded like the DataGridView.
The good thing is that you have everything you need to make one for your own. Subclass the Grid, add some binding properties and create custom renderer for each platform you want to support, you might have to do a little more than this but at least this could be a good start.
Note: I did a quick search for an open source project and this one looks very interesting. Take a look it might probably do the job you need.
I recently built my own data grid control for Xamarin Forms since I couldn't find one that met my needs. If you're still looking for a data grid control, I've published mine on Nuget and it is on Github. It's completely free to use. Let me know if it helps you out!
It is called the NoFrillsDataGrid.
Github: https://github.com/davepruitt/NoFrillsDataGrid
Nuget: https://www.nuget.org/packages/NoFrills.Xamarin.Forms/

Display data in a table in Universal App

I have been looking for a couple of days for a UWP control that has similar functionality as the WPF ListView, which allows me to create a table like appearance.
Is there a control like this in the UWP or not?
What I want to achieve is a SCRUM and Kanban overview for Jira Software. Maybe there are better options.
Microsoft has created an add-on control that fits this use case nicely, the DataGrid control from their community toolkit.
More details: https://learn.microsoft.com/en-us/windows/communitytoolkit/controls/datagrid
It supports sorting, filtering, grouping, and can even generate columns automatically from supplied data.
There is a control such as that and it is called listview.
https://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.listview.aspx
Maybe you could use GridView as well, there is a nice short tutorial on:
https://channel9.msdn.com/Series/Windows-10-development-for-absolute-beginners/UWP-040-Data-Binding-to-the-GridView-and-ListView-Controls

Is there another way to show data in DataGridView ?

I dont like the way the data is displayed in DataGridView.
That's how I usually display it :
SqlCmd GetCity = new SqlCmd();
CityDataGridView.DataSource = GetCity.UseSqlCommand("SELECT * FROM City").Tables[0];
SqlCmd is a class that I use to execute Sql queries or to return dataset.
I want the data to be displayed in the datagridview in a more elegant way. How can I do it?
Telerik and DevExpress have nice looking controls, but those are commercial (PAID) products. If you can't afford them, I strongly suggest you look at leaving winforms behind and use current UI technology (WPF).
winforms doesn't support customization, and native winforms controls look like windows 95.
You can get Professional-looking applications in WPF without paying any commercial third-parties. Just google WPF Application (in google images search) and see it for yourself.

Which windows form control is best for presenting data in a tabular fashion?

I need to present the output on the form in rows and columns. Is there a control to make that task easier? I am using visual studio 2010 and coding in C#.
You're looking for DataGridView.
Which looks like so (don't worry, the colors are fully configurable (;):
And has many advances capabilities such as DataBinding and paging.
Here's a tutorial to get you started.
Though you asked about WinForms, if you use WPF, in WFP 4.0 (.NET 4) there's a DataGrid that you can use. It's quite flexible.

alternative to DataGridView in Win API

Somewhere on net on one Blog I read a sentence that is "DataGridView something like Boeing 777, but what is goal when I do not know how to fly.
Before I goo deep in creating my projects I wanna know is there alternative for DataGridView in C#.
Something like jQuery in WEB api.
The favors things which I am looking for is that is simple for using, if its posibile to be freeware and looks smoth and modern.
Best regards
Admir
If you want to fly one person across town you can learn to fly a Piper Cub. If you want to fly hundreds across an ocean you need to learn to fly a 777.
There are many ways of displaying data in WinForms applications; which one is best for you depends on what you're trying to do. If you want to show a fixed, non-editable, non-scrollable list of data you can use a DataList; simple and limited. If you want to add scrolling you can output the data to a scrolling textbox.
If you want to handle a scrolling grid of multiple rows with multiple, resizable, editable columns you will need to move to a DataGrid or DataGridView.
There are many alternatives to DataGridViews; simpler controls provide fewer features and more functional controls are more complex.
I have implemented the datagridview extensively as an unbound control in a windows forms project using Visual Studio 2008. Looking back, implementing this control has consumed a large amount of time, mostly because it is loaded with bugs and peculiar behavior that should have been fixed rather than just 'documented'. A good data grid control is essential to any application of substance. I would recommend looking for a third party alternative from a company that is more interested in getting it right rather than just getting something out there.
The DataGridView is perfectly easy to use without going too deep. If all you want to do is display data in a grid, create a DataGridView and turn off features like adding and editing rows. The fact that it's got all of these incredibly complex features is really only an issue when you start needing to use them - and in that case, you'll be glad you're using it.
DevExpress has a really good gridview.

Categories

Resources