|
In my SL app i'm printing some Document with the PrintDocument, and when i call the Print() method it show the print dialog where i can select the printer.
In ControlPanel->Printers i have a printer with custom settings and it's not the default printer. If I print on this printer from SL it's doen't print right beacuse it doesn't take the corect printer settings.
But if i set the printer as Default Printer and try to print from SL , it take right printer settings and print right.
I tierd to describe the scenario through this post : http://dchamba.blogspot.it/2012/04/silverlight-printing-issue.html
How can i solve this problem ??
Thanks
|
|
|
|
|
Silverlight runs in a sandboxed environment and thus you cannot change the default printer via its application.
You might be able to do this if you run the application with elevated permissions (and as an out of browser one).
|
|
|
|
|
Thanks for the answer Brother.
I don't want to change the default printer.
I want that every Printer i select from the PrintDialogBox has the settings that i setted from ControlPanel.
For now only the default printer has the correct Printer Settings.
|
|
|
|
|
how can i get cell value from wpf datagrid?
this code, wich used to validate data (email adress) from datagrid
private void button2_Click(object sender, RoutedEventArgs e)
{
Validator v =new Validator();// class...
String item = dgv1.CurrentCell.Item.ToString();
if (v.validate(item))
{
MessageBox.Show("ok");
}
else
{
MessageBox.Show("no");
}
}
|
|
|
|
|
Wake UP - you need to do it right, work with the data not the control. You have a collection bound to the datagrid and you should have a selected object (an item of the collection) validate the data in the selected object not the control content.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
A similar question was asked before. See the answers given here[^].
|
|
|
|
|
Hi,
I think if u are assigning a Observable collection to a datagrid, & the binding are 2 way mode then changes done on any object will be reflected on both.
so need the cell value. its like this
ObservableCollection s = new ObservableCollectio();
datagrid1.ItemSource = s;
s[0].Columnname
0 will be the row, in this way u can access the cell value.
Regads,
Satish Pai
|
|
|
|
|
hi all,
i want to close my wpf window when i click mouse out side the wpf window.
|
|
|
|
|
Hi,
Does the Window has a MDI form or such ?
|
|
|
|
|
If this is a window contained inside another WPF window, a good way to do this is have the window you want closing actually be a Popup . Set StaysOpen = false on the Popup , and it will close when you click outside the popup area.
|
|
|
|
|
Put a Close() method in the Deactivated event of the window.
|
|
|
|
|
I have a list of items defined in a ListView. When user click or tap any item, I want to show a PopupMenu just above the selected Item. How should I position the PopupMenu?
varmenu =newPopupMenu();
menu.Commands.Add(
newUICommand("Remove", (x) =>
{...
}, 1));
var chosenCommand =awaitmenu.ShowForSelectionAsync(GetElementRect((FrameworkElement)sender));
Rect GetElementRect(FrameworkElement element)
{
GeneralTransform buttonTransform = element.TransformToVisual(null);
Pointpoint = buttonTransform.TransformPoint(newPoint());
returnnewRect(point,newSize(element.ActualWidth, element.ActualHeight));
}
|
|
|
|
|
Dear friend,
Better way is use a context menu for the list & click on the list.
Onn click event of the list
ContextMenuService.GetContextMenu(listname).IsOpen = true;
List_MouseRightButtonDown
e.Handled = true;
Hope this may help u
Regards,
Satish
|
|
|
|
|
hi guy's
I want to develop an application(control pc via wp7 ) but the WP7's screen show the PC's screen.
So how I can do it? what I need (protocol RDP, TCP/IP)???
and how can I do a connection between WP7 and PC?
|
|
|
|
|
|
what r u mean ??????????????????/
|
|
|
|
|
Ignore him. He's been reported as a spammer.
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Please stand in front of my pistol, smile and wait for the flash - JSOP 2012
|
|
|
|
|
Hi I am working on Win 8 metro app buid in silverlight.
I have two controls Control1 and Control2
Control2 is inside Control1
Control2 has a listview and Control1 has buttons. Clicking on listview has to disable buttons in Control1.
I tried to achieve this from code behind by using
public bool OverriddenFlag
{
get { return _overriddenFlag; }
set
{
_overriddenFlag= value;
NotifyPropertyChanged("OverriddenFlag");
}
}
and
in xaml
<Button x:Name="ShowDetails"
FontWeight="bold" FontSize="12"
Content="+" Click="ShowDetails_Click"
IsEnabled="{Binding OverriddenFlag, Mode=OneWay}"
/>
but it didn't have the desired effect.
How can I disable buttons. Any idea?
|
|
|
|
|
nitin_ion wrote: but it didn't have the desired effect
What does that mean? The click event for the listview did not fire? The property did not get set? Property got set but button was still enabled?
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Please stand in front of my pistol, smile and wait for the flash - JSOP 2012
|
|
|
|
|
It did not disabled the button. button was still in enabled state.
|
|
|
|
|
AND?
Did the click event on the listbox not fire? Did the property not get set? What have you done to debug this?
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Please stand in front of my pistol, smile and wait for the flash - JSOP 2012
|
|
|
|
|
Yes everything fired
but
PropertyChanged event in
private void NotifyPropertyChanged shows null.
Here is the code behind in Control2 to change button state in Control1
public void Somemethod()
{
Control1 ng = new Control1();
ng.EnabAdd =false;
}
and this is the property in codebehind in Control1
public bool EnabAdd
{
get { return _en; }
set
{
_en = value;
NotifyPropertyChanged("EnabAdd");
}
}
|
|
|
|
|
Sorry I do not think you have a good grasp of what it is that you are doing.
nitin_ion wrote: public void Somemethod()
{
Control1 ng = new Control1();
ng.EnabAdd =false;
}
This will do exactly nothing except create a new control1 and then disable it before going out of scope.
Your button is not being disabled because you have bound it to a property and not changing the property value. I suspect that your NotifyPropertyChanged is null because you have not set the DataContext. "Somemethod" is not a click event handler for a listbox.
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Please stand in front of my pistol, smile and wait for the flash - JSOP 2012
|
|
|
|
|
Well yes i am new to Silverlight
SomeMethod is what i call on listviewitem click event.
I just want to changes the state of button when item is clicked. Is there any tutorial which can help me to do this?
|
|
|
|
|
finally got it like this
FrameworkElement fe = (FrameworkElement)this.Parent;
while (fe.GetType().Name != "parent")
fe = (FrameworkElement)fe.Parent;
var tyui=(Button)fe.FindName("controlintheparent");
|
|
|
|