>> KeyUp of the TextBox would be a good candidate.
>> -- Peter
[quoted text clipped - 5 lines]
>
> Chris.
> Yes, there is. It is outlined brilliantly in Brian Noyes' DataBinding
> book. Let me know if you want more info, and I'll dig it up and post the
> code example. (Awesome book, by the way, worth the $ for the datagridview
> stuff alone.)
RobinS,
can you post sample ?
I'm very interested about it.
I have tried to use AutoComple in Virtual DataGridView without success.
Mostly Autocomplete menu does not appear. Sometimes it appers, no idea which
controls this.
I'm interested on using DataGridView Virtual mode. Does this book cover
virtual mode or only as its title says, Databindig ?
Andrus.
RobinS - 24 Jan 2008 07:16 GMT
>> Yes, there is. It is outlined brilliantly in Brian Noyes' DataBinding
>> book. Let me know if you want more info, and I'll dig it up and post the
[quoted text clipped - 13 lines]
>
> Andrus.
Yes, the book does cover using the DGV in virtual mode. I will post either
the code for the AutoComplete (I'm using it for one of my comboboxes), or a
link where you can find it, this weekend.
RobinS.
Andrus - 24 Jan 2008 15:57 GMT
> Yes, the book does cover using the DGV in virtual mode. I will post either
> the code for the AutoComplete (I'm using it for one of my comboboxes), or
> a link where you can find it, this weekend.
RobinS,
thank you.
Will this code allow to use AutoComplete in a Combobox placed in Virtual
Mode DataGridview ?
Will autocomplete work OK overv low speed internet ?
Andrus.
RobinS - 25 Jan 2008 07:45 GMT
I don't know why not. Using AutoComplete involves keeping a local copy of
the table. I'll post it this weekend.
RobinS.
GoldMail, Inc.
-----------
>> Yes, the book does cover using the DGV in virtual mode. I will post
>> either the code for the AutoComplete (I'm using it for one of my
[quoted text clipped - 8 lines]
>
> Andrus.
RobinS - 27 Jan 2008 19:53 GMT
Here's the example of auto-complete. This example is for a combobox that
holds a list of fonts available. So I have the data table that is bound to
the combobox for the user's selection, and a collection of entries for the
auto-completion. I would think this would work for a textbox; if it doesn't,
post back and I'll go pull out Brian's book. I'm sure he has an example for
a textbox.
-------------------------------------
//variable checked in the selectedIndexChanged event
// to suppress the event when the combobox
// is being loaded
private bool m_loading;
//table of fonts
private DataTable dtFonts;
//collection to use for auto-completion of the font names
private AutoCompleteStringCollection m_Fonts;
private void LoadFontComboBox()
{
m_Loading = true;
//Set up datatable to bind to the combobox
// so you can use autocomplete.
dtFonts = new DataTable();
dtFonts.Columns.Add(new DataColumn("fontName"));
m_Fonts = new AutoCompleteStringCollection();
InstalledFontCollection m_allFonts = new InstalledFontCollection();
foreach (FontFamily oneFamily in m_allFonts.Families)
{
if (oneFamily.IsStyleAvailable(FontStyle.Regular))
{
dtFonts.Rows.Add(oneFamily.Name);
m_Fonts.Add(oneFamily.Name);
}
}
FontFamilyComboBox.AutoCompleteCustomSource = m_Fonts;
FontFamilyComboBox.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
FontFamilyComboBox.AutoCompleteSource = AutoCompleteSource.CustomSource;
//databind the combobox
FontFamilyComboBox.DataSource = dtFonts;
FontFamilyComboBox.DisplayMember = "fontName";
FontFamilyComboBox.ValueMember = "fontName";
m_Loading = false;
}
-----------------------
RobinS.
GoldMail, Inc.
------------------------------------------------------------
>I don't know why not. Using AutoComplete involves keeping a local copy of
>the table. I'll post it this weekend.
[quoted text clipped - 14 lines]
>>
>> Andrus.
Andrus - 28 Jan 2008 15:16 GMT
> Here's the example of auto-complete.
Thank you.
I have the following requirements:
1. Combobox dropdown list must display more than one column, e.q product
code and product name.
2. Combobox dropdown list must be virtual (like DataGridView in virtual
mode).
(I have lookup table which can contain up to 500000 rows. So I think that it
is reasonable to show only records which are currently visible in screen).
Any sode sample which implements this? How to create
DrataGridview in virtual mode when user opens dropdown list ? Is it
reasonable to create form containing grid from Combobox dropdown event ?
DaisyCombo for .NET from http://www.springsys.com seems to implement
requirement (1)
Andrus.
RobinS - 30 Jan 2008 06:52 GMT
>> Here's the example of auto-complete.
>
[quoted text clipped - 17 lines]
>
> Andrus.
I don't know offhand of a way to do this. Maybe you should just buy Brian's
book and see if it helps. I haven't worked with virtual grids, I just know
he has a decent chapter on it.
As for the combobox problem, I would probably implement some kind of search
button rather than using a dropdown box.
Good luck.
RobinS.
Andrus - 30 Jan 2008 10:38 GMT
> FontFamilyComboBox.AutoCompleteCustomSource = m_Fonts;
> FontFamilyComboBox.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
> FontFamilyComboBox.AutoCompleteSource =
> AutoCompleteSource.CustomSource;
Why you do'nt use List as AutoCompleteSource ?
Why you are messing with custom source ?
Using List This makes code simpler.
Andrus.
RobinS - 24 Feb 2008 18:29 GMT
>> FontFamilyComboBox.AutoCompleteCustomSource = m_Fonts;
>> FontFamilyComboBox.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
[quoted text clipped - 6 lines]
>
> Andrus.
I wanted to provide the list of values for the auto-complete myself, so I
have to set AutoCompleteSource to CustomSource, and provide the
AutoCompleteStringCollection (m_Fonts) to use as the source.
Setting the AutoCompleteMode to SuggestAppend means that as the users type,
the dropdown list will display matches and append any missing letters for
the selected item when the user tabs out of the control.
This is from an example in Brian Noyes' Data Binding book, and it works
beautifully for me. As far as I know (I haven't tried it), you have to bind
to an AutoCompleteStringCollection to get it to work, not a List<T>.
RobinS.
GoldMail, Inc.