Click here to Skip to main content
15,867,141 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have problem with deleting row in wpf Grid panel,
when i m trying to delete first row it delete two row in wpf Grid...


C#
int rowDefinations = Grid.GetRow(sender as Button);
           RowDefinition rDef = layOut.RowDefinitions[rowDefinations];

           UIElement btn = layOut.Children.Cast<UIElement>().First(r=>Grid.GetRow(r)==rowDefinations && Grid.GetColumn(r)==2);
           UIElement txt1 = layOut.Children.Cast<UIElement>().First(r => Grid.GetRow(r) == rowDefinations && Grid.GetColumn(r) == 0);
           UIElement txt2 = layOut.Children.Cast<UIElement>().First(r => Grid.GetRow(r) == rowDefinations && Grid.GetColumn(r) == 1);
           layOut.Children.Remove(btn);
           layOut.Children.Remove(txt1);
           layOut.Children.Remove(txt2);

           layOut.RowDefinitions.Remove(rDef);



any help will sufficient for me... thanks
Posted
Updated 14-Feb-12 8:57am
v2
Comments
Shmuel Zang 14-Feb-12 15:08pm    
How the Grid is defined? Please use "Improve question" and post more information.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900