![]() ![]() |
![]() |
SetDefinition Method |
Syntax |
object.SetDefinition(XMLDefinition As String) |
||||
|
None | ||||
Arguments |
|
Remarks
Typically, you use this method to load condition settings from the hard disk or from the database.
The following example uses the XMLDOMDocument Object to loads the column definition from the file.
Dim xmlDoc As Object
Set xmlDoc = CreateObject("microsoft.xmldom")
xmlDoc.Load sFileName
SGGrid1.Columns(sColKey).SetDefinition xmlDoc.xml
Set xmlDoc = Nothing
The following example loads the style definition using generic LoadDefinition function.
Private Sub SGGrid1_OnInit()
LoadDefinition SGGrid1.Styles("Normal"),"Sty_Normal.xml"
End Sub
Private Sub LoadDefinition( _
oGridObject As Object, sFileName As String)
Dim iFreeFile As Integer
Dim sDefinition As String
sDefinition = String(FileLen(sFileName), " ")
iFreeFile = FreeFile
Open sFileName For _
Binary Access Read As iFreeFile
Get #iFreeFile, , sDefinition
Close #iFreeFile
oGridObject.SetDefinition sDefinition
End Sub
See Also