|
i want to open my control in new browser window
currently i m using radwindow control but its not opening new browser window.
below is sample code of mine
frmEntityMaster = new EntityMaster();
window.Content = frmEntityMaster;
window.show();
please please let me know is it possible to open this in new window browser.
because in silverlight we have only one aspx page where we used to load
usercontrol that's why HtmlPage.Window.Navigate option is eliminated in mine case because i need not open another uri i have navigate in my applictation but with new browser window
Reasons are not Important but Results are Important.
Swati Tripathi
|
|
|
|
|
Did you check the rad controls website?
You might find some documentation available there.
|
|
|
|
|
yes i did checked with rad controls website but i did not find anything
Reasons are not Important but Results are Important.
Swati Tripathi
|
|
|
|
|
Hi guys, after some advice.
We're currently using Prism to architect an MVVM soulution to one of our business requirements. The requirement is essentially to allow detail record editing in a form. The form itself will contain several drop down lists to limit what the user can choose. My question is how / at which point should we be getting the items to fill these drop downs. As it stands, when we return the "record" to be edited (see next question also), we're also returning all of the lookup lists and binding at that point - is this the "de-rigeur" way of doing it, or should we be making multiple calls - one for the data, one for the lookups?
Secondly, our view model currently contains an entity field, which we're using to bind to controls via a binding Path - something like {Binding Path=Customer.Name}. Now the entity class (Customer) implements INotifyPropertyChanged, and when one of (For example), my text fields change, the entity itself correctly updates and fires PropertyChanged event, but the ViewModel appears not to pick this up. The problem is that I need to intercept the change (or at least know that it's happened) at the ViewModel to requery some CanExecutes for commands. The only way around it I can see is to expose a filed per field on the form as separate properties, and then munge them together into the object when necessary, but this seems like overkill to me - is there another "recommended" way of doing it?
C# has already designed away most of the tedium of C++.
|
|
|
|
|
RichardGrimmer wrote: My question is how / at which point should we be getting the items to fill these drop downs. As it stands, when we return the "record" to be edited (see next question also), we're also returning all of the lookup lists and binding at that point - is this the "de-rigeur" way of doing it, or should we be making multiple calls - one for the data, one for the lookups?
I always feel that this depends on 1) how much data do expect to be returned on an average scenario 2) how you expect your application to be deployed - making multiple calls to different web services is not always a good idea - but if you are going to deploy your application on a intranet, I would say it would also not be a huge performance hit. After all, you will be making async calls, anyway.
RichardGrimmer wrote: Secondly, our view model currently contains an entity field, which we're using to bind to controls via a binding Path - something like {Binding Path=Customer.Name}. Now the entity class (Customer) implements INotifyPropertyChanged, and when one of (For example), my text fields change, the entity itself correctly updates and fires PropertyChanged event, but the ViewModel appears not to pick this up. The problem is that I need to intercept the change (or at least know that it's happened) at the ViewModel to requery some CanExecutes for commands. The only way around it I can see is to expose a filed per field on the form as separate properties, and then munge them together into
Are you using two-way binding?
|
|
|
|
|
Abhinav S wrote: I always feel that this depends on 1) how much data do expect to be returned on an average scenario 2) how you expect your application to be deployed - making multiple calls to different web services is not always a good idea - but if you are going to deploy your application on a intranet, I would say it would also not be a huge performance hit. After all, you will be making async calls, anyway.
That's what I figured- it's a judgement call....
Abhinav S wrote: Are you using two-way binding?
Absolutely....
C# has already designed away most of the tedium of C++.
|
|
|
|
|
I just noticed that your class Customer actually implements INotifyPropertyChanged.
The alternative to this could be to allow your view model to implement it. Bind your xaml control to a property in the view model - a property that represents your customer entity. Using this, you should be able to get a notification to your view model.
|
|
|
|
|
Now you see, that was how I had things set up originally. The problem is (as I mentioned) with CanExecute functions being called for my various commands - the binding is successfuly updating the entity. If I implement INPC on the entity, then I know that a field has changed at that level, but there's no way to let the ViewModel know, and since that's where the CanExecute functions live, it's never getting called.
Going the other way, if I implement INPC on the VM, then it correctly calls CanExecute when the entity itself changes, but not when one of the fields changes...
C# has already designed away most of the tedium of C++.
|
|
|
|
|
Hi,
I am unable to select an item of a particular value of a combobox in wpf.
For example say i have a textbox, a button and a combobox. The combobox has 3 items with values as 1 , 2 , 3 and display text as a , b , c. On load of the window these values and text gets binded to the combobox. On load nothing is being selected i.e. the combobox is blank.
Now when i type 1 in the textbox and click the button i want to show the value 1 as selected i.e. on click of the button "a" should get displayed.
Can anyone please help. Thanks in advance.
Regards,
Samar
|
|
|
|
|
Are you using MVVM pattern?If so then bind the SelectedValue of combobox to a property in view model and while clicking button set that property in view model.
|
|
|
|
|
Hi arun,
No i am not using MVVM. I want to keep this simple but yes i do not want to do it in xaml. I can do it in xaml by using binding and elementname.
I want to do it in c# code. Is there anything in wpf which is similar to the following what we do in web?
DropDownList1.Items.FindByValue("1").Selected = true;
modified on Tuesday, April 13, 2010 5:32 AM
|
|
|
|
|
comboboxId.SelectedValue = yourvalue.
But instead add a property in the code behind, bind it to the selected value of combobox and while clicking button set that property.
|
|
|
|
|
Thanks a million Arun!!! This solved by problem. I had tried this earlier but somehow was not able to get through but now it is working. thx again..!!!
|
|
|
|
|
Happy to see that your problem solved.
|
|
|
|
|
Samar Can u try with the selectedItem .......
|
|
|
|
|
Hi sunil i tried with selecteditem but it is showing me null as there is nothing selected.
|
|
|
|
|
Ok can u loop throught the source that u have binded and get the excat object that satisfy u r requirement and make that object as the selected item .Beacuse the data binding concept is something different in WPF
|
|
|
|
|
I think selected item was again throwing me null or something. I do not remember correctly now. But i got thru with the problem as below. Thank you very much for your help.
omboboxId.SelectedValue = yourvalue;
|
|
|
|
|
I need to access a WPF object, Grid, in a class. But I am not able to do so, as it is inaccessible. I need to change the visibility of a Grid object (WPF_Grid) based on certain conditions/values of class.
My Main Code:
public partial class MainWindow : Window
{
public TempDataClass tDataClass;
public MainWindow()
{
this.InitializeComponent();
tDataClass = new TempDataClass();
}
private void SomeMainFunction()
{
if (SomeMainCondition1)
{
tDataClass.someClassFunction1();
}
else
{
tDataClass.someClassFunction2();
}
}
}
My Class Code:
public class TempDataClass : DependencyObject
{
public FolderFilingDataClass()
{
}
public void someClassFunction1()
{
if (SomeClassCondition1)
{
WPF_Grid.Visibility = Visibility.Hidden;
}
}
public void someClassFunction2()
{
if (SomeClassCondition2)
{
WPF_Grid.Visibility = Visibility.Visible;
}
}
}
One way around is passing objects as parameter, but is there any better way? I am sure, there is...
|
|
|
|
|
you can create a property in TempDataClass and set it before tDataClass.someClassFunction1();
|
|
|
|
|
Sorry! Not clear for me...
|
|
|
|
|
Passing the parameter and my posted solution having the same effect.
Create a property in your TemplateClass to hold the object and set this object from the main class where you are calling the method from.
|
|
|
|
|
Ok, Right! Got it
|
|
|
|
|
While the other answer you got will work correctly, it's not the WPF-ish way of doing it. Ideally you should bind the grid's Visibility to a public property on the data class where you also need to implement INotifyPropertyChanged. If this property is a bool, you'd also need to use a binding converter (to convert from bool to Visibility).
|
|
|
|
|
Thanks Nishant for you reply! Yes, I understand your point. This Grid and Visibility property was just a small example of my problem. Sometime I have a canvas and need to addChildren, removeChildren and many more thing from class. So, basically all drawing methods implemented inside class, while no objects accessible. In that case, i am really not sure how binding will work.
|
|
|
|