Click here to Skip to main content
15,879,348 members
Home / Discussions / WPF
   

WPF

 
SuggestionRe: Custom input for Silverlight DatePicker Pin
Oludayo Alli16-Aug-11 2:10
Oludayo Alli16-Aug-11 2:10 
Answer[SOLVED]Re: Custom input for Silverlight DatePicker Pin
jadughar20-Sep-11 21:01
jadughar20-Sep-11 21:01 
QuestionHow to create a wpf application Pin
Naim_8626-Jul-11 20:02
Naim_8626-Jul-11 20:02 
AnswerRe: How to create a wpf application Pin
Mycroft Holmes26-Jul-11 23:25
professionalMycroft Holmes26-Jul-11 23:25 
QuestionAuto Scrolling to Bottom Pin
AmbiguousName26-Jul-11 20:01
AmbiguousName26-Jul-11 20:01 
AnswerRe: Auto Scrolling to Bottom Pin
Simon Bang Terkildsen27-Jul-11 22:39
Simon Bang Terkildsen27-Jul-11 22:39 
AnswerRe: Auto Scrolling to Bottom Pin
AmbiguousName28-Jul-11 1:45
AmbiguousName28-Jul-11 1:45 
AnswerRe: Auto Scrolling to Bottom Pin
SledgeHammer0128-Jul-11 5:08
SledgeHammer0128-Jul-11 5:08 
Of course it doesn't work Smile | :) . And I bet I know why...

I'm guessing your code looks something like:

private void SomeMethod()
{
AddItem();
AutoScrollToBottom();
}

right?? Smile | :) .

This is one of the things that annoys me about WPF and always throws newbies (sorry if you are not, just this is well known to experienced WPF guys) for a loop.

When you have an item based control (ListBox, ListView, TreeView, etc), items are not really inserted into the control right away. They are inserted at some random point in the future. So what happens is exactly what you are seeing... your code says insert item #10, then it says "scroll to the last item" which still happens to be item #9. Then item #10 happens to be inserted. So you are scrolling to the second to last item because that was really the last item when your code executed.

What you need to do is subscribe to the ItemContainerGenerator.StatusChanged event and wait for the status to be ContainerGenerated on the item you want. Only then can you scroll it into view.
QuestionMigration from RadScheduler to RadScheduleView Pin
Jeyakumarbics126-Jul-11 19:23
Jeyakumarbics126-Jul-11 19:23 
AnswerRe: Migration from RadScheduler to RadScheduleView Pin
Mycroft Holmes26-Jul-11 23:23
professionalMycroft Holmes26-Jul-11 23:23 
AnswerRe: Migration from RadScheduler to RadScheduleView Pin
Michał Zalewski31-Jul-11 2:39
Michał Zalewski31-Jul-11 2:39 
QuestionAppointmentCreate event in RadScheduleView Pin
Jeyakumarbics126-Jul-11 19:14
Jeyakumarbics126-Jul-11 19:14 
QuestionHow to get the column in runtime? Pin
sadas232341s26-Jul-11 8:27
sadas232341s26-Jul-11 8:27 
AnswerRe: How to get the column in runtime? Pin
Mark Salsbery26-Jul-11 9:08
Mark Salsbery26-Jul-11 9:08 
AnswerRe: How to get the column in runtime? Pin
Ian Shlasko26-Jul-11 10:24
Ian Shlasko26-Jul-11 10:24 
QuestionWPF ComboBox Synchronization Problem Pin
AndyCSharp26-Jul-11 1:24
AndyCSharp26-Jul-11 1:24 
AnswerRe: WPF ComboBox Synchronization Problem Pin
Simon Bang Terkildsen26-Jul-11 3:52
Simon Bang Terkildsen26-Jul-11 3:52 
QuestionHow to Update Rows in Silverlight 4 Data grid Using WCF service ? Pin
Sanjay_8724-Jul-11 21:24
Sanjay_8724-Jul-11 21:24 
AnswerRe: How to Update Rows in Silverlight 4 Data grid Using WCF service ? Pin
Abhinav S24-Jul-11 21:41
Abhinav S24-Jul-11 21:41 
Questioncan't edit tabitem Pin
david131324-Jul-11 5:35
david131324-Jul-11 5:35 
AnswerRe: can't edit tabitem Pin
Mark Salsbery24-Jul-11 8:19
Mark Salsbery24-Jul-11 8:19 
GeneralRe: can't edit tabitem Pin
david131324-Jul-11 8:26
david131324-Jul-11 8:26 
GeneralRe: can't edit tabitem Pin
Mark Salsbery24-Jul-11 8:28
Mark Salsbery24-Jul-11 8:28 
QuestionClosable Tabs Pin
jgalak23-Jul-11 8:03
jgalak23-Jul-11 8:03 
AnswerRe: Closable Tabs Pin
SledgeHammer0123-Jul-11 11:42
SledgeHammer0123-Jul-11 11:42 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.