Hi to all.
I use Q2 2009 version.
I have this simple table on MS SQL2005:
CREATE TABLE [dbo].[CondizioniPagamento](
[id_CondizionePagamento] [int] IDENTITY(1,1) NOT NULL,
[txt_Codice] [varchar](100) NOT NULL,
[txt_Descrizione] [varchar](100) NOT NULL,
[fl_DfFm] [bit] NOT NULL,
[fl_AnnoCommerciale] [bit] NOT NULL,
[n_DistanzaRata1] [int] NOT NULL,
[n_DistanzaAltreRate] [int] NOT NULL,
CONSTRAINT [PK_CondizionePagamento] PRIMARY KEY CLUSTERED
(
[id_CondizionePagamento] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
with this values:
id_CondizionePagamento xt_Codice txt_Descrizione fl_DfFm fl_AnnoCommerciale n_DistanzaRata1 n_DistanzaAltreRate
1 Cd1 Condizione 1 True True 60 30
2 Cd2 Condizione 2 True False 30 30
If I Use this view for load the RadGridView it's all ok:
SELECT id_CondizionePagamento AS CodiceInterno, txt_Codice AS Codice, txt_Descrizione AS Descrizione, fl_DfFm AS DF,
fl_AnnoCommerciale AS [Anno Commerciale], n_DistanzaRata1 AS [Rata 1], n_DistanzaAltreRate AS [Altre Rate]
FROM dbo.CondizioniPagamento
but if i change [Anno Commerciale] to [Anno Comm.] the colum if always false (not cheked)
SELECT id_CondizionePagamento AS CodiceInterno, txt_Codice AS Codice, txt_Descrizione AS Descrizione, fl_DfFm AS DF,
fl_AnnoCommerciale AS [Anno Comm.], n_DistanzaRata1 AS [Rata 1], n_DistanzaAltreRate AS [Altre Rate]
FROM dbo.CondizioniPagamento
Second problem:
If I change the name of the last field, integer, from [Altre Rate] to [Altre Rate.] (only for example) the colum is always empty
I use this code for to load the radgrid
Private Sub ElencoCarica()
Dim Ds As DataSet = getDataSet()
If Ds Is Nothing Then Return
If Ds.Tables.Count < 1 Then Return
RadGridView1.Enabled = True
RadGridView1.DataSource = Ds.Tables(0)
With RadGridView1
For Each colonna As GridViewDataColumn In .Columns
If colonna.FieldName.ToLower.StartsWith("codiceinterno") Then
colonna.IsVisible = False
End If
If colonna.DataType.Name = "DateTime" Then
colonna.FormatString = "{0:dd/MM/yyyy}"
End If
Next
End With
RadGridView1.Show()
End Sub
Private Function getDataSet() As DataSet
getDataSet = New DataSet
If _Query.Length = 0 Then Exit Function
Try
Dim Comando As New SqlClient.SqlCommand(_Query, _SqlConnection)
Dim Da As New SqlClient.SqlDataAdapter(Comando)
Da.Fill(getDataSet)
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.Critical)
End Try
End Function
Regards
Giovanni
System.InvalidOperationException wurde nicht behandelt.
Message=
"Element already added"
Source=
"Telerik.WinControls"
StackTrace:
bei Telerik.WinControls.RadElementCollection.CheckElementAlreadyAdded(RadElement element)
bei Telerik.WinControls.RadElementCollection.OnInsert(Int32 index, Object value)
bei System.Collections.CollectionBase.System.Collections.IList.Add(Object value)
bei Telerik.WinControls.RadElementCollection.Add(RadElement value)
bei Telerik.WinControls.MeasurementControl.GetDesiredSize(RadElement element, SizeF availableSize)
bei Telerik.WinControls.UI.RadComboBoxElement.GetInitialPopupSize()
bei Telerik.WinControls.UI.PopupEditorBaseElement.ShowPopup()
bei Telerik.WinControls.UI.RadComboBoxElement.OnBubbleEvent(RadElement sender, RoutedEventArgs args)
bei Telerik.WinControls.RadElement.RaiseBubbleEvent(RadElement sender, RoutedEventArgs args)
bei Telerik.WinControls.RadItem.RaiseBubbleEvent(RadElement sender, RoutedEventArgs args)
bei Telerik.WinControls.RadElement.RaiseBubbleEvent(RadElement sender, RoutedEventArgs args)
bei Telerik.WinControls.RadElement.RaiseBubbleEvent(RadElement sender, RoutedEventArgs args)
bei Telerik.WinControls.RadItem.RaiseBubbleEvent(RadElement sender, RoutedEventArgs args)
bei Telerik.WinControls.RadElement.RaiseRoutedEvent(RadElement sender, RoutedEventArgs args)
bei Telerik.WinControls.RadElement.DoMouseDown(MouseEventArgs e)
bei Telerik.WinControls.RadElement.CallDoMouseDown(MouseEventArgs e)
bei Telerik.WinControls.ComponentInputBehavior.OnMouseDown(MouseEventArgs e)
bei Telerik.WinControls.RadControl.OnMouseDown(MouseEventArgs e)
bei System.Windows.Forms.Control.WmMouseDown(Message& m, MouseButtons button, Int32 clicks)
bei System.Windows.Forms.Control.WndProc(Message& m)
bei System.Windows.Forms.ScrollableControl.WndProc(Message& m)
bei Telerik.WinControls.RadControl.WndProc(Message& m)
bei System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
bei System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
bei System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
bei System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
bei System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
bei System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
bei System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
bei System.Windows.Forms.Application.Run(Form mainForm)
bei GUI1.Program.Main()
in C:\Projekte\Test\3TierArchitectur2\GUI1\Program.cs:Zeile 18.
bei System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
bei System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)
bei System.Runtime.Hosting.ManifestRunner.Run(Boolean checkAptModel)
bei System.Runtime.Hosting.ManifestRunner.ExecuteAsAssembly()
bei System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext, String[] activationCustomData)
bei System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext)
bei System.Activator.CreateInstance(ActivationContext activationContext)
bei Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssemblyDebugInZone()
bei System.Threading.ThreadHelper.ThreadStart_Context(Object state)
bei System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
bei System.Threading.ThreadHelper.ThreadStart()
InnerException: