|
It will not be listening. Only requesting data from a server that hosts the data. Sorry I miss understood.
Yeah its a tough decision, there are several options for me.
1) I can edit the data server, but its an established C++(unmanaged) application. I will have several of the senior programmers grilling me on whether I screwed up anything.
2) I could write an app that uses a different port. Then all my silverlight traffic goes to that port. I convert the data and forward. (this is my preferred approach)
3) OR Convert in the silverlight app.
What fun!!!
Programmer
Glenn Earl Graham
Austin, TX
|
|
|
|
|
I suppose option 2 is the most flexible, since you can
re-shape the data and use any transfer/serialization mechanism
available to Silverlight apps.
Have fun!
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Can any one give a sample code of how to export datagrid to excel?
|
|
|
|
|
And the journey is complete. This is a clueless post. You can't export a datagrid to Excel. You would export the DATA to Excel, and you'd do that the same way if you were using WPF or not. Ergo, this is not a WPF question and it's one easily answered with a google search.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Is there a way to change alignment of a column within a WPF ListView. I've got a Cell template like the following:
<DataTemplate>
<TextBlock Text="{Binding Path=C1}" HorizontalAlignment="Right">
<DataTemplate>
This doesn't work though because I've got to change the cell container's Horizontal alignment.
Also, when using a ListView.ItemContainerStyle, is it possible to trigger off the column by a name or index? As an example, how would one make the background of a column red from the ItemContainerStyle?
Thanks in advance!
|
|
|
|
|
Are you talking about the content alignment of column cells or the column alignment within the listview?
For content:
I think you may want to use HorizontalContentAlignment="Right".
|
|
|
|
|
On which object do I set HorizontalContentAlignment? The TextBlock doesn't have it. I'm sure the container that the text box is in has it, but how do I reference that object to set the value?
|
|
|
|
|
My mistake, I was thinking TextBox, not TextBlock.
For TextBlock Use: TextAlignment="Right"
|
|
|
|
|
Although, this works if the TextBlock's width is specified, I really want to right align to the ListView's grid column and allow the TextBlock's width to expand or contract with the column.
By specfiying a width to the TextBlock, when the column is expanded beyond the width of the TextBlock, the text though aligned to the right of the TextBlock is not aligned to the right of the column.
I believe that one needs to modify the parent's panel's content alignment; though, how do I manipulate that style. Can I use a trigger within a Control template for the ListBoxItem? If so, how do I switch on the column number so that only specified columns are right aligned?
|
|
|
|
|
If the textblock has Height and Width set to "Auto" it should resize according to the parent, and setting the TextAlignment should be independent of the textblock size. However, I have not messed with the listview control much myself. I prefer the DataGrid provided in the WPF Toolkit. Sorry if this does not help.
|
|
|
|
|
Never used the WPF toolkit, but thanks for the pointer. The DataGrid appears to have a number of features that will make it a much more attractive solution. Thanks for the comment. That's just what I needed.
|
|
|
|
|
Hello
I'm scaling some Polyline s, and for some I want the thickness of the line to follow the scale, works fine by default, but for some I want to keep a fixed pixel width regardless of scale.
Is that possible in some simple way or do I have to calculate the StrokeThickness myself?
thanks in advance
Niklas
|
|
|
|
|
Niklas Lindquist wrote: I'm scaling some Polylines
How are you currently doing this?
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Oh, sorry, I'm setting a TransformGroup containing a ScaleTransform and a TranslateTransform , on the Polyline s RenderTransform property.
I managed to recalculate the width, but it adds a lot of overhead in adding a number of event handlers. So I'm still interested in a simpler way to do this.
/Niklas
|
|
|
|
|
Niklas Lindquist wrote: I'm still interested in a simpler way to do this
I don't know of a simpler way. My guess is that you'd need to
scale/translate the polyline points separately and create a new PolyLine
from those points if you want to prevent the strokethickness from getting
transformed.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
That's just as bad as recalculating the width I'd guess (if not worse, performance wise).
Thanks for taking the time.
/Niklas
|
|
|
|
|
hello everybody Iwant to create video chat application in wpf and that should be peer to peer. I developed an application by looking article at codeproject wpf/wcf peer to peer chat application . But thats simply broadcasting my video to other peers and when the other peer starts sharing his cam then the both stream mixes up and I get output on my screen in which the streams of both the users mixes up and I we see pictures of both the users alternatively. and moreover it has performanve issuses also. video quality is perfect but speed is very very slow. So plz guide me how to do this???????????
|
|
|
|
|
I suspect you need to fix the code you're using to not send both streams across the same connection, and that you need a faster internet connection to get good video.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Thanks for replying but can u suggest me someway. how to do this.In my peer to peer application there is only one function that I have declared in the interface and is automatically called for all the nodes in the mesh. and that fnction is accepting "stream " of the person who started sharing his video to others,and this fnctio is called for each node, If now some other user starts his video sharing then it will again call the same function that was already running for this user and the rest of users and at thuis stage both the streams get mixed and I havnt found a way to separate these streams and call the function that is accepting stream.
|
|
|
|
|
HI,
This is from Chandrakanth.
Working on WPF Project.
Actually i have one CheckButton called as CheckALL. I have one DataGrid.
DataGrid Consist of some rows.
I want to Click on that CheckAll Button than all the rows in DataGrid should check.
How can i write that in WPF. Can any one tell me about that.
Thanks and Regards
Chandrakanth
Responses
|
|
|
|
|
You would have a boolean property on the data, let's call it Selected. Then you bind your checkbox to the property, and your code simply updates the data - leaving the binding engine to ensure that the checkbox is updated as a result. Don't try to do something like this in the UI, use the data to control it.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
HI,
Pete O'Hanlon,
Thaks for the early reply.
Once Again from Chandrakanth.
Actually i have bind the data to the DataGrid Control.
I have 4 rows in that dataGrid with every row containing CheckBox in
the first Column.
My Problem How to Check all the rows in the DataGrid, when i
click on CHECKALL button.Actully i was tried with some code to
check all Rows in DataGrid. But Unable to that. i need help on that.
If you have any code on that Please reply to me.
Thanks and Regards
Chandrakanth
|
|
|
|
|
I've already told you how to do it. Don't try to programatically check items in the grid, use the model to do this. Suppose you have a model that looks like this:
public class MyItem : INotifyPropertyChanged
{
private bool _selected;
private string _name;
private event PropertyChangedEventHandler _changed;
public event PropertyChangedEventHandler Changed
{
add { _changed += value; }
remove { _changed -= value; }
}
public bool Selected
{
get { return _selected; }
set
{
if (_selected != value)
{
_selected = value;
OnChanged("Selected");
}
}
}
}
public class MyViewModel
{
private ObservableCollection<MyItem> _items = new ObservableCollection<MyItem>();
public void HandleCheckAll
{
foreach (MyItem item in _items)
{
item.Selected = true;
}
}
public ObservableCollection<MyItem> Items
{
get { return _items; }
}
}
All you need then is a command that calls HandleCheckAll and the grid binding to the MyViewModel.Items . The checkbox is bound (two-way) to Selected , and job's done.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Apologies in advance, I suspect there may be an obvious answer to this, but I have searched these forums and google and not really been able to determine the solution.
This is for a WPF application, but I think it is a more general programming question.
We have an ObservableCollection(of T), where we need do do some validation of the member object, T. One of the rules is that a property of T (say name) cannot already exist in the collection.
Our validation class is instantiated from the xaml, so I don't know of any way to pass in the reference to the ObservableCollection. However, this is needed to be able to step through the collection, to see if name has already been used, and report an error (if needed).
One solution I can see is that the class T could have a property which is an ObservableCollection of T, and then you pass the parent collection into the member object. I think this will solve the issues, but something says to me this would be bad practise... Can anyone clarify whether this will cause errors or should be avoided? Can anyone suggest an alternative?
More specifically, say we define Person
Public Class Person
Public Sub New(ByVal Name As String, ByVal People As ObservableCollection(Of Person))
...
End Sub
Public Property Name() As String
...
End Property
Public Property People() As ObservableCollection(Of Person)
...
End Property
End Class
Then elsewhere make a collection of Person
Dim MemberList As New ObservableCollection(Of Person)
MemberList.Add(New Person("John", MemberList))
MemberList.Add(New Person("Fred", MemberList))
MemberList.Add(New Person("Jane", MemberList))
MemberList.Add(New Person("Andrew", MemberList))
Then we can bind say a WPF DataGrid to MemberList, and use validation to check our rule, to check that the Person name has not already been used in the ObservableCollection(of Person) - ie MemberList. The approach here will work, but I am concerned that there might be underlying problems - some circular reference or something (or else just not good practise).
Thanks for any suggestions.
Tim
|
|
|
|
|
Tim
What you are after is an ObservableDictionary. The good Dr WPF has a sample implementation of one here[^].
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|