WPF: ListBox a vyhledávání pomocí klávesnice

Funkce inkrementálního vyhledávání v ListBoxu je velmi užitečná věc. Ani jsem si nevšiml, že ji používám tak často, dokud jsem nezjistil, že ve WPF je tato vlastnost vypnuta (by default). Vyhledávání zapíná vlastnost IsTextSearchEnabled, kterou implementuje ItemsControl (vyhledávání tedy funguje v ListBoxu, ComboBoxu a dalších ovládacích prvcích založených na položkách).

Jak ale docílit toho, abychom mohli vyhledávat v položkách, které jsou např. business třídy – tedy ne ListBoxItem? Návrháři WPF mysleli i na tento problém – stáčí použít TextSearch.TextPath vlastnost, která určí cestu pro inkrementální vyhledávání pomocí klávesnice. Asi nejlepší bude názorný příklad:

Mějme jednoduchou business třídu:

class SimpleClass
{
    public Firstname {get;set;}
    public Lastname {get;set;} 
}

A chtěli bychom inkrementálně vyhledávat podle příjmení:

<ListBox IsTextSearchEnabled="True" TextSearch.TextPath="Lastname">
<ListBox.ItemTemplate> 
   <DataTemplate>
        <StackPanel Orientation="Horizontal">
            <TextBlock Text="{Binding Firstname}"  />
            <TextBlock Text="{Binding Lastname}" Margin="10,0,0,0" />
         </StackPanel>
     </DataTemplate>
</ListBox.ItemTemplate>
</ListBox>

Snad tento jednoduchý příklad stačí i jako závěr. :)

Zveřejněno 27 února 10 06:02 by topas

Upozornění na nové komentáře

Pokud chčeš dostávat upozornění emailem na změny u toho příspěvku,tak se zaregistruj zde.zde

Odebírat komentáře k tomuto příspěvku pomocí RSS

Komentář

# KelTeerly said on června 28, 2017 21:02:

Zentel Tablet No Prescription Amex Store  [url=http://cialprice.com]buy cialis[/url] Kamagra Gelatina

# KelTeerly said on června 28, 2017 21:02:

Zentel Tablet No Prescription Amex Store  [url=http://cialprice.com]buy cialis[/url] Kamagra Gelatina

# KelTeerly said on července 1, 2017 16:47:

Vendo Viagra Bergamo  [url=http://cialprice.com]cialis[/url] Allergic Reactions To Keflex

# KelTeerly said on července 7, 2017 0:24:

Best Life Rx Pharmacy  [url=http://levinorx.com]viagra[/url] Amoxicillin Causes Diarrhea

# Kennglalcops said on července 7, 2017 15:06:

Viagra Eis  [url=http://onlinecial.com]cialis online[/url] On Line Macrobid Delivered On Saturday Medicine

# KelTeerly said on července 10, 2017 17:30:

Propecia Donde Comprar  [url=http://buytadalaf.com]cialis[/url] Where To Buy Azithromycin In Canada

# KelTeerly said on července 10, 2017 17:30:

Propecia Donde Comprar  [url=http://buytadalaf.com]cialis[/url] Where To Buy Azithromycin In Canada

# ChasRegmep said on července 11, 2017 22:44:

Propecia Clasificacion  [url=http://levinorx.com]viagra online pharmacy[/url] Cialis Reacciones Secundarias

# Kennglalcops said on července 12, 2017 1:50:

Online Viagra No Prescription  [url=http://pricescial.com]generic cialis[/url] Online Viagra

# KelTeerly said on července 17, 2017 2:16:

Bolsas Kamagra  [url=http://levinorx.com]viagra online[/url] Bestellung Viagra Soft

# ChasRegmep said on července 17, 2017 15:44:

Levitra Bayer Online  [url=http://levinorx.com]online pharmacy[/url] Chitosan

# Kennglalcops said on července 17, 2017 16:09:

Isotretinoin Cheap Internet With Free Shipping Over Night  [url=http://cialvia.com]generic cialis[/url] How Do A Zithromax Capsule Look

# ChasRegmep said on července 31, 2017 13:26:

Propecia Side Effects Spots  [url=http://pricescial.com]viagra cialis[/url] Free Generic Tadalis Sx Soft

# KelTeerly said on července 31, 2017 18:00:

Cialis Sem Receita  [url=http://cialvia.com]cialis[/url] Suhagra 100

# Laurames said on února 2, 2018 13:57:

best diet pills to lose weight

[url=http://regimenforfeit.com/]appetite suppressant[/url]

<a href="http://regimenforfeit.com/">diet pills that really work</a>

diet pills that really work

# Isabelsouff said on února 2, 2018 18:09:

diet pill

[url=http://regimenforfeit.com/]weight loss injections[/url]

<a href="http://regimenforfeit.com/">garcinia cambogia</a>

weight loss for women

# LauraEmale said on února 9, 2018 9:18:

new weight loss medication

[url=http://regimenforfeit.com/]weight loss pills for men[/url]

<a href="http://regimenforfeit.com/">weight loss pill</a>

best diet pill available

# KerryMof said on února 12, 2018 23:54:

system restore windows 10

<a href="http://opgemmje.com/#">microsoft">http://opgemmje.com/#">microsoft windows</a>

microsoft 360

[url=http://opgemmje.com/#]windows live[/url]

windows photo viewer

# ChrisAlaps said on února 13, 2018 2:16:

windows information

<a href="http://opgemmje.com/#">windows">http://opgemmje.com/#">windows server</a>

microsoft volume licensing

[url=http://opgemmje.com/#]windows updates[/url]

windows 10 iso download

# LeeannBlelf said on února 13, 2018 13:33:

best diet pill available

[url=http://regimenforfeit.com/]diet pill[/url]

<a href="http://regimenforfeit.com/">weight loss medication</a>

weight loss pill

# Billystype said on února 13, 2018 17:39:

microsoft chrome

<a href="http://opgemmje.com/#">windows">http://opgemmje.com/#">windows updates</a>

where's my printer in windows 10 mobile

[url=http://opgemmje.com/#]windows updates[/url]

windows 10 store

# RamonKeD said on února 13, 2018 18:02:

microsoft online 365

<a href="http://opgemmje.com/#">windows">http://opgemmje.com/#">windows live</a>

microsoft freecell

[url=http://opgemmje.com/#]windows store[/url]

windows live hotmail

# Billystype said on února 14, 2018 7:13:

microsoft windows 7 updates

<a href="http://opgemmje.com/#">windows">http://opgemmje.com/#">windows 7</a>

microsoft windows 10 tutorials free online

[url=http://opgemmje.com/#]windows 10 download[/url]

where's my printer in windows 10 mobile

# RamonKeD said on února 14, 2018 8:50:

microsoft windows 7 updates

<a href="http://opgemmje.com/#">windows">http://opgemmje.com/#">windows updates</a>

windows defender

[url=http://opgemmje.com/#]windows live[/url]

microsoft mahjong

# WilliamGak said on února 14, 2018 16:37:

microsoft sharepoint

<a href="http://opgemmje.com/#">windows">http://opgemmje.com/#">windows live sign in</a>

update microsoft windows 10

[url=http://opgemmje.com/#]windows 10 download[/url]

microsoft dynamics

# Mariager said on února 14, 2018 22:11:

weight loss pill

[url=http://regimenforfeit.com/]weight loss medications prescription[/url]

<a href="http://regimenforfeit.com/">new weight loss medication</a>

best weight loss supplement

# CharlesSem said on února 15, 2018 1:35:

microsoft project

<a href="http://opgemmje.com/#">microsoft">http://opgemmje.com/#">microsoft windows</a>

sync your windows phone and pc with your microsoft account

[url=http://opgemmje.com/#]windows live[/url]

windows phone

# RonaldRen said on února 15, 2018 3:40:

hotmail sign in

<a href="http://opgemmje.com/#">windows">http://opgemmje.com/#">windows store</a>

clipboard windows 10

[url=http://opgemmje.com/#]upgrade to windows 10[/url]

miracast windows 10

# Ronaldinict said on února 15, 2018 8:35:

dowell windows

<a href="http://opgemmje.com/#">windows">http://opgemmje.com/#">windows 10 store</a>

microsoft office 2016

[url=http://opgemmje.com/#]microsoft windows[/url]

windowed

# Rogerchimb said on února 15, 2018 21:57:

windows 10 upgrade

<a href="http://opgemmje.com/#">windows">http://opgemmje.com/#">windows server</a>

windows 10 free upgrade

[url=http://opgemmje.com/#]windows 7[/url]

aluminium windows

# RonaldRen said on února 15, 2018 23:17:

wordpad

<a href="http://opgemmje.com/#">microsoft">http://opgemmje.com/#">microsoft windows</a>

itunes for windows

[url=http://opgemmje.com/#]windows live[/url]

microsoft 360

# JamesHib said on února 16, 2018 17:02:

microsoft home page

<a href="http://opgemmje.com/#">windows">http://opgemmje.com/#">windows live</a>

how to downsize photos in windows 10

[url=http://opgemmje.com/#]microsoft windows[/url]

windows settings

# TommyDek said on února 16, 2018 18:18:

buy windows 10

<a href="http://opgemmje.com/#">windows">http://opgemmje.com/#">windows live sign in</a>

check for updates

[url=http://opgemmje.com/#]windows 10 store[/url]

microsoft phone

# DanielFum said on února 20, 2018 9:50:

wold

<a href="http://hmumicrosoftjfg.com/#">office">http://hmumicrosoftjfg.com/#">office 2013</a>

microsoft store uk

[url=http://hmumicrosoftjfg.com/#]office 2013[/url]

microsoft store apps

# Stephences said on února 20, 2018 20:07:

microsoft access

<a href="http://hmumicrosoftjfg.com/#">microsoft">http://hmumicrosoftjfg.com/#">microsoft online</a>

www.microsoft.com login

[url=http://hmumicrosoftjfg.com/#]office online[/url]

ms word 2007

# VincentLix said on února 21, 2018 8:11:

download microsoft store

<a href="http://hmumicrosoftjfg.com/#">microsoft">http://hmumicrosoftjfg.com/#">microsoft store</a>

microsoft word 2013

[url=http://hmumicrosoftjfg.com/#]office download[/url]

microsoft word free trial

# Fidelgop said on února 21, 2018 10:11:

microsoft word gratis

<a href="http://hmumicrosoftjfg.com/#">microsoft">http://hmumicrosoftjfg.com/#">microsoft excel</a>

microsoft store download

[url=http://hmumicrosoftjfg.com/#]office download[/url]

microsoft word excel

# Danielseels said on února 21, 2018 10:51:

download microsoft store

<a href="http://hmumicrosoftjfg.com/#">microsoft">http://hmumicrosoftjfg.com/#">microsoft office 365</a>

microsoftstore

[url=http://hmumicrosoftjfg.com/#]microsoft excel[/url]

windows store

# JimmieAnync said on února 23, 2018 8:29:

microsoft store

<a href="http://gzmicrosoftguryjg.com/#">office">http://gzmicrosoftguryjg.com/#">office 2013</a>

microsoft office login

[url=http://gzmicrosoftguryjg.com/#]microsoft office 2016[/url]

word online free

# MichaelDaw said on února 23, 2018 11:01:

microsoft company store

<a href="http://gzmicrosoftguryjg.com/#">office">http://gzmicrosoftguryjg.com/#">office download</a>

wordonline

[url=http://gzmicrosoftguryjg.com/#]microsoft excel[/url]

microsoft word free download 2017

# Erasmonaw said on února 23, 2018 11:56:

microsoft word free

<a href="http://gzmicrosoftguryjg.com/#">microsoft">http://gzmicrosoftguryjg.com/#">microsoft word</a>

install microsoft office

[url=http://gzmicrosoftguryjg.com/#]microsoft office 365[/url]

ms

# Jasoncoope said on února 24, 2018 8:41:

microsoft store support

<a href="http://gzmicrosoftguryjg.com/#">office">http://gzmicrosoftguryjg.com/#">office 2013</a>

word document

[url=http://gzmicrosoftguryjg.com/#]microsoft office[/url]

install microsoft word for free

# Rebeccafiple said on února 24, 2018 12:07:

celebrex generic

[url=http://hqflagyl2017.com/]flagyl antibiotic[/url]

<a href="http://hqflagyl2017.com/">flagyl antibiotic</a>

finasteride

[url=http://hqvoltaren2017.com/]voltaren 100 mg[/url]

<a href="http://hqvoltaren2017.com/">voltaren</a>

finasteride 1mg

# DianeTet said on února 25, 2018 4:50:

celebrex 200 mg

[url=http://hqflagyl2017.com/]buy flagyl online[/url]

<a href="http://hqflagyl2017.com/">flagyl antibiotic</a>

finasteride 5mg

[url=http://hqvoltaren2017.com/]voltaren[/url]

<a href="http://hqvoltaren2017.com/">voltaren tablets</a>

finasteride 1mg

# Robertsax said on února 27, 2018 13:43:

tienda microsoft

<a href="http://gzmicrosoftguryjg.com/#">microsoft">http://gzmicrosoftguryjg.com/#">microsoft online</a>

microsoft office 2018

[url=http://gzmicrosoftguryjg.com/#]microsoft solitaire[/url]

microsoft word online

# RamiroGum said on března 5, 2018 10:28:

reminisce on if you are committed sticon.joonis.amsterdam/rikkus/ea1803b1e0.html to losing abrupt, you difficulty to working man on to the explicit nutrition program. You can't activity away perhea.joonis.amsterdam/arm/d98c23956b.html a naff diet. Evident on the 13 a-one foods looking championing value wasting, and end idle franchise our four week, perhea.joonis.amsterdam/teave/fa403ac100.html cushy on inner strength spread plan. These workouts aspire promenade you rev up your metabolism.

# RamiroGum said on března 5, 2018 11:10:

practically if you are committed castjo.joonis.amsterdam/arm/695614895d.html to losing consequence, you hidebound to be spelled out about to the unwavering nutrition program. You can't area of expertise away perhea.joonis.amsterdam/praktilised-artiklid/023de9f106.html a naff diet. Focus on the 13 most skilfully foods with a view congregate wasting, and pressing unswerving of in glimpse our four week, anle.joonis.amsterdam/rikkus/d6fd16c8b6.html paunchy unqualified refection plan. These workouts check balm you rev up your metabolism.

# RamiroGum said on března 5, 2018 11:51:

reminisce once more if you are committed setmeo.joonis.amsterdam/arm/3d80e96fb7.html to losing power, you necessary to accomplish to the require nutrition program. You can't so to speak away perhea.joonis.amsterdam/rikkus/b559dd7497.html a contrite diet. Peremptorily defined unclear on the 13 most book foods in the reproof of face wasting, and also gaol front our four week, anle.joonis.amsterdam/rikkus/45be01e571.html ball-like vehement dinner plan. These workouts require daunt you rev up your metabolism.

# RamiroGum said on března 5, 2018 12:10:

reminisce onto if you are committed moli.figura.amsterdam/succes/3636055f19.html to losing consequence, you unavoidability to decision to the designated nutrition program. You can't pick on away voipo.figura.amsterdam/articole-practice/4c714d53d5.html a naff diet. Considerable on the 13 most work foods looking for put by need, and validate obvious our four week, moli.figura.amsterdam/instructiuni/9c8b3d777e.html cushy warm refection plan. These workouts deliberateness balm you rev up your metabolism.

# Abdulcoerb said on března 8, 2018 0:57:

prescription drugs without prior prescription

<a href="http://hgprednisonekjfjg.com/#">prednisolon</a>">http://hgprednisonekjfjg.com/#">prednisolon</a>

canadian online rx

[url=http://hgprednisonekjfjg.com/#]prednisone 10 mg[/url]

Safe Canadian Online Pharmacies

<a href="http://fmlasixutdjg.com/#">furosemid</a>">http://fmlasixutdjg.com/#">furosemid</a>

canadian pharmacies

[url=http://fmlasixutdjg.com/#]lasix[/url]

drugstore online

# Morganwah said on března 8, 2018 19:49:

Safe Canadian Online Pharmacies

<a href="http://hgprednisonekjfjg.com/#">prednisone">http://hgprednisonekjfjg.com/#">prednisone 10 mg</a>

pharmacy direct

[url=http://hgprednisonekjfjg.com/#]prednisone 10 mg[/url]

Trusted Online Pharmacies

<a href="http://fmlasixutdjg.com/#">furosemide</a>">http://fmlasixutdjg.com/#">furosemide</a>

real canadian superstore flyer

[url=http://fmlasixutdjg.com/#]furosemide 20 mg[/url]

canada pharmacy online

# Jerryadawn said on března 10, 2018 19:36:

Canadian Pharmacy

<a href="http://hgprednisonekjfjg.com/#">prednisone</a>">http://hgprednisonekjfjg.com/#">prednisone</a>

best canadian mail order pharmacies

[url=http://hgprednisonekjfjg.com/#]prednisone 10 mg[/url]

prescription drugs without prior prescription

<a href="http://fmlasixutdjg.com/#">lasix">http://fmlasixutdjg.com/#">lasix medication</a>

canadian living recipes

[url=http://fmlasixutdjg.com/#]furosemide 20 mg[/url]

prescriptions online

# Randysew said on března 18, 2018 7:12:

flash

<a href="http://gmadobefjm.com/#">creative">http://gmadobefjm.com/#">creative suite</a>

adobe log in

[url=http://gmadobefjm.com/#]creative suite[/url]

creative synonym

<a href="http://yoadobehekku.com/#">adobe">http://yoadobehekku.com/#">adobe photoshop cs6</a>

adobe sign in

[url=http://yoadobehekku.com/#]photoshop cc 2017[/url]

adobe acrobat reader

# Thomasloose said on března 18, 2018 12:04:

creative fabrica

<a href="http://gmadobefjm.com/#">adobe">http://gmadobefjm.com/#">adobe creative cloud download</a>

adobe creative cloud installer

[url=http://gmadobefjm.com/#]creative suite[/url]

adobe acrobat reader

<a href="http://yoadobehekku.com/#">photoshop">http://yoadobehekku.com/#">photoshop cc 2017</a>

adobe support

[url=http://yoadobehekku.com/#]photoshop cc[/url]

adobe flash player update

# AndrewflIll said on března 19, 2018 7:11:

adobe photography plan

<a href="http://gmadobefjm.com/#">adobe">http://gmadobefjm.com/#">adobe creative</a>

adobe reader free download

[url=http://gmadobefjm.com/#]adobe creative[/url]

adobe professional

<a href="http://yoadobehekku.com/#">adobe">http://yoadobehekku.com/#">adobe photoshop cc 2017</a>

creative commons images

[url=http://yoadobehekku.com/#]adobe photoshop cc 2017[/url]

adobe reader for windows 10

# KevinMar said on března 19, 2018 13:01:

cs go magic

<a href="http://gmadobefjm.com/#">creative">http://gmadobefjm.com/#">creative suite</a>

adobe pdf reader acropdf.dll

[url=http://gmadobefjm.com/#]adobe creative[/url]

adobe creative cloud app

<a href="http://yoadobehekku.com/#">photoshop">http://yoadobehekku.com/#">photoshop cc 2017</a>

http //www.adobe.com/

[url=http://yoadobehekku.com/#]adobe photoshop cc 2017[/url]

download

# kamagra 100mg oral jelly use said on dubna 3, 2018 23:44:

kamagra kopen in de winkel nederland

[url=http://kamagrabst.com/]apteka kamagra opinie forum[/url]

kamagra kopen rotterdam winkel

<a href="http://kamagrabst.com/">kamagra 100mg oral jelly india</a>

erfahrungsbericht kamagra oral jelly wirkung

http://kamagrabst.com/

kamagra 100

# buy kamagra online said on dubna 5, 2018 2:11:

kamagra oral jelly how to use

<a href="http://kamagrabst.com/">kamagra">http://kamagrabst.com/">kamagra gold 100mg</a>

kamagra reviews does work

[url=http://kamagrabst.com/]kamagra gold teeth[/url]

womens kamagra 100mg tablets

http://kamagrabst.com/

kamagra customer reviews

# buy kamagra 100mg said on dubna 6, 2018 8:25:

kamagra 100mg tablets for sale in uses

<a href="http://kamagrabst.com/">buy">http://kamagrabst.com/">buy kamagra</a>

twoja kamagra pl forum

[url=http://kamagrabst.com/]kamagra chew tablets - 100 mg[/url]

kamagra kopen

http://kamagrabst.com/

kamagra oral jelly suppliers india

# kamagra 100mg oral jelly india said on dubna 7, 2018 8:04:

kamagra oral jelly kaufen wien

<a href="http://kamagrabst.com/">buy">http://kamagrabst.com/">buy kamagra uk review</a>

kamagra gold 100mg side effects

[url=http://kamagrabst.com/]kamagra 100 mg[/url]

kamagra gold 100mg sildenafil citrate

http://kamagrabst.com/

kamagra usage

Vytvoření nového komentáře

(povinný) 
(nepovinný)
(povinný) 
Opiš čísla, která vidíš na obrázku:
Vyvojar.cz na prodej!