As to DataGrid, no comment.
As to ListView the following :
- you must tell what does (not) happen.
- try to fill the ListView wit a lot of entrys (Rows)
- does it look as if the rows are being filles (Scrollbar) but no Colums
are being shown?
- if yes (BTW no experince in VB, so all code is C#), try to recreate the
ListView complely
//--------------------------------------------------------------------------
---------------------
//-- Save Data created in
VS -------------------------------------------------------------------
//--------------------------------------------------------------------------
---------------------
Rectangle rt = listViewListen.Bounds;
Size sz_Size = listViewListen.Size;
//--------------------------------------------------------------------------
---------------------
// string s_Name = listViewListen.Name;
tabPageListen.Controls.Remove(listViewListen);
progessBarMainFrame.Value = 6;
//--------------------------------------------------------------------------
---------------------
//
// listViewListen
//
listViewListen = new System.Windows.Forms.ListView();
listViewListen.Bounds = rt;
// listViewListen.AllowColumnReorder = true;
// listViewListen.BorderStyle =
System.Windows.Forms.BorderStyle.FixedSingle;
// this.listViewListen.Dock = System.Windows.Forms.DockStyle.Fill;
listViewListen.FullRowSelect = true;
// listViewListen.GridLines = true;
listViewListen.HeaderStyle =
System.Windows.Forms.ColumnHeaderStyle.Clickable;
// listViewListen.MultiSelect = false;
listViewListen.Size = sz_Size;
// listViewListen.TabIndex = 0;
listViewListen.View = System.Windows.Forms.View.Details;
listViewListen.Font = new System.Drawing.Font("Comic Sans MS", 9.75F,
System.Drawing.FontStyle.Bold);
listViewListen.FullRowSelect = true;
listViewListen.SelectedIndexChanged += new
System.EventHandler(this.listView_SelectedIndexChanged);
listViewListen.ColumnClick += new
System.Windows.Forms.ColumnClickEventHandler(this.listView_ColumnClick);
This Method stopped the problens I had when (re)using a ListView to display
a different DataTable/View.
I have the feeling that this is a Framework/Framework.Compact problem with
ListViews and it would interest me to know if the use of this
logic with VB solves the same problem.
In my Database Applications I prefer to read in the whole Dataset with all
Tables.
I then create a DataView with the selected Data I want to show in the
ListView (with sorting) and fill it.
see :
http://www.codeproject.com/useritems/Internationalization.asp for,
among otherthings, C# code how this done.
Hope this helps.
Mark Johnson, Berlin Germany
(e-mail address removed)