TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Joshua Paddock
NA
4
1.5k
making a Group boxes call data from entity
Jul 9 2015 12:41 PM
I am having trouble getting three different group boxes with check boxes to bring back the data into a data grid. i need it to get all the items checked and bring back the data in the window.
What i have so far work one at a time but it will not give me all three only the last checked. i have done this for the three group boxes Carriers, Priority and Cooler
private void CheckBox(object sender, RoutedEventArgs e)
{
var child = new GroupBox();
List<string> currentlyCheckedCheckBox = new List<string>();
List<string> currentlyUnCheckedCheckBox = new List<string>();
foreach (var child in cbCarriers.Children)
{
if (child.GetType() == typeof(CheckBox))
{
Checking for IsChecked
CheckBox currentCheckBox = (CheckBox)child;
if ((bool)currentCheckBox.IsChecked)
{
currentlyCheckedCheckBox.Add(currentCheckBox.Content.ToString());
}
else
{
currentlyUnCheckedCheckBox.Add(currentCheckBox.Content.ToString());
}
if ((bool)currentCheckBox.IsChecked == false)
{
return myMain.dtOrders;
}
}
}
if (currentlyCheckedCheckBox.Count == 0)
{
currentlyCheckedCheckBox = currentlyUnCheckedCheckBox;
}
List<Order> checkedOrders = new List<Order>();
foreach (var item in db.Orders)
{
foreach (var checkboxName in currentlyCheckedCheckBox)
{
if (item.ShipVia.Trim() == checkboxName)
{
checkedOrders.Add(item);
}
}
}
grdOrders.ItemsSource = checkedOrders;
}
Reply
Answers (
2
)
How to send F5 command to my browser after every 5 seconds i
MDI in WPF