or
Else ' -- Not Keys.Control, .Shift or .Alt |
Select Case keys.KeyCode |
Case Windows.Forms.Keys.Left |
If Not .MasterGridViewTemplate.AllowEditRow Then |
' -- If Only One Row Selected |
If .SelectedRows.Count = 1 Then |
' -- If Selected Row is Expanded |
If .SelectedRows(0).IsExpanded Then |
.SelectedRows(0).IsExpanded = False |
Return True |
Else |
Dim oParentRow As GridViewDataRowInfo = .CurrentRow.ViewInfo.ParentRow |
If oParentRow IsNot Nothing Then |
.CurrentRow = oParentRow |
'oParentRow.IsExpanded = False |
.SelectedRows(0) = .CurrentRow |
.SelectedRows(0).IsCurrent = True |
.SelectedRows(0).InvalidateRow() |
.CurrentRow.InvalidateRow() |
.CurrentRow.EnsureVisible() |
.SelectedRows(0).EnsureVisible() |
End If |
Return True |
End If ' -- Else Not (Selected Row is Expanded) |
End If ' -- Only One Row Selected |
' -- Don't allow Column selection on Master Template |
Return True |
End If ' -- Not AllowEditRow |
' -- End Case Windows.Forms.Keys.Left |
Case Windows.Forms.Keys.Right |
If Not .MasterGridViewTemplate.AllowEditRow Then |
If .SelectedRows.Count = 1 Then |
.SelectedRows(0).IsExpanded = True |
End If |
Return True |
End If ' -- Not AllowEditRow |
' -- End Case Windows.Forms.Keys.Left |
End Select ' -- keys.KeyCode |
End If ' -- Else Not Keys.Control, .Shift or .Alt |
Public Sub CargarMarcas(ByRef cmbMarcas As Telerik.WinControls.UI.RadComboBox) |
Using ta As New ArqBD.dsERPConfigTableAdapters.MARCASTableAdapter |
Using dt As New ArqBD.dsERPConfig.MARCASDataTable |
ta.Fill(dt) |
cmbMarcas.DisplayMember = "Nombre" |
cmbMarcas.ValueMember = "Identificador" |
cmbMarcas.DataSource = dt |
End Using |
End Using |
End Sub |
Note: I've tried the same code in form's load event and in a separate public module (as the sample), and in both cases it doesn't work. Is there something I'm missing? Thank you in advance
Public Class RadForm1 |
Private m_cmbCurLanguage As Boolean = False |
Private Sub RadForm1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load |
AssignCurLanguage(0) |
m_cmbCurLanguage = True |
End Sub |
Private Sub AssignCurLanguage(ByVal lng As Integer) |
Dim lng1 As String = "", lng2 As String = "", lng3 As String = "" |
Select Case lng |
Case 0 |
lng1 = "Eng1" : lng2 = "Ger1" : lng3 = "Fra1" |
Case 1 |
lng1 = "Eng2" : lng2 = "Ger2" : lng3 = "Fra2" |
Case 2 |
lng1 = "Eng3" : lng2 = "Ger3" : lng3 = "Fra3" |
End Select |
m_cmbCurLanguage = False |
cmbCurLanguage.Items.Clear() |
cmbCurLanguage.Items.Add(New Telerik.WinControls.UI.RadComboBoxItem(lng1, 0)) |
cmbCurLanguage.Items.Add(New Telerik.WinControls.UI.RadComboBoxItem(lng2, 1)) |
cmbCurLanguage.Items.Add(New Telerik.WinControls.UI.RadComboBoxItem(lng3, 2)) |
cmbCurLanguage.SelectedIndex = lng |
End Sub |
Private Sub cmbCurLanguage_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmbCurLanguage.SelectedIndexChanged |
If m_cmbCurLanguage Then |
AssignCurLanguage(cmbCurLanguage.SelectedIndex) |
m_cmbCurLanguage = True |
End If |
End Sub |
Private Sub RadButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadButton1.Click |
AssignCurLanguage(1) |
m_cmbCurLanguage = True |
End Sub |
End Class |
Hi