Interviewer And Interviewee Guide

WPF Interview Question:

How elements in a ListBox sorted?

Submitted by: Administrator
Sorting can be done by using a property of the ItemsCollection object. ItemsCollection contains an attribute, SortDescriptions, which holds System.ComponentModel.SortDescription instances. Every SortDescription instance defines how the elements should be sorted and indicates if the sort is descending or ascending.

For instance, this code sorts elements of ContentControl on the basis of their word count property:
myItemsControl.Items.SortDescriptions.Add(new SortDescription("WordCount", ListSortDirection.Descending));
Submitted by:

Read Online WPF Job Interview Questions And Answers
Copyright 2007-2024 by Interview Questions Answers .ORG All Rights Reserved.
https://InterviewQuestionsAnswers.ORG.