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 BantheswaranPosted Aug 19, 2011, 2:04 AM
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 BantheswaranPosted Aug 18, 2011, 6:03 AM
Can you upload the Project.
Note:
Please delete the Bin and Obj folders before uploading the project..
Jaganathan BantheswaranPosted Nov 15, 2011, 12:10 AM
To hide/ show particular column we need to use Custom GridView.
qan lePosted Nov 14, 2011, 6:32 AM
I want to hide column in datagrid row when runtime? Can you help me?
Thanks much!
Jaganathan BantheswaranPosted Aug 22, 2011, 6:25 AM
bhuvenPosted Aug 19, 2011, 12:24 PM
Best wishes
Bhuven
Jaganathan BantheswaranPosted Aug 19, 2011, 1:55 AM
When selection is changed make all other group visibility as false and make the particular one is true.
you can use the same method.
bhuvenPosted Aug 19, 2011, 12:46 AM
Jaganathan BantheswaranPosted Aug 19, 2011, 12:37 AM
I am not clear about your need...
bhuvenPosted Aug 18, 2011, 2:32 PM
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 BantheswaranPosted Aug 18, 2011, 8:06 AM
Download the attached file
bhuvenPosted Aug 18, 2011, 7:23 AM
.....LightSwitch does not contain a definition for "FirstOrDefault"....
Am I missing a namespace?
bhuvenPosted Aug 18, 2011, 7:21 AM
Jaganathan BantheswaranPosted Aug 18, 2011, 6:22 AM
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;
}