15 Answers, 1 is accepted
how about the "AutoCompleteMode" property? Or do you need a ComboBox that excepts also new values? Than see my other thread here and solution.
Regards
Holger
--
http://vbwebprofi.de
If I add a GridViewtextBoxColumn or GridViewCalculatorColumn to the gridview then I can write on their cells but if I insert
GridViewComboBoxColumn or GridViewMultiColumnCombo I can't write on their cells!
I want to write because of filtering not add a new value to existing list.
If I use radMultiColumnComboBox out of the radgridview its working good but on GridView not for me!
Many thanks!
Thank you for writing.
In order to be able to type in the GridViewMultiComboBoxColumn editor, you need to set the DropDownStyle of the column to DropDown:
col.DropDownStyle = Telerik.WinControls.RadDropDownStyle.DropDown;
I hope that you find this information useful.
All the best,
Stefan
the Telerik team
it's working now.
I have another request!
Is there possible to filter after writing three letters then show the data?
my scenario:
1) I'm filling with data my GridViewMultiComboBoxColumn from SQL Server Procedure.
2) I don't want to see every records, because its working slow then I want to fill my GridViewMultiComboBoxColumn after I type three letters to the cell.
Attached to my post you can find a sample demonstrating how to achieve the desired functionality. Basically, I am subscribing to the TextChanged event of the editor, and if there are three letters typed in, I am adding the appropriate FilterDescriptor to the underlying grid.
Off topic, I would like to kindly ask you to open a new thread for questions not related to the one discussed in the current forum thread. This will help our community to easily find the desired information.
I hope this helps.
Kind regards,
Stefan
the Telerik team
Thank you for writing.
In order to change the suggestion mechanism to filter the items using "Contains" mode you need to set the DropDownListElement.AutoCompleteSuggest.SuggestMode to SuggestMode.Contains. For this purpose you should subscribe to the CellEditorInitialized event and modify the aforementioned property:
private
void
radGridView1_CellEditorInitialized(
object
sender, GridViewCellEventArgs e)
{
RadDropDownListEditor editor = e.ActiveEditor
as
RadDropDownListEditor;
if
(editor!=
null
)
{
RadDropDownListEditorElement el = editor.EditorElement
as
RadDropDownListEditorElement;
el.AutoCompleteMode = AutoCompleteMode.Suggest;
el.AutoCompleteSuggest.SuggestMode = SuggestMode.Contains;
}
}
I hope this information helps. Should you have further questions, I would be glad to help.
Regards,
Desislava
Telerik
Thank you for writing.
Following the provided brief description, I have tried to reproduce the problem on my end with the latest version but without any success. Please find attached a sample gif file, illustrating the load time in milliseconds for the drop down. It takes less than a second. Here is my sample code snippet:
public
Form1()
{
InitializeComponent();
DataTable dt =
new
DataTable();
dt.Columns.Add(
"Id"
,
typeof
(
int
));
dt.Columns.Add(
"Title"
,
typeof
(
string
));
dt.Columns.Add(
"Type"
,
typeof
(
int
));
Random rand =
new
Random();
for
(
int
i = 0; i < 10; i++)
{
dt.Rows.Add(i,
"Title"
+ i, rand.Next(0, 2000));
}
this
.radGridView1.AutoGenerateColumns =
false
;
GridViewDecimalColumn decimalColumn =
new
GridViewDecimalColumn(
"ID column"
);
decimalColumn.FieldName =
"Id"
;
this
.radGridView1.MasterTemplate.Columns.Add(decimalColumn);
GridViewTextBoxColumn textBoxColumn =
new
GridViewTextBoxColumn(
"Title column"
);
textBoxColumn.FieldName =
"Title"
;
this
.radGridView1.MasterTemplate.Columns.Add(textBoxColumn);
DataTable comboSource =
new
DataTable();
comboSource.Columns.Add(
"Id"
,
typeof
(
int
));
comboSource.Columns.Add(
"Description"
,
typeof
(
string
));
for
(
int
i = 0; i < 2000; i++)
{
comboSource.Rows.Add(i,
"Type"
+ i);
}
GridViewComboBoxColumn comboColumn =
new
GridViewComboBoxColumn(
"Type column"
);
comboColumn.DataSource = comboSource;
comboColumn.ValueMember =
"Id"
;
comboColumn.DisplayMember =
"Description"
;
comboColumn.FieldName =
"Type"
;
this
.radGridView1.Columns.Add(comboColumn);
this
.radGridView1.DataSource = dt;
this
.radGridView1.AutoSizeColumnsMode = Telerik.WinControls.UI.GridViewAutoSizeColumnsMode.Fill;
this
.radGridView1.CellEditorInitialized += radGridView1_CellEditorInitialized;
}
Stopwatch sw;
private
void
radGridView1_CellEditorInitialized(
object
sender, GridViewCellEventArgs e)
{
if
(e.Column.Name ==
"Type"
)
{
RadDropDownListEditor ddl = e.ActiveEditor
as
RadDropDownListEditor;
if
(ddl !=
null
)
{
sw =
new
Stopwatch();
sw.Start();
RadDropDownListEditorElement element = ddl.EditorElement
as
RadDropDownListEditorElement;
element.PopupOpened -= element_PopupOpened;
element.PopupOpened += element_PopupOpened;
}
}
}
private
void
element_PopupOpened(
object
sender, EventArgs e)
{
sw.Stop();
RadMessageBox.Instance.StartPosition = FormStartPosition.CenterScreen;
RadMessageBox.Show(
"Load Time: "
+ sw.ElapsedMilliseconds);
}
Feel free to modify it on a way to reproduce the issue you are facing and get back to me with it so I can investigate the precise case and assist you further. Thank you in advance.
I am looking forward to your reply.
Regards,
Desislava
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.
Hi everyone,
I have a problem with the GridViewComboBoxColumn control.
I added
ddl2.DropDownStyle = RadDropDownStyle.DropDown;
ddl2.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
On Windows 10 the search is fine, but the problem is when the build-to-server version
> Windows server r2 2012 <
search does not work.
Like not to see the code line ddl2.DropDownStyle = RadDropDownStyle.DropDown;
I checked the versions of the references that everything is fine they are the same.
this is solution maybe helps somebody
in event CellEditorInitialized radGridView
//filtering dropdownlist
if (sender is GridViewEditManager)
if (((GridViewEditManager)sender).GridViewElement.CurrentColumn.Name == "Skills" || ((GridViewEditManager)sender).GridViewElement.CurrentColumn.Name == "Next Question")
{
RadDropDownListEditor listEditor = this.radGridAnswer.ActiveEditor as RadDropDownListEditor;
if (listEditor == null)
{
return;
}
RadDropDownListEditorElement editorElementSearch = listEditor.EditorElement as RadDropDownListEditorElement;
editorElementSearch.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
editorElementSearch.DropDownStyle = RadDropDownStyle.DropDown;
}
Thank you for writing.
Both of the approaches (setting the AutoCompleteMode/DropDownStyle property of the GridViewComboBoxColumn or for the RadDropDownListEditorElement in the CellEditorInitialized event) are correct and they are supposed to work as expected. However, it seems that when you specify the properties at column's level it doesn't work for you. That is why I have prepared a sample project for your reference. Feel free to use the approach with handling the CellEditorInitialized event.
However, if you are still experiencing any difficulties with the column's approach it would be greatly appreciated if you can specify the exact steps how to reproduce the problem. Alternatively, feel free to submit a support ticket where you can provide a sample project demonstrating the undesired behavior. Thus, we would be able to investigate the precise case and assist you further. Thank you in advance.
I hope this information helps. Should you have further questions I would be glad to help.
Regards,
Dess
Progress Telerik
Thanks for your helps!
How I can to set the GridViewComboBoxColumn as MyCol.DropDownListElement.AutoCompleteSuggest.SuggestMode = SuggestMode.Contains;
You can use the CellEditorInitialized event to access the editor and set the property:
private
void
RadGridView1_CellEditorInitialized(
object
sender, GridViewCellEventArgs e)
{
var editor = e.ActiveEditor
as
RadDropDownListEditor;
if
(editor !=
null
)
{
var element = editor.EditorElement
as
RadDropDownListEditorElement;
element.AutoCompleteSuggest.SuggestMode = SuggestMode.Contains;
}
}
I hope this will be useful. Let me know if you have additional questions.
Regards,
Dimitar
Progress Telerik