I am using the windows gridview control.Actualy i want to take a textbox events from gridview textbox column.I was used one example from telerik help like below for combobox.
Dim colName As String = radGvItemDetail.MasterGridViewTemplate.CurrentColumn.UniqueName
If colName = "ItemName" Then
Dim ComboEditor As New RadComboBoxEditor()
Dim ddlItemName As RadComboBox = TryCast(ComboEditor.HostedControl, RadComboBox)
ddlItemName.BindingContext = radGvItemDetail.BindingContext
Dim cell As GridComboBoxCellElement = TryCast(radGvItemDetail.CurrentCell, GridComboBoxCellElement)
ItemDs = DDLPopulate("SELECT ItemIntCode,ItemName FROM TB_Item_Master ORDER BY ItemName", "ItemName")
ddlItemName.DisplayMember = "ItemName"
ddlItemName.ValueMember = "ItemName"
ddlItemName.MaxDropDownItems = 8
' Use the RadComboBox data vitualization
ddlItemName.IntegralHeight = True
ddlItemName.BeginUpdate()
Dim comboitem As New RadComboBoxItem()
comboitem.Value = 0
comboitem.Text = ""
ddlItemName.Items.Add(comboitem)
ddlItemName.DataSource = ItemDs.Tables(0).DefaultView
ddlItemName.EndUpdate()
e.Editor = ComboEditor
If ddlItemName IsNot Nothing Then
AddHandler DirectCast(ComboEditor.HostedControl, RadComboBox).SelectedValueChanged, AddressOf ItemNameComboChange
End If
End If
By same like that what is the equalant code for gridviewtexbox column.
I was used below method but its not working.
Dim TextEditor1 As New RadTextBoxEditor
Dim txtItemName1 As RadTextBox = TryCast(TextEditor1.HostedControl, RadTextBox)
Regards,
Sakthi
We are trying to get the Keyascii of Enter Key in RadTextBoxEditor. But we can't able to get that. See the Sample code below.
Private Sub radGvItemDetail_EditorRequired(ByVal sender As Object, ByVal e As Telerik.WinControls.UI.EditorRequiredEventArgs) Handles radGvItemDetail.EditorRequired
If colName = "txtItemName" Then
Dim txtItemNameEditor As New RadTextBoxEditor
e.Editor = txtItemNameEditor
If txtItemNameEditor IsNot Nothing Then
AddHandler txtItemNameEditor.KeyPress, AddressOf ItemNameKeyPress
End If
End If
End Sub
Private Sub ItemNameKeyPress(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyPressEventArgs)
If Asc(e.KeyChar) = Keys.Enter Then
.
.
.
End If
End Sub
Because we want to add a new row, by "Enter" Keypress in GridViewTextBoxColumn
Regards,
Sakthivel