One of my developers is trying to use an autocomplete column inside a Radgrid. We configured a dropdown column which uses a "select distinct" statement to get the unique existing values in the field, and then used that as source for the dropdowncolumn. Here's the column.
<telerik:GridDropDownColumn DataField="MadeBy" HeaderText="MadeBy"
SortExpression="MadeBy" UniqueName="MadeBy" DataSourceID="dsMadeBy" ListTextField="MadeBy" ListValueField="MadeBy">
</telerik:GridDropDownColumn>
In code-behind, we've set up the AllowCustomText and MarkFirstMatch properties as follows;
Protected Sub RadGridItems_ItemDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles RadGridItems.ItemDataBound
' try and set the allowcustomtext property on the dropdown
If TypeOf (e.Item) Is GridEditableItem And e.Item.IsInEditMode Then
Dim edititem As GridEditableItem = e.Item
Dim combo As RadComboBox = edititem("MadeBy").Controls(0)
combo.AllowCustomText = True
combo.MarkFirstMatch = True
End If
End Sub
This seems to work, and we are able to enter new text, but nothing is saved and the Update section remains on the screen. Are we missing something?
<telerik:GridDropDownColumn DataField="MadeBy" HeaderText="MadeBy"
SortExpression="MadeBy" UniqueName="MadeBy" DataSourceID="dsMadeBy" ListTextField="MadeBy" ListValueField="MadeBy">
</telerik:GridDropDownColumn>
In code-behind, we've set up the AllowCustomText and MarkFirstMatch properties as follows;
Protected Sub RadGridItems_ItemDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles RadGridItems.ItemDataBound
' try and set the allowcustomtext property on the dropdown
If TypeOf (e.Item) Is GridEditableItem And e.Item.IsInEditMode Then
Dim edititem As GridEditableItem = e.Item
Dim combo As RadComboBox = edititem("MadeBy").Controls(0)
combo.AllowCustomText = True
combo.MarkFirstMatch = True
End If
End Sub
This seems to work, and we are able to enter new text, but nothing is saved and the Update section remains on the screen. Are we missing something?