Hi, I have 2 questions and a possible bug report:
Thank you,
Adrian
See attached project and videos:
https://drive.google.com/file/d/1gHxFswrZqYw4aedGuEx0ktWsq3WfTbE0/view
https://www.screencast.com/t/BYwgZ2JM
And forgot to add then when using a DataTable you can use the built in RowFilter property and don’t have to search all rows in your code. In this case the sorting doesn’t need any patch since the data source manages the hidden rows. Try this:
string what2search = "%email%"; var dataTable = (DataTable)this.dg.DataSource; dataTable.DefaultView.RowFilter = $"NUME LIKE '{what2search}' OR VALOARE LIKE '{what2search}' OR DESCRIERE LIKE '{what2search}'";
As a reference also look at:
The sorting bug is a bit different than what I thought. When the sorting is done by the data source the visible state is reset because the rows are not managed by the DataGridView. You can try the same in the DataGridView in WinForms. Cannot do it in WPF since the DataGrid doesn’t support hidden rows.
This is a workaround until the next build where Wisej.Web.DataGridView will refresh all the rows and the sorting is done by the data source.
private void dg_Sorted(object sender, EventArgs e) { Application.Post(() => { this.dg.Refresh(); }); }
It’s not necessary when the rows than change position are less then 16 which is an internal threshold that optimizes the grid updates by only changing the affected cells or rows instead of reloading the current page.
Regarding ClientProfiles.json, I tried to use this one:
{
“profiles”: [
{
“name”: “Test”,
“maxWidth”: 2025
}
]
}
I set 2025 to be sure it’s more than my fhd display on pc. I modified the size and position of 1 textbox and 1 button on designer (default profile and Test profile). On runtime it display the default size/positions.
The ClientProfiles.json is copied on bin directory.
What am I doing wrong?
PS I’m using 2.2.14 version.
Hi Luca,
Here you have a project to reproduce the sorting problem.
Thank you for helping,
Adrian
Cannot reproduce the hidden rows issue.
Tried this with 2.2.14. Sorting with the hidden rows preserves the correct hidden rows and when making them visible again they are in the correct sorted position.
var bs = new List<Person>(); this.dataGridView1.Columns.Clear(); this.dataGridView1.AutoGenerateColumns = true; bs.AddRange(new Person[] { new Person{Name="A"}, new Person{Name="B"}, new Person{Name="C"}, new Person{Name="D"}, new Person{Name="E"}, new Person{Name="F"}, new Person{Name="G"}, new Person{Name="H"}, new Person{Name="I"}, new Person{Name="J"}, new Person{Name="K"}, new Person{Name="L"}, }); this.dataGridView1.DataSource = bs; this.dataGridView1.Rows[1].Visible = false; this.dataGridView1.Rows[3].Visible = false;
Responsive profile are configurable in the ClientProfiles.js file. Click Add -> New Item -> Wisej 2 and pick Client Profiles. It will add ClientProfiles.js to the project with the default entries. You can delete, add, change them.
The SessionTimeout set in Default.json is the timeout until the SessionTimeout event is fired (https://wisej.com/docs/2.2/html/Configuration.htm) which gives your app a chance to inform the user (built-in) or do anything else by handling the SessionTimeout event. By default the session is destroyed timeout * 2 when the tab is closed. If the user is starting at the browser the session will stay alive. Switching tabs in a browser doesn’t make the session invalid.
You can change the behavior however you need it by handling Application.SessionTimeout and/or Application.BrowserTabActivated and BrowserTabDeactivated events.
The DGV sorting problem does indeed looks like a regression since 2.2 implemented virtual rows.
Please login first to submit.