Victor,
We have a major issue with the Flygrid 1.2. We have tried our code using Flygrid 1.0 to try and reproduce the bug, but it works just fine. Therefore we are assuming the issue comes from the new Flygrid. Here is some code where the issue occurs:
'FillBottomGrids is called once and then dgParams.Rows.Items.Count is 2.
'But if we call it a second time then dgParams.Rows.Items.Count is 0. Using Flygrid 1.0, dgParams.Rows.Items.Count is 'always 2 which is correct, as m_dsParams.Tables(0).Rows.Count is 2.
FillBottomGrids(dt)
'CODE FOR FillBottomGrids and related functions :
Public Sub FillBottomGrids(ByVal dt As DataTable)
'm_dsParams is always the same (flygrid 1.0 or flygrid 1.2)
m_dsParams = m_fields.GetParamFields(CInt(dt.Rows(m_SelectedControl).Item("FieldID")))
PrepareParamsColumns()
dgParams.Rows.DataMember = m_dsParams.Tables(0).TableName
dgParams.Rows.DataSource = m_dsParams
End Sub
Private Sub PrepareParamsColumns()
Dim tableloop As Integer
Dim dtEmp As DataTable
dtEmp = m_fields.GetEmptyTable
dgParams.BeginInit()
dgParams.Columns.Items.Clear()
m_ControlField = New LookupListColumn("Control", "ControlField")
m_ControlField.FitMode = ColumnFitMode.SmartFit
m_ControlField.DropDownStyle = DropDownStyle.DropDownList
m_ControlField.LookupSource = dtEmp
m_ControlField.LookupDataMember = dtEmp.TableName
m_ControlField.LookupBoundField = "Id"
m_ControlField.LookupDisplayField = "New"
dgParams.Columns.Items.Add(m_ControlField)
Dim SourceOtherID As New LookupListColumn("Other Source", "SourceOtherID")
SourceOtherID.FitMode = ColumnFitMode.SmartFit
SourceOtherID.DropDownStyle = DropDownStyle.DropDownList
SourceOtherID.LookupSource = m_dsParams
SourceOtherID.LookupDataMember = m_dsParams.Tables(3).TableName
SourceOtherID.LookupBoundField = "SourceOtherID"
SourceOtherID.LookupDisplayField = "ParamSource"
dgParams.Columns.Items.Add(SourceOtherID)
Dim ParamFieldType As New LookupListColumn("Field Type", "ViewFieldTypeID")
ParamFieldType.FitMode = ColumnFitMode.SmartFit
ParamFieldType.DropDownStyle = DropDownStyle.DropDownList
ParamFieldType.LookupSource = m_dsParams
ParamFieldType.LookupDataMember = m_dsParams.Tables(1).TableName
ParamFieldType.LookupBoundField = "FieldTypeID"
ParamFieldType.LookupDisplayField = "FieldType"
ParamFieldType.ReadOnly = True
dgParams.Columns.Items.Add(ParamFieldType)
m_ViewTableParam = New LookupListColumn("Table", "ViewTable")
m_ViewTableParam.FitMode = ColumnFitMode.SmartFit
m_ViewTableParam.DropDownStyle = DropDownStyle.DropDownList
m_ViewTableParam.SortOrder = SortOrder.None
m_ViewTableParam.LookupDataMember = m_dtRelations.TableName()
m_ViewTableParam.LookupBoundField = "table_name"
m_ViewTableParam.LookupDisplayField = "table_name"
dgParams.Columns.Items.Add(m_ViewTableParam)
m_ViewFieldParam = New LookupListColumn("Field", "ViewField")
m_ViewFieldParam.FitMode = ColumnFitMode.SmartFit
m_ViewFieldParam.DropDownStyle = DropDownStyle.DropDownList
m_ViewFieldParam.LookupSource = dtEmp
m_ViewFieldParam.LookupDataMember = dtEmp.TableName
m_ViewFieldParam.LookupBoundField = "New"
m_ViewFieldParam.LookupDisplayField = "New"
dgParams.Columns.Items.Add(m_ViewFieldParam)
Dim OperatorID As New LookupListColumn("Operator", "OperatorID")
OperatorID.FitMode = ColumnFitMode.SmartFit
OperatorID.DropDownStyle = DropDownStyle.DropDownList
OperatorID.LookupSource = m_dsParams
OperatorID.LookupDataMember = m_dsParams.Tables(2).TableName
OperatorID.LookupBoundField = "ParamOperatorID"
OperatorID.LookupDisplayField = "ParamOperator"
dgParams.Columns.Items.Add(OperatorID)
Dim OperatorNotCol As New BooleanColumn("Not Operator", "OperatorNot")
OperatorNotCol.FitMode = ColumnFitMode.SmartFit
dgParams.Columns.Items.Add(OperatorNotCol)
dgParams.EndInit()
End Sub
Could you help us fixing this bug?
Kind Regards,