How can I determine the number of rows that can be displayed in an ag-grid grid, prior to filling the data set?
The grid API's getDisplayedRowCount() returns 0 since there are no rows yet.
I would also need to track this information on grid resizes.
Related
I have a following problem: I wand to check the end of a long list (numpy array to be precise) in Variable Explorer in Spyder. But when I change sorting to the decreasing by index I will have only entries from my 1st screen. I have to scroll down to load them and only then I will see them.
For example I have 20,000 rows. If I will change sorting I will see only rows from 63. If I will scroll to the 200 row in normal order and then change it I will see only the rows only from 200.
Is there any way to fix it?
Using this article (https://learn.microsoft.com/en-us/previous-versions/dotnet/articles/aa480727(v=msdn.10)#initialization) and the library included in the demo project I have setup Excel-like autofiltering on a datagridview.
However on columns where there are not many distinct values, only one or two rows are displayed:
In this example, there are actually 3 or 4 values in the filter list that the user could select but only two rows are displayed and the rest you must scroll to find.
I've been unable to find where the height of the list box is set. Any can anyone point out where I can change/set this?
I believe that this may be what you are looking for.
In the documentation is the following paragraph:
The SetDropDownListBoxBounds Method
The SetDropDownListBoxBounds method initializes the size and location of the drop-down list.
The preferred size depends primarily on the dropDownListBox contents, which are the formatted values stored in the Keys collection of the filters dictionary. The SetDropDownListBoxBounds method first calls the Graphics.MeasureString method for each filter value. For each value, the width is stored if it is wider than all previous values, and the height is added to an accumulating total height for all values. The results are then used to determine the preferred size.
The preferred height is the smallest of the following values:
The accumulated height of all filter values.
The user-specified maximum height as calculated from the
DropDownListBoxMaxLines property value.
The available height of the DataGridView control client area.
I am attempting to create a dynamic webmap to display varying values across a grid of polygons. Within each grid cell there are multiple overlapping polygons (grid cells) each with a unique value. I would like aggregate these values to give a total value for each grid cell which relates to the sum of each of the overlapping values. These would then be displayed using a quantitative color gradient.
I would dissolve this layer and sum each overlapping polygon's value and display it as a flat single feature per cell, however I have also added the ability for users to filter specific values out relating to a descriptive attribute within the table.
The approach I have tried was to
Create a flat empty grid with single cells.
Took the centroid of the each overlapping polygon.
This left me with a point layer of overlapping features (value) and a polygon layer of a grid with only an ID code.
Within the WebMap builder I have set the symbology of the grid using the Arcade expression:
var centroid = FeatureSetByName($map,"centroid_values")
IIf(Contains($feature, centroid), Sum(value), 0)
This aims to sum the "value" of the each point contained within the single empty grid cell and display it. This would mean if the user was to filter the points based off an attribute the symbology would be dynamic.
However, I am running into the error:
Parse Error:featuresetbyname is not available
Is it possible to incorporate a separate featureset from the map into the symbology expression for a layer?
The featureset functions appear to be greyed out an labelled 'Not Available' within the function list.
Any other approaches to overcome the problem outlined above would be greatly appreciated. I have experimented with joins however the number of records means it is extremely slow to process and is not dynamic when the user filters out records.
Program http://www.repairstatus.org/program.png
The DataGridView fetches the data from a MySQL server but it does not fill the entire box in size.
Ideally I would like to manually set the table size to fit the box at least width-wise because the rest will fill up once the database is populated more.
Set the property AutoSizeColumnsMode to be Fill. That'll ensure your columns stretch to 100% within your DataGridView. The columns will stretch/shrink when you resize your grid (if your grid is anchored to your form).
Look at the Fill Weights for the Columns.
Specifically, change the AutoSizeMode to Fill.
If trying to expand more than one column, adjust the FillWeight percentage.
I am using a dojox.grid.DataGrid to display data and allow the user to select one or more rows to highlight items to do other actions to.
My problem is that the grid uses indexes to remember the selected rows. If I have turned clientSort on, sorting the rows makes the rows change order but the selection changes to the rows that now occupy the selection indexes before sorting.
To combat this I get the items for the selected rows on each selection change and then when onSort event happens I use getItemIndex(item) on each of the items in my selected items collection to get the new row indexes and I re-select using those indexes.
Now, my problem is that the DataGrid loads data a certain number of rows at a time (it uses the term page to define a set number of rows) to improve performance. When a sort occurs it reloads the data in the new sort order but only up to the rowsPerPage value (defaults at 40). When I try and use getItemIndex for an item whose new row has not been loaded into the grid it returns and index of -1. The getItemIndex() function only returns the index once the user scrolls down and the row is loaded.
I cannot find an event that fires when the page loading occurs to try and restore the selection. I have looked through the 1.3.2 source code and can not find anything. I have tried connecting to a number of private functions but none work.
Has anyone come across this and found a fix?
Thanks in advance.
I found the answer. The dojox.grid.DataGrid has a private event (_onFetchComplete) which fires each time the next page is requesting. I use setTimeout to run my restore function after a duration of 300.
Job done!