DataGridView not displaying data.
Posted: Thu May 18, 2023 4:25 am
I’m familiarizing myself with XSharp data binding.
I have a form with a DataGrid View (dataGridView1), a navigator control (bindingNavigator1), a Binding source (bindingSource1) and a binding navigator control (bindingNavigator1).
I based this on “How To Add An Icon To Your C# Application | Visual Studio 2019” (https://www.youtube.com/watch?v=0OSUwe2LdqU) at around 44:00 on the XSharp Youtube channel.
My project’s dialect is set to Harbour, my additional references are XSharp.core, XSharp.RT and XSharp.Data.
Problem: the MessageBox indicates the correct number of records in the BFCL table, but the Data Grid View remains a grey box – no columns, no data,
My code:
Where am I going wrong?
Thanks,
Roland
I have a form with a DataGrid View (dataGridView1), a navigator control (bindingNavigator1), a Binding source (bindingSource1) and a binding navigator control (bindingNavigator1).
I based this on “How To Add An Icon To Your C# Application | Visual Studio 2019” (https://www.youtube.com/watch?v=0OSUwe2LdqU) at around 44:00 on the XSharp Youtube channel.
My project’s dialect is set to Harbour, my additional references are XSharp.core, XSharp.RT and XSharp.Data.
Problem: the MessageBox indicates the correct number of records in the BFCL table, but the Data Grid View remains a grey box – no columns, no data,
My code:
Code: Select all
USING System
USING System.Collections.Generic
USING System.ComponentModel
USING System.Data
USING System.Drawing
USING System.Linq
USING System.Text
USING System.Threading.Tasks
USING System.Windows.Forms
BEGIN NAMESPACE DBF_Test1
PUBLIC PARTIAL CLASS Form1 ;
INHERIT System.Windows.Forms.Form
PUBLIC CONSTRUCTOR() STRICT//Form1
InitializeComponent()
SET DEFAULT TO "E:AppsHarborClipperTargetDataTestsOSS"
USE BFMB
MessageBox.Show("Rec's " + str(BFMB->(reccount())))
VAR oDataSource := DbDataSource()
SELF:bindingSource1:DataSource := oDataSource
RETURN
END CONSTRUCTOR
END CLASS
END NAMESPACE
Thanks,
Roland