Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Easy mmUltraGrid Question
Message
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Environment versions
Environment:
VB.NET 1.1
OS:
Windows XP SP2
Database:
MS SQL Server
Miscellaneous
Thread ID:
00994520
Message ID:
00994558
Views:
15
OK...I now have the Dataset added the form and mmUltraGrid now sees it in the Data Scheme. The column headers reflect the field names.

But, the grid does not retrieve any data.

I am thinking that the problem is where I am putting Override Function CreateDataSet(). The help file never really says where to put it.

My business object is as follows:

Imports System.Data
Imports OakLeaf.MM.Main.Business
Public Class FobTableAll
Inherits ABusinessObject
Protected Overrides Function CreateDataSet() As OakLeaf.MM.Main.Data.mmDataSet
Return New FobTableDataset
End Function
Public Sub New()
Me.TableName = "FobTable"
Me.PrimaryKey = "fob_pk"
End Sub
Public Function GetFOBTableAll(ByVal compno As String) As DataSet
Return Me.GetDataSet("SELECT FobTable.fob_pk,FobTable.fob_codeck,FobTable.fob_descrip FROM FobTable WHERE compno = @compno", Me.CreateParameter("@compno", compno))
End Function
End Class


My form code is as follows:
Public Class FobTableForm
Inherits OakLeaf.MM.Main.Windows.Forms.mmBusinessForm
Private oFobTableAll As FobTableAll
Private dsFobTableAll As FobTableDataset

#Region " Windows Form Designer generated code "

Public Sub New()
MyBase.New()
Me.oFobTableAll = CType(Me.RegisterPrimaryBizObj(New FobTableAll), FobTableAll)

'This call is required by the Windows Form Designer.
InitializeComponent()

'Add any initialization after the InitializeComponent() call

'Me.dsFobTableAll = Me.oFobTableAll.GetFOBTableAll("01")
Me.oFobTableAll.GetFOBTableAll("01")


The line above the last line (Me.dsFobTableAll...) also does not make it work.

Any ideas?




>Thanks...I'll work through it using your excellant answer!!
>
>Rick
>
>>The problem is that the Infragistics Grid needs a schema.
>>If it does not receive one, it will show all of the properties of the business object.
>>I worked around this with two different MM.NET approaches:
>>
>>Approach One - Manually Define Schema and Use Grid Properties to Hide columns (takes a lot of effort):
>>1. In the Infragistics Control manually type ALL the fields from the business object (exactly as they appear in the BO) into the UltraWinGridDesigner Basic Settings - Data Schema - Manually Define a Schema section.
>>2. Change both hidden and header.caption properties as desired in the UltraWinGridDesigner Band and Column Settings - Band 0 (or appropriate Band #) - Columns ColumnName - Hidden property (False to True) and Header.Caption property to read as the column heading needs to be displayed.
>>
>>Approach Two - Trick the Grid using MM.NET Business Object AND defining a Typed Dataset that is then referenced in your form code so the Grid can import the schema information
>>1. Review the MM.NET Dev Guide for how to configure your Business Objects to create typed datasets rather than their default behavior and change your BO as required.
>>2. In the form code, create a reference to this typed dataset
>>
>>Public Class VisitorTypeForm
>>    Inherits OakLeaf.MM.Main.Windows.Forms.mmBusinessForm
>>
>>    ' Declare class variables to use for busness objects and datasets
>>    Private oVisitorType As VisitorType
>>    Private dsVisitorType As VisitorTypeDataset
>>
>>#Region " Windows Form Designer generated code "
>>
>>    Public Sub New()
>>        MyBase.New()
>>
>>        'Instantiate and register business objects with the form
>>        Me.oVisitorType = CType(Me.RegisterPrimaryBizObj(New VisitorType), VisitorType)
>>
>>        'This call is required by the Windows Form Designer.
>>        InitializeComponent()
>>
>>        'Add any initialization after the InitializeComponent() call
>>
>>        ' Retrieve all Visitor Types
>>        Me.oVisitorType.GetAllVisitorTypes()
>>
>>3. Add a dataset to the form by dragging from the toolbox data tab
>>4. In the dialog Add Dataset - select typed dataset and in the name combobox select Referenced datasets and then select the dataset name from the listing
>>5. Drop the mmUltraWinGrid on the form
>>6. For the Data Schema select Manually design the data schema on the fly...
>>7. On the Edit Schema dialog select the Initialize the Schema from a Data Source option
>>8. In Data Source combobox select the dataset added to the win form designer
>>9. Complete the desired other grid properties
>>10. Make sure the Grid's Binding Source is set in code or in the properties to the MM.NET business object in which you just selected for the schema
>>11. Change both hidden and header.caption properties as desired in the UltraWinGridDesigner Band and Column Settings - Band 0 (or appropriate Band #) - Columns ColumnName - Hidden property (False to True) and Header.Caption property to read as the column heading needs to be displayed.
>>
>>I bumped around alot getting this to work... hope this helps!
Richard DeZeeuw
DeZeeuw Software Inc.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform