I’m re-implementing part of a UI (mentioned in some other recent questions). Formerly, this system generated a complete JQuery application which was then inserted into a VWG HtmlBox. I don’t want to replicate that behavior for reasons discussed in other posts/questions.
Instead, I’ve implemented a (more) proper back-end service that returns all of the data for this page as a typed DataSet – I chose DataSet because it has a decent designer and it supports full data binding with things like DataGridView out of the box. I could change to another representation if it’s helpful to do so – no biggie.
So here’s the question: Do you have any guidelines or examples of how to use DataGridView (or another WiseJ component) to get HTML <table>-like behavior?
This portion of the UI is read only – I do need to have buttons or button-like behaviors in some of the grids, but no editing, adding, deleting of rows. It’s a report, not an editor. One thought is to implement it AS a report, using the Microsoft ReportViewer control to host, but I’m not crazy about that idea because of the horrible performance of ReportViewer.
Thoughts?
Thanks Julie & Frank.
I’m experimenting with getting all of the DGVs to behave properly now. I’m finding it very difficult to get this to work. (Visual Studio 17.10.4, WiseJ designer 3.5.10, WiseJ runtime).
I’ll give all the links the Julie supplied a read… I’m VERY familiar with Windows Forms, so all of these concepts are well known to me. Even in Windows Forms, the interactions between Dock and AutoSize are not always well behaved – years of building UIs has taught me what works in WinForms – I’m trying to make that knowledge work with WiseJ!
Frank beat me to it, but I’ll go ahead and post my answer as well:
If you haven’t already, make sure to look at the documentation for DataGridView:
https://docs.wisej.com/docs/controls/lists/datagridview
https://docs.wisej.com/api/wisej.web/lists-and-grids/datagridview
Automatic sizing to the content (no scroll bars)
https://docs.wisej.com/docs/controls/lists/datagridview#autosizing
https://docs.wisej.com/api/wisej.web/lists-and-grids/datagridview#scrollbars
https://docs.wisej.com/api/wisej.web/enumerations/wisej.web.scrollbars
Flow layout for the whole page
You will find the documentation on layouts to be helpful: https://docs.wisej.com/docs/concepts/layouts Note that this applies to all Wisej controls, not just datagridview.
If you want the datagridview to fill the whole page, set Dock to Fill. This can either be done in the designer or via code:
dataGridView1.Dock = Wisej.Web.DockStyle.Fill;
If you have other controls on the page, consider placing the datagridview and the controls inside a FlexLayoutPanel or FlowLayoutPanel.
Read-only
You can set the DataGridView to be read-only either in the designer (set the ReadOnly property of the datagridview) or via code:
dataGridView1.ReadOnly = true;
If you do decide to go the ReportViewer route, I would recommend generating the report and then using the Wisej PDFViewer to display it. https://docs.wisej.com/docs/controls/content/pdfviewer
-Julie
Hi Carl,
all of this can be done with Wisej.NET and its DataGridView.
Use AutoSizing by mode:
https://docs.wisej.com/docs/controls/lists/datagridview#autosizing
Or use the AutoResize* functions and fine tune with Fill Width and MinSize/MaxSize
For Flowlayout you can use Docking.
ReadOnly is simply a property.
Best regards
Frank
Please login first to submit.