Hi@All,
with a little library GUI I have the following problem.
I can add entries, I can remove entries, save and load is also available.
Now I get the problem with filtering.
If I open the gui and try to filter it works.
If I press "speichern" (Save) and try to filter after that it doesn't want.
Any idea?
regards
rowfilter doesn't want anymore after saving DGV content to xml
Forum rules
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
rowfilter doesn't want anymore after saving DGV content to xml
- Attachments
-
- BiBo2.zip
- (444.11 KiB) Downloaded 158 times
Re: rowfilter doesn't want anymore after saving DGV content to xml
You are missing pieces:
Directory: C:\ProgramData
Mode LastWriteTime Length Name
---- ------------- ------ ----
d----- 5/1/2016 10:59 AM PHS_Library
keine Library gefunden!
Directory: C:\ProgramData
Mode LastWriteTime Length Name
---- ------------- ------ ----
d----- 5/1/2016 10:59 AM PHS_Library
keine Library gefunden!
Re: rowfilter doesn't want anymore after saving DGV content to xml
It appears to be a bug in the binding between the grid and the table. TO write the XML the table has to alter the default view. After that the grid cannot use it.
Here is a simple workaround.
Just make a copy of the table and write the copy to the file. This way the view that the grid is using is not altered.
We might also be able to create a custom view for the grid and just reset it. That would require much more code.
Here is a simple workaround.
- #
- $table= $datagridviewResults.DataSource.Copy()
- $table.WriteXml("$ProgramXMLPath\Library.xml", [system.data.xmlwritemode]::WriteSchema)
We might also be able to create a custom view for the grid and just reset it. That would require much more code.
Re: rowfilter doesn't want anymore after saving DGV content to xml
The problem also disappears if we switch to using a dataset and a full schema;
This as the load script allows the dataview to work correctly with the grid:
I would also avoid creating the global table. Just use the datasource as it will prevent failures as you progress. If you have issues with intellisense then just cast the datasource to a datatable,
As you progress you can add form bindings and have the text and other controls follow the dataset as well as using relations and lookup tables. This can only be done with tables that are part of a dataset.
This as the load script allows the dataview to work correctly with the grid:
- $MainForm_Load={
- $ds=New-Object System.Data.DataSet
- if (Test-Path "$global:ProgramXMLPath\Library.xml"){
- $ds.ReadXml("$global:ProgramXMLPath\Library.xml")
- }else{
- Write-Host "keine Library gefunden!"
- $ds.ReadXmlSchema('.\Library.xsd')
- }
- $datagridviewResults.DataSource = $ds.Tables[0]
- # it would be best to eliminate this independent variable
- $global:table = $ds.Tables[0]
- }
As you progress you can add form bindings and have the text and other controls follow the dataset as well as using relations and lookup tables. This can only be done with tables that are part of a dataset.
Re: rowfilter doesn't want anymore after saving DGV content to xml
Thanks a lot for the input.
I'll read tomorrow all in detail, 9h on the freeway was more than enough. Time to rest.
I'll read tomorrow all in detail, 9h on the freeway was more than enough. Time to rest.
Re: rowfilter doesn't want anymore after saving DGV content to xml
freeway("autobahn") in germany, but the distance was "just" 400km.
The problem was that some others crashed and the autobahn was blocked for several hours and there was no possiblity to get off. ;(
The problem was that some others crashed and the autobahn was blocked for several hours and there was no possiblity to get off. ;(
Re: rowfilter doesn't want anymore after saving DGV content to xml
If all is fine you can get from Dresden to Munich in 2h30 the 460km, but there are a lot of people outside can't handle their car.jvierra wrote:Great. I thought the autobahn was always fast like in the song;)
The result is a full blockade over 3 lanes and the bigger problem that the rest haven't understood how to build a corridor for emergency vehicle access.
;( ;(