hi,
There is no specific reason i moved the binding in to edit. When I have done the binding after the table binding, I had the same result .
Anyway furnishing the code .
Please look in to this and let me know.
XAML File
Code Behind(Vb .net)
Imports System.Data
Imports Telerik.Windows.Controls
Class MainWindow
Private Colours As String()
Public Sub New()
Try
' This call is required by the designer.
InitializeComponent()
Colours = New String(1) {}
Colours(0) = "Yellow"
Colours(1) = "Green"
' Add any initialization after the InitializeComponent() call.
RadGridView1.ItemsSource = BindData()
DirectCast(Me.RadGridView1.Columns("[tType]"), GridViewComboBoxColumn).ItemsSource = Colours
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End Sub
Public Function BindData()
Dim dtTemp_Start As New DataTable
If Not dtTemp_Start.Columns.Count > 0 Then
Dim column As DataColumn = New DataColumn
column.DataType = System.Type.GetType("System.Int32")
With column
.AutoIncrement = True
.AutoIncrementSeed = 1
.ReadOnly = True
.Unique = True
.ColumnName = "Auto_ID"
End With
dtTemp_Start.Columns.Add(column)
dtTemp_Start.Columns.Add("[tType]", GetType(String))
dtTemp_Start.Columns.Add("Expression", GetType(String))
Dim sDataRow As DataRow
sDataRow = dtTemp_Start.NewRow()
sDataRow(1) = "black"
sDataRow(2) = "bbk"
dtTemp_Start.Rows.Add(sDataRow)
' dtTemp.Columns.Add("VarCollection", GetType(ObservableCollection(Of SimulationVariableInfo)))
'dtTemp_Start.Columns.Add("ConditionCollection", GetType(clsCondCollection))
End If
Return dtTemp_Start
End Function
'Private Sub RadGridView1_BeginningEdit(ByVal sender As System.Object, ByVal e As Telerik.Windows.Controls.GridViewBeginningEditRoutedEventArgs) Handles RadGridView1.BeginningEdit
'End Sub
End Class
I moved the ComboBoxColumn binding to Init() after the datatable binding
regards,
Suresh