How would I create a table control similar to the one shown? - c#

I've got a table from an existing LabView VI (ewww!) that I need to replicate in C#. The table is shown in the image below. Each field will be populated with data returned by status queries to an external device, likely from within a dedicated status thread (when I implement it...). Is there any control, or direction I should take when extending an existing control for the table-like display of my query results? DataGridView seems like overkill for this, but the table layout container populated with TextBox controls seems inelegant. I'd like some insight, if anyone can offer it. Also, please feel free to shut me down if this has been asked already (though my search turned up nothing I could relate to...). Thanks.

DataGridView is the only suitable control here. Anything else either doesn't have enough grid editing capabilities (like ListView) or is fugly-slow like individual controls in a TLP.

Related

DataGrid in asp.net using c#

My question might be little strange but I am new to web - based programming. In windows based application, if I need to let the user to edit and view the table then I am using the datagrid. In web - based, there is GridView but it is read only tool. I want to see if there is any tool like this in asp.net. Can you please help?
Thanks
Have a look on the ListView control, basically, It lets you specify methods to show, update, edit and delete records from your datasource.
There are a lot of examples for it. Here's a nice article
If you want your end users to have a little bit better experience then you should consider the alternative to use a javascript based grid, which is a more modern way to build a grid. Then everything executes smoothly in the web browser without the need to post back and reload the page, and the server will only be called when it's really necessary (loading data, saving data) but not when you change a row when it´s being edited, or if you do incremental searches.
My favorite is the Slickgrid. And here is a cool Slickgrid example with Async post rendering.
If you choose the server control way (ListView etc) you will have a lot of postbacks every time you sort, change editing mode in cell or edit data.
Look at this question if you want some more examples of javascript grids.

Displaying Tabular Data In A WinForm?

I started with using a TableLayoutPanel, but when I have big tables, they are extremely sluggish. I'm looking for the responsiveness of an HTML table to display my data in.
The only solution I currently have is to have my WinForm write and HTML table, and display it in an embedded browser. This obviously is a huge workaround, and I'd rather implement a more clean and straightforward solution.
If you have any suggestions, please fire away. (a ListView will not work for what I'm trying to do)
What about using a DataGridView, or if you have DevExpress, a XtraGridControl? TableLayoutPanel is designed for laying out controls as far as I know, not for presenting data.
On the other hand, if your data set grows as large that your tables become sluggish, you might want to narrow down your data, e.g. by filtering or by introducing paging, one page only displaying 50 items or so.
Paging as well as filtering, in turn, is supported at least by XtraGrid, not sure about Microsoft's DataGridView.
You definitely need either a grid or a report, depends on what you want.
Highly customizable grid controls (like Infragistics or DevExpress) allow you to make almost any appearance you need. Users will have no idea they look at grid control.

WPF and databinding in a multi threaded ADO.NET app

I need advice and clarification please. I'm currently working on a monitor app that needs to show the contents of a database in a datagrid (I'm using the WPFToolkit grid btw). The grid binds to a table in my ADO.NET DataSet and it works fine. If I modify the DataSet through a button in my UI the grid updates and everyone is happy (binding and ADO.NET is nicely described in this blog). However, the database will be updates by other applications and the monitor app needs to display those changes automatically. The DataSet is updated through polling the database (for various reasons listening to post_events from the DB is not applicable) but the changes are not displayed in the grid.
As far as I have understood this is a feature of WPF databinding. You cannot update the source from another thread than the UI's. In my mind this is insane. There must be thousands of apps out there where data is entered from another user or application. I have tried using the Dispatcher to move the actual updating of the source to the UI thread but I still get the same error.
So now to my question: Is my analysis correct and if so can you offer any advice on how to solve the problem? Also if my analysis is correct can someone please try to explain why WPF works like that?
Thank you for your time
Probably! not the solution to your problem but have a look here http://weblogs.asp.net/cschittko/archive/2008/05/14/wpf-ui-update-from-background-threads.aspx, it might give you some more avenues to look at.
Another link is here wpf: update multiple controls via dispatcher
HTH
After doing even more research I have found my analysis to be correct. While I haven't figured out a way to make it work within ADO.NET I did find a good solution here that uses a simple derivate of ObservableCollection.
Using the RowChanged event from the DataTable I keep track of a BindableCollection view of the table and use that as my DataContext. Works like a charm.

Advanced GUI and database in c#

Do you have any idea how to present all rows from let's say table with the possibility to click on particular row and open that way another window to edit?
I've got no idea how to create this. I would like to avoid access like creation by built-in wizards in Microsoft Visual Studio 2008.
Perhaps you know where I can find more information.
Execute a query which retrieves an overview of the records that you want to display.
When you double-click a row, you retrieve the records that represent that entity, and display it in another window...
That's in a nutshell how you could do it.
For a web application you may want to look at this Walkthrough as MSDN. You can find a winform walkthrough at MSDN as well. Though you say that you prefer doing it without the designers, I suggest that you go through the walkthrough using the designer and look at the code that it produces as a sample of how you could do it by hand. You could then adapt the example as needed for your purposes. For more references try googling "master detail view."
well i would use wpf with a stackpanel of listboxes
the rows are dynamically added to the stackpanel.
the listboxes contain textfields that are databind -ed to mouseclickevents and onchanged events.
http://dotnetslackers.com/articles/silverlight/WPFTutorial.aspx

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