I have a Customer Entity with field CustMov which stores "Inbound" and "Outbound" in Choice List. I have 4 addiitional fields. In the screen designer, I have two group boxes each hold 2 of the 4 additional fileds. The IsVisible property for the group boxes are unticked (off) but the fiels are ticked
When I run the program, both boxes are not displayed but when I select "Inbound" or "Outbound", the boxes donot display.
I would sincerely apprecaite some help. Thnaking you in advance
private void CreateNewCustomers_Created()
{
Dispatchers.Main.BeginInvoke(() =>
((INotifyPropertyChanged)this.CustMov).PropertyChanged += PropertyChanged);
}
private void PropertyChanged(object sender, PropertyChangedEventArgs e)
{
switch (CustomerProperty.CustMov)
{
case "Inbound":
this.FindControl("Group1").IsVisible = true;
break;
case "Outbound":
this.FindControl("Group1").IsVisible = true;
}
Loading

Jaganathan BantheswaranRank #170 · 14.1K reputationPosted Aug 18, 2011, 2:03 AM EDT
Can you upload the Project.
Note:
Please delete the Bin and Obj folders before uploading the project..
Jaganathan BantheswaranRank #170 · 14.1K reputationPosted Aug 18, 2011, 10:04 PM EDT
You can use like,
switch (CustomerProperty.CustMov)
{
case "I":
this.FindControl("Group1").IsVisible = true;
this.FindControl("Group2").IsVisible = false;
break;
case "O":
this.FindControl("Group1").IsVisible = false;
this.FindControl("Group2").IsVisible = true;
break;
}
for all properties,
Use e.PropertyName to check which property is changed.
Jaganathan BantheswaranRank #170 · 14.1K reputationPosted Aug 18, 2011, 2:22 AM EDT
You can use like this if the screen is collection based screen,
var customer = this.DataWorkspace.ApplicationData.Customers.FirstOrDefault();
if (customer.CustMov.Equals("InBound"))
{
this.FindControl("Group1").IsVisible = true;
}
bhuven28 reputationPosted Aug 18, 2011, 3:21 AM EDT
bhuven28 reputationPosted Aug 18, 2011, 3:23 AM EDT
.....LightSwitch does not contain a definition for "FirstOrDefault"....
Am I missing a namespace?
Jaganathan BantheswaranRank #170 · 14.1K reputationPosted Aug 18, 2011, 4:06 AM EDT
Download the attached file
bhuven28 reputationPosted Aug 18, 2011, 10:32 AM EDT
1. If I change the selection to the 2nd option, the first does not clear
2. If I have several groups, can I just change the field name and use in same method or should I create different for each group selection.
Thanks again. I am very grateful
Jaganathan BantheswaranRank #170 · 14.1K reputationPosted Aug 18, 2011, 8:37 PM EDT
I am not clear about your need...
bhuven28 reputationPosted Aug 18, 2011, 8:46 PM EDT
Jaganathan BantheswaranRank #170 · 14.1K reputationPosted Aug 18, 2011, 9:55 PM EDT
When selection is changed make all other group visibility as false and make the particular one is true.
you can use the same method.
bhuven28 reputationPosted Aug 19, 2011, 8:24 AM EDT
Best wishes
Bhuven
Jaganathan BantheswaranRank #170 · 14.1K reputationPosted Aug 22, 2011, 2:25 AM EDT
qan le2 reputationPosted Nov 14, 2011, 1:32 AM EST
I want to hide column in datagrid row when runtime? Can you help me?
Thanks much!
Jaganathan BantheswaranRank #170 · 14.1K reputationPosted Nov 14, 2011, 7:10 PM EST
To hide/ show particular column we need to use Custom GridView.