|
Haha... probably more of a treeview control issue since its weird with the keyboard. That's why I said what I did. Some keys work one way and other keys work a different way.
|
|
|
|
|
Are there known issues with WPF GDI with Windows XP? I have a bunch of observations of a legacy WPF application that we have only on XP but works fine with Weven and others.
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
The woods are lovely, dark and deep,
But I have promises to keep,
And miles to go before I sleep,
And miles to go before I sleep!
|
|
|
|
|
WPF is flakey on XP. Known issue.
|
|
|
|
|
WPF is fine on XP ... when there are issues, it's because of crappy graphics cards (in my experience).
WPF uses DirectX; the graphics card needs to support some minimum level of DirectX.
|
|
|
|
|
Not true. XP uses a completely different rendering mechanism then Windows 7. By default WPF on XP is software only. On Vista / Win7 its hardware accelerated.
|
|
|
|
|
|
Cool link. What's your point? Have you ever tried retrieving the rendering tier on XP?
|
|
|
|
|
Since you still don't "get it", we're done.
|
|
|
|
|
It's not GDI in WPF. Do these XP machines have NVidia cards in them by any chance? The NVidia drivers were flaky as dammit on XP. Also, the WPF stack took some major improvements in WPF 4 on W7.
One thing to do - find out if the WPF app is performing software or hardware rendering on your XP box. Have a look at this[^].
|
|
|
|
|
<pre lang="css">We have a Datagrid, as Show in the Above Image.
The 1st Row in the Datagrid in a Parent Record, on ComboBox selectionChanged event. the Two records are being populated as ChildRecords.
The FirstColumn in the DataGrid is a Combobox and its selectedValue comes from a Field, ItemId.
The problem is happening when The Grid is binding with the Child Records, the Combobox selection is always happening to be the Last ItemId for all Combobox's in this Column.
The result required:
The Each ComboBox in each Row should have the SelectedValue as of its own Record Set.</pre>
|
|
|
|
|
I need help to find (or make) a control for windows environment (xaml/wpf) that scroll up automatically lines of text in a specific speed. vertical scroll.
like a News Scroller of news sites...
thanks.
|
|
|
|
|
|
Hi,I am having one problem related to ComboBox of DataGrid. Data is binding but it is not showing in the ComboBox after binding. My xaml code is like below.
<my:DataGridTemplateColumn Header="UsgSrc">
<my:DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<ComboBox Name="cbUsgSrc"
ItemsSource="{Binding Source={StaticResource UsgSrcUOMS}}"
SelectedValue="{Binding Path=UsgSrc}"
SelectedValuePath="UtType"
DisplayMemberPath="UtType">
</ComboBox>
</DataTemplate>
</my:DataGridTemplateColumn.CellTemplate>
</my:DataGridTemplateColumn>
I am assigning the data to combo box in the code behind like below.
<pre lang="c#"> ObjectDataProvider UsageSrcUOMS = null;
UsageSrcUOMS = (ObjectDataProvider)FindResource("UsgSrcUOMS");
UsageSrcUOMS.ObjectInstance = objUtView;
Microsoft.Windows.Controls.DataGridCell cell = obj.GetCell(dgMtrHdr, J, 11);
if (cell != null)
{
ContentPresenter panel = cell.Content as ContentPresenter;
if (panel != null)
{
ComboBox cmbUsUtilit = obj.GetVisualChild<combobox>(panel);
cmbUsUtilit.IsEnabled = true;
if(objUtView!=null)
cmbUsUtilit.ItemsSource = objUtView;
cmbUsUtilit.SelectedIndex=2;
}
}
Please help me why the data is not displaying in the combo box after binding.
|
|
|
|
|
Your XAML declares a StaticResource for the binding, which does not exist at load time; see the discussion here[^].
Use the best guess
|
|
|
|
|
Hi Guys, I have a nice working app in Windows Forms. I am attempting to port it to WPF and I am stuck with selecting a row and getting a value from one of the columns.
Apologies for the long code:
In Windows Forms App I do the below:
private void lstFiles_DoubleClick(object sender, EventArgs e)
{
if (lstFiles.SelectedItems.Count != 0)
{
string file = lstFiles.SelectedItems[0].Text;
openFormGeneral(file);
}
}
In WPF .xaml:
<ListView x:Name="lstFile" Height="357" HorizontalAlignment="Left" Margin="18,144,0,0" VerticalAlignment="Top" Width="550"
ItemsSource="{Binding songDetails}"
MouseDoubleClick="lstFile_MouseDoubleClick"
IsSynchronizedWithCurrentItem="True"
SelectedItem="{Binding Path=SelectedSong}">
<ListView.View>
<GridView>
<GridViewColumn CellTemplate="{StaticResource FirstCell}" Width="30" />
<GridViewColumn Header="File Name" DisplayMemberBinding="{Binding FileName}" />
<GridViewColumn Header="Title" DisplayMemberBinding="{Binding Title}" />
<GridViewColumn Header="Artist" DisplayMemberBinding="{Binding Artist}" />
<GridViewColumn Header="Album" DisplayMemberBinding="{Binding Album}" />
<GridViewColumn Header="Set" DisplayMemberBinding="{Binding Set}" />
<GridViewColumn Header="Genre" DisplayMemberBinding="{Binding Genre}" />
<GridViewColumn Header="Language" DisplayMemberBinding="{Binding Language}" />
<GridViewColumn Header="File Path" DisplayMemberBinding="{Binding FilePath}" />
</GridView>
</ListView.View>
</ListView>
I Populate the ListView as follows:
public class songDetails
{
public string Title { get; set; }
public string Artist { get; set; }
public string Track { get; set; }
public string Set { get; set; }
public string Album { get; set; }
public string Genre { get; set; }
public string Language { get; set; }
public string FileName { get; set; }
public string FilePath { get; set; }
}
public IList<songDetails> songDetail { get; set; }
public void AddFile(ID3Info File)
{
lstFile.Items.Add(new
{
FileName = File.FileName,
Artist = File.ID3v2Info.GetTextFrame("TPE1"),
Title = File.ID3v2Info.GetTextFrame("TIT2"),
Track = File.ID3v2Info.GetTextFrame("TRCK"),
Album = File.ID3v2Info.GetTextFrame("TALB"),
Genre = File.ID3v2Info.GetTextFrame("TCON"),
Language = File.ID3v2Info.GetTextFrame("TLAN"),
FilePath = File.FilePath
});
artist = File.ID3v2Info.GetTextFrame("TPE1");
track = File.ID3v2Info.GetTextFrame("TRCK");
set = File.ID3v2Info.GetTextFrame("TPOS");
title = File.ID3v2Info.GetTextFrame("TIT2");
album = File.ID3v2Info.GetTextFrame("TALB");
genre = File.ID3v2Info.GetTextFrame("TCON");
language = File.ID3v2Info.GetTextFrame("TLAN");
InitializeComponent();
this.DataContext = this;
}
How do I access the FilePath from the ListView with MouseDoubleClick event? Thanks in advance
Excellence is doing ordinary things extraordinarily well.
|
|
|
|
|
You bound the SelectedSong so SelecedSong.FilePath should contain your information provided you double clicked on a row so test for null!
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hi Mycroft. Thanks for the reply. This may sound stupid but how do I do that? I have tried numerous things and nothing works or I get a very long string of all the items in the object returned.
Excellence is doing ordinary things extraordinarily well.
|
|
|
|
|
Wherever this property (SelectedSong) is declared is where you object is
SelectedItem="{Binding Path=SelectedSong}"
In your doubleclick event you need to reference the SelectedSong
string sPath = class.SelectedSong.FileName
If you are using MVVM then class = your viewmodel.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hi Mycroft. Apologies for taking this long to reply. Been a little busy. I tried the below and I get the SelectedItem but it does not get passed to "theSong". Am I going crazy or am I just missing the point completely here?
private void lstFile_MouseDoubleClick(object sender, MouseButtonEventArgs e)
{
try
{
var theSong = this.lstFile.SelectedItem as songDetails;
if (theSong != null)
{
string filePath = theSong.FilePath;
}
}
catch (Exception ex)
{
System.Windows.Forms.MessageBox.Show(ex.Message.ToString());
}
}
Excellence is doing ordinary things extraordinarily well.
|
|
|
|
|
You are missing the point completely you are thinking like winforms, stop.
You should not/never be referencing the controls in the view but the collection it is bound to in you viewmodel or code behind. Stop trying to get the info from the list control and look in the SelectedSong property where you have bound the SelectedItem to!
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
I bound the SelectedSong to a textBox and it works now. Not the cleanest way of doing things but it works.
Thanks
Excellence is doing ordinary things extraordinarily well.
modified 3-Apr-13 17:25pm.
|
|
|
|
|
I have a requirement to display a collection of sections, each section needs needs to show a few combos, a couple of large textboxes, probably a grid and support drag and drop files.
I was thinking of using a listbox of user controls, the user control would be an expander (telerik) with all the bits in it.
My issues is how to put together the collection/control/viewmodel. Building the VM that accepts a SelectedSection and loads the static lists for the combos etc is not a problem. I can then bind the view datacontext to the viewmodel.
I would then use the UC as the datatemplate of the listbox. How do I bind the SectionsList collection to the listbox and the UC data template.
Are there any good examples of this!
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
You should not expose a collection of user controls, or any control for that matter. Define a class called Section (whatever the hell that is) that contains all the data for a section. Then define an ObservableCollection<Section> and expose that from your VM and bind it to the ListBox ItemsSource. Then simply define the ItemTemplate for the ListBox and you are good to go.
Your ItemTemplate would define the controls and their layout and bind them to the Section object which will be the ListBoxItem content.
|
|
|
|
|
This is fine for a standard list of items, I need a UC and a VM for each item in the list.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Not quite sure what you mean. When you say "UC", you should be using a DataTemplate that defines that "UC". When you say "VM" for each item, that would be your Section object. In fact, if you want to argue semantics, your DataTemplate could just be your user control. It would inherit the DataContext.
|
|
|
|