|
Mine just works noraml. Are you setting any styles ?? might be the reason.
|
|
|
|
|
As I mentioned, there are no styles or anything applied to my tree view.
Here's an example as basic as I can make it.
<Window x:Class="TestProject.TestWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Window7" Height="119" Width="92"
xmlns:local="clr-namespace:TestProject.Breeze">
<TreeView Name="_treeView1">
<TreeViewItem Header="Employee1 Very Long String">
<TreeViewItem Header="Jesper"/>
<TreeViewItem Header="Aaberg"/>
<TreeViewItem Header="12345"/>
</TreeViewItem>
<TreeViewItem Header="Employee2">
<TreeViewItem Header="Dominik"/>
<TreeViewItem Header="Paiha"/>
<TreeViewItem Header="98765"/>
</TreeViewItem>
</TreeView>
</Window>
I'm absolutely stumped. And it occurs on my collegues' computers as well.
|
|
|
|
|
Do you see the horizontal scrollbar? What happens if you stretch the window horizontally, and then expand the treeview? I've just run your sample and it behaves the way I'd expect it to - you see the small vertical scrollbar because there's a horizontal scrollbar taking up space.
"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
|
|
|
|
|
I fiddled a bit with my code and found the cause, even though I don't really understand why.
My application uses a directx renderer from a DLL that's written in C++. To init the renderer, I pass it the WPF window's hwnd by using WindowInteropHelper. Now the interesting bit: If I init the renderer before creating and showing my modeless dialogs (the ones with the scrollbar problem), the scrollbars don't appear correctly. But if I init the renderer *after* creating the dialogs, the scrollbars are fine.
If anyone has an idea of why this happens, I'd be happy to hear it!
|
|
|
|
|
Hi,
In WPF application I want to fetch collection object and bind that with radio buttons. But I can’t do that directly as there is no property like ItemsSource available for radio button so I researched for it and found one example on below link
http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/5137aabc-bb3a-478a-9438-bc93dd9cc0ac/
Example is working fine. But In my project the method that would be invoked has a collection return type and I don’t know what should be the value for ObjectType instead of enum
<objectdataprovider x:key="WindowStyles" methodname="GetValues" xmlns:x="#unknown">
ObjectType="{x:Type sys:Enum}" >
<objectdataprovider.methodparameters>
<x:type typename="WindowStyle">
What value do I need to set for ObjectType="{x:Type sys:Enum}" > property
Thanks & Regards,
Deepak.
|
|
|
|
|
If you want to apply a collection to a radiobutton, then you're better off doing this like this[^] sample.
"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
|
|
|
|
|
Hi,
Can we use navigation in windows. I want to move to anotherwindow on clicking Login button in one window.I also want to store some session values.Ihad done all these in Page. But i want the application window to be small.Hence i want to do it in window.Any idea!
Gomathi R
|
|
|
|
|
GomathiR wrote: Ihad done all these in Page. But i want the application window to be small.Hence i want to do it in window
What do you mean ? What page are you talking about ?
Have you taken a look at the Navigation service feature WPF provides ? See here Link[^]
I have not used it but it seems to be for both standalone and borwser applications.
|
|
|
|
|
You could show your login screen as a modal dialog. WPF is perfectly happy with you displaying dialogs.
"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
|
|
|
|
|
Hi, i am using this method only. But it is applicable for Page navigation only.I want window navigation.
Gomathi R
|
|
|
|
|
GomathiR wrote: But it is applicable for Page navigation only
No it's not. A standard Windows application can show a Dialog. What you could do - and this is a hack, is show the login dialog before you call InitializeComponent(); in the window class. Then, call Application.Shutdown(); if the login fails.
"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
|
|
|
|
|
Thanks Pete. But now i am looking at another serious problem. I am using infra grid in my page. I want to perform edit operation in it. I found a method which works only when "Select *" is used.And also it displays two objects in the grid.
Any idea regarding this.very urgent
Gomathi R
|
|
|
|
|
I don't use the Infra grid, so I can't help you on this. If you can't figure it out, you should raise this on the Infragistics support forums - they are the best place to figure vendor specific issues out.
"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
|
|
|
|
|
please send some sample project for Role-base authorization i.e secure login page with roles ...
thanks in advance..
Ramkumar(senior pgmr)
|
|
|
|
|
|
Hi All,
I have just started playing with this for the first time. I have set up a Class that inherits from ValidationRule and just popped a Console.WriteLine in there for now ... anyone know why this isn't being invoked?
<ComboBox.ItemsSource>
<MultiBinding Converter="{StaticResource BestGuessFieldLabelDropDownListConverter}"
UpdateSourceTrigger="PropertyChanged" ValidatesOnDataErrors="True">
<MultiBinding.ValidationRules>
<l:MappingValidationRule/>
</MultiBinding.ValidationRules>
<Binding RelativeSource="{RelativeSource FindAncestor, AncestorType={x:Type wizard:Wizard}}" Path="DataContext.SelectedDataMapping" />
<Binding RelativeSource="{RelativeSource self}" />
<Binding RelativeSource="{RelativeSource FindAncestor, AncestorType={x:Type wizard:Wizard}}" Path="DataContext.AnalyseResults" />
</MultiBinding>
</ComboBox.ItemsSource>
|
|
|
|
|
The Validation fires when the binding to Source is being updated. More clearly stated in MSDN,
"Validation usually occurs when the value of a target is transferred to the binding source property. This occurs on TwoWay and OneWayToSource bindings. To reiterate, what causes a source update depends on the value of the UpdateSourceTrigger property, as described in the What Triggers Source Updates section." Link[^]
You might want to have a look here[^] also.
|
|
|
|
|
Indeed. Whilst I was debugging I came to this conclusion! Thanks for the reply.
Seems this is not the droid I was looking for ...
|
|
|
|
|
I'm writing a listview:
<StackPanel Margin="8">
<ListView Name="listView" ItemsSource="{Binding}">
<ListView.View>
<GridView>
<GridViewColumn Header="Name" DisplayMemberBinding="{Binding Name}" />
<GridViewColumn Header="Age" DisplayMemberBinding="{Binding Age}" />
<GridViewColumn Header="Grade">
<GridViewColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding Grade}" Foreground="{Binding GradeColor}"/>
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
</GridView>
</ListView.View>
</ListView>
</StackPanel>
The foreground color of column 'Grade' is decided by the property GradeColor. It can be Green, Yello and Red.
When I select an item in the listview, the background color of the selected item turned to blue, and the foreground color of the first two column turned to white, but the foreground of the 'Grade' column didn't change to white, which cause the text is unreadable when the item is selected.
Is there any way that I can make the foreground of the 'Grade' column to be white like the other columns when the item is selected? Thx!
|
|
|
|
|
I think maybe this[^] will help you. It uses a standard listbox but I think it would work for the listview also.
|
|
|
|
|
Hi Ray, thanks for your reply. I made some changes on the TextBlock and fixed the problem.
<StackPanel Margin="8">
<ListView Name="listView" ItemsSource="{Binding}">
<ListView.View>
<GridView>
<GridViewColumn Header="Name" DisplayMemberBinding="{Binding Name}" />
<GridViewColumn Header="Age" DisplayMemberBinding="{Binding Age}" />
<GridViewColumn Header="Grade">
<GridViewColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding Grade}">
<TextBlock.Style>
<Style>
<Style.Triggers>
<DataTrigger Binding="{Binding Path=IsSelected, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type ListViewItem}}}" Value="False">
<Setter Property="TextBlock.Foreground" Value="{Binding Path=GradeColor}"/>
</DataTrigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
</TextBlock>
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
</GridView>
</ListView.View>
</ListView>
</StackPanel>
|
|
|
|
|
I want to do it with out writing a code ( write only in the xaml ).
I remember that i done it once but i dont remember how i did it.
|
|
|
|
|
Take a look at Style triggers[^]. Hope that refreshes your memory.
Looking at the your questions, I think you should read a WPF book before you continue with whatever you are doing.
Edit - Also, having your question in the subject of the post is not a good way of posting your questions.. If you want help, learn to respect the people who will be helping you.
|
|
|
|
|
i created a silverlight project,and add some TextBox control on it,but i want to format the string which put into the TextBox,for example the length,and ASCII or Unicode,But how could i achieve it,any one help me!
Thank you in advance.
|
|
|
|
|
Where's the string coming from?
You can do anything you want to the string before setting it as
a textbox's text.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|