WPF Dynamic display and edit of data - c#

I am new to WPF. I am making an windows app which will scan a QR-code, divide its contents into multiple parts and display them under several columns as below.
e.g. (in the picture attached)
example
When a QR-code is scanned repeatedly, the Qty field is increased by 1 each time.
Can any one help me how to achieve this in my application.
(I have used datagridviews and dynamic labels in winforms, but in WPF the best recommended way?)

First of all, how does the data arrive from your scanner? Is it an array? Or a List?
If it's an array you can easily add a new column to the grid which receives an increment value (f.e. "x++") every repeat of a foreach loop. If you upload a few code snippets I will try to tinker something.

Related

ListView with 6000 rows c#

I am with a little issue on handling with one of my applications.
I have a Vessel's historic which is shown on a ListView, but until now I have never needed to show all the data inside this history (the user was using kind of a filter to get what he needed), but now one of the managers want to see all data through the application (they was receiving the full data through an excel report).
The biggest issue is because its 6000 rows with 21 columns each one and when I try to select all the data it takes something between 5 minutes to fully load, but more than that the user need to add new, edit or copy the history, which brings him to a new update on the list with more 5 minutes to load.
I don't quite know how is the best way to handle with this and I wanted your help!
I would actually split the information into sections. Rather than loading 6,000 rows plus columns all at once, why don't you use something like alphabetize the information? Use a different ListView for A-G, then another ListView for H-O, then so on and so forth. That why it would cut down the time it took to query all of the information.

Create a Gridview with resizable columns like excel

Please take a look at the screenshot below.
I am trying to create the page with a gridview. The number of column are so many. There are two issues that I am facing here.
1 ) I am using Databale js to provide paging, searching and other facilities. As shown in the screenshot due to large number of columns the search box and paging box are not getting applied on proper place.
2 ) If the column is having a large string , Is there any way we can achieve excel like facility. Where default the overflowed text is hidden and when we click on column to re size it can show the whole value. I am using colresizable plugin for re sizable columns but it is not working as expected.
IdeaSparks ASP.NET CoolControls will work for your problem.

How to generate freeform rdlc reports with one page per row

Given a data set containing multiple rows, from within a .NET console application I need to generate a report on a single page for each row, sending those pages directly to the printer.
I am attempting to use Microsoft Report for this by attaching it to a data set and placing TextBoxes where I wish. Generating the report and sending it to the printer are not a problem. Unfortunately, the data only seems to be available in aggregates -- First, Sum, Last, Max, etc. I cannot latch the text box to a bare field.
Some poking around here and other sites seems to address this, but only when the data is presented in a table. One post even said without elaboration, "My mistake was using Text Boxes"
Am I using the wrong tool for what I am attempting to accomplish?
I ran into the same problem and managed to solve it. The solution seems a little convoluted to me so don't quote me on the "right" way to do this, but here is what I did:
Make sure you have a Dataset defined for your report.
Add a "Table" control to the report. This seems to be needed in order to iterate the rows in your Dataset.
Delete the header row and two of the default columns from the table so that you are left with a single row with a single column.
Expand the table to the width of your layout and make it as tall as you will need for your "free form" layout.
By default, there is a TextBox inside the table cell. Right-click the empty table cell and choose "delete" to remove that TextBox.
Drag a "Rectangle" control into the empty table cell. It seems to automatically "dock" to the width/height of the table cell.
Now you should be able to drag the fields from your DataSet (TextBoxes, etc) into the Rectangle to produce the desired layout.
Note that I am in the early stages of using this approach so I'm not sure if I am going to hit any walls... but for a basic report that uses TextBoxes and a page break after each "row" it seems to be working ok.
Or you try to use a list.
In the list you can arange textboxes (and other controls) as you want and they will be filled for each record in the recordset.
This work for me. :-)

Lightswitch XtraReport chart - reducing number of points / accessing dataSource

I have an XtraReport with 6 charts containing 4-8 LineSeries, where each Series can have up to 25,000 Points. The data comes from a query from a database table.
The problem is, that it takes around 3 minutes to draw the report which is too long for us.
So we need to reduce the number of points (which I already did in another case, so I know how to do that).
But where is the "right place" to perform this reducing action? Within the screen where the ReportPreview control is located and passing a new Collection (with all the series) as Parameter to the report? Is it possible to use such an custom Object as Parameter?
Or should I first load the database table inside the report and then reduce it?
How can I access the Datasource within the XtraReport by code?
And how can I tell my chart components to select my Collection as dataSource and not the database query result?
Also any other ways to improve the performance of XtraReports & charts.
Thanks.
EDIT
We created a SQL View which reduced the number of points and also used some code in the Preprocess_query methode with LINQ to use only needed points.

Showing records on grid efficiently

i have a third component grid that i am using on my page.
It displays 20 records in one page.
Also i am using images to display certain columns.
Like comments , attachements have clickable images for every row.
the problem is.. everytime i load my page.. the logic right now is.. it goes in the database.. checks for every row in the table to see if the comments are added or is there attachment.. and accordingly disables or enable the image of that particular record(row)
Now this takes too many database hits and processing time increases.
Can u tell me any other way to do this.?
You could add a column "Number of comments" and "Number of attachments" to your rows.
You should enable some sort of VirtualMode in your grid ( every grid should have this function in some way ) in order to feed just the item the user actually see. This is a good practice always.
Irrespective of grid, you can build some sort of object which collectively holds the textual information that you need to show and some more flags which tell you about the image and attachment. You bind the collection of this custom object to your grid.
Use the flags in this object to put different images in your columns.
HTH

Categories