Click here to Skip to main content
15,897,273 members
Home / Discussions / WPF
   

WPF

 
AnswerRe: How to stretch Colum header in WPF datagrid? Pin
Pete O'Hanlon27-Jul-10 0:30
mvePete O'Hanlon27-Jul-10 0:30 
QuestionHow to bind the Stackpanel object into ListView Pin
DavJes26-Jul-10 2:00
DavJes26-Jul-10 2:00 
AnswerRe: How to bind the Stackpanel object into ListView Pin
Michael Eber27-Jul-10 17:38
Michael Eber27-Jul-10 17:38 
GeneralRe: How to bind the Stackpanel object into ListView Pin
DavJes4-Aug-10 21:41
DavJes4-Aug-10 21:41 
GeneralRe: How to bind the Stackpanel object into ListView Pin
Michael Eber5-Aug-10 7:08
Michael Eber5-Aug-10 7:08 
QuestionRemoving specific object from a container and add it to another Pin
sadas232341s24-Jul-10 3:48
sadas232341s24-Jul-10 3:48 
AnswerRe: Removing specific object from a container and add it to another Pin
Parwej Ahamad24-Jul-10 7:30
professionalParwej Ahamad24-Jul-10 7:30 
AnswerRe: Removing specific object from a container and add it to another Pin
Michael Eber27-Jul-10 12:10
Michael Eber27-Jul-10 12:10 
If you run that code in debug mode you WILL experience an exception.
You cannot remove an item from a collection that is being enumerated. So what I do in that case is this:

List<int> itemsToRemove = new List<int>();
for ( int index = 0; index<LayoutRood.Children.Count; index++ )
{
      if ( LayoutRoot.Children[index] is Button )
           itemsToRemove.Add(index);
}
// Next process the items to move
foreach ( int element in itemsToRemove )
{
   Button oldElement = LayoutRoot.Children[element] as Button;
   LayoutRood.Children.RemoveAt(element);
   StackPanel1.Children.Add(oldElement);
}


Take this one warning into account: you MIGHT get an exception that the element is already a member of another collection. The exception will point at your StackPanel1 add to the elements. If that happens then do the following:

Button newElement = new Button;
newElement.Name = oldElement.Name;
     .
     .
     .
// you get the idea
// now add the new instance of the button to the collection

QuestionData binding to static resource: shown to work in VS but not when run Pin
Jonathan Davies24-Jul-10 2:36
Jonathan Davies24-Jul-10 2:36 
AnswerRe: Data binding to static resource: shown to work in VS but not when run Pin
Pete O'Hanlon24-Jul-10 4:25
mvePete O'Hanlon24-Jul-10 4:25 
GeneralRe: Data binding to static resource: shown to work in VS but not when run Pin
Jonathan Davies24-Jul-10 7:18
Jonathan Davies24-Jul-10 7:18 
QuestionUser Control Height is 0 before its drawn to screen. Pin
Poohshoes23-Jul-10 15:33
Poohshoes23-Jul-10 15:33 
AnswerRe: User Control Height is 0 before its drawn to screen. Pin
Kunal Chowdhury «IN»24-Jul-10 4:44
professionalKunal Chowdhury «IN»24-Jul-10 4:44 
GeneralRe: User Control Height is 0 before its drawn to screen. Pin
Poohshoes26-Jul-10 4:38
Poohshoes26-Jul-10 4:38 
AnswerRe: User Control Height is 0 before its drawn to screen. Pin
Kunal Chowdhury «IN»26-Jul-10 5:04
professionalKunal Chowdhury «IN»26-Jul-10 5:04 
GeneralRe: User Control Height is 0 before its drawn to screen. Pin
Poohshoes26-Jul-10 8:18
Poohshoes26-Jul-10 8:18 
AnswerRe: User Control Height is 0 before its drawn to screen. Pin
Kunal Chowdhury «IN»26-Jul-10 8:29
professionalKunal Chowdhury «IN»26-Jul-10 8:29 
QuestionWPF controls on web [modified] Pin
Prasoon Chaudhary22-Jul-10 21:58
Prasoon Chaudhary22-Jul-10 21:58 
AnswerRe: WPF controls on web Pin
Jammer27-Jul-10 0:49
Jammer27-Jul-10 0:49 
AnswerRe: WPF controls on web Pin
Jugortha27-Jul-10 13:20
Jugortha27-Jul-10 13:20 
GeneralRe: WPF controls on web Pin
Pete O'Hanlon27-Jul-10 21:50
mvePete O'Hanlon27-Jul-10 21:50 
QuestionBinding ListBoxes to Calender Pin
carrigart22-Jul-10 14:38
carrigart22-Jul-10 14:38 
QuestionA weird WPF build-time error [modified] Pin
makumazan8422-Jul-10 4:26
makumazan8422-Jul-10 4:26 
QuestionUnable to read bmp and gif files in Silverlight [modified] Pin
yogesh_kumar_agarwal21-Jul-10 23:48
yogesh_kumar_agarwal21-Jul-10 23:48 
QuestionTrouble testing Custom Installation screen [modified] Pin
vikas amin21-Jul-10 8:21
vikas amin21-Jul-10 8:21 

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.