|
Yes, it's a property of the object, but what type is it? Is it a class in its own right? If so, you need to bind to a property in the instance of WpfDownloads (or you need to write a converter).
"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
|
|
|
|
|
Try this:
<ListView
x:Name="InnerListView"
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
x:FieldModifier="public"
BorderBrush="Black"
BorderThickness="1"
ItemsSource="{Binding}">
<ListView.View>
<GridView>
<GridViewColumn Width="100" Header="Downloads">
<GridViewColumn.CellTemplate>
<DataTemplate>
<DockPanel>
<Grid DockPanel.Dock="Right" >
<Label Grid.Column="1" Content="{Binding Path=WpfDownloads}" />
</Grid>
</DockPanel>
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
</GridView>
</ListView.View>
</ListView>
|
|
|
|
|
Oh, and that Grid.Column="1" doesn't need to be there.
|
|
|
|
|
So why didn't you just edit your post
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Didn't feel like it. And thought it would be more obvious that I made a change if I replied to my own post. Would have been even more obvious if I replied to JSOP directly to notify him of my change (that way, he gets notified via email of the new post), but then I'd have to refer to my previous post and I didn't really want to deal with that.
|
|
|
|
|
Well, it actually is needed. I just didn't provide all of the xaml...
.45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
That worked. Now all I have to do is get past some of the built-in inability that is the ListView (no built-in sorting, no ability to freeze column widths, no ability to set a column that grows to fill remaining space, etc).
.45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
|
No worries - listview does it with some bullying.
.45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
Hi,
in a WPF application, I have two windows:
MainWindow - with the read-only ListView1 and the EditItem button
EditWindow - with Submit button.
After clicking on the EditItem button, a new EditWindow is shown, binded to the ListView1.SelectedValue . After clicking Submit , the updated values should be saved back to the underlying data classes and the ListView1 should be updated.
As far as I understand, the OneTime binding mode with explicit update is what I am looking for. Unfortunately, I have found no way how to set up the binding of the EditWindow in this OneTime mode (I do not see setting OneTime mode for each textbox as acceptable workaround).
How to open the EditWindow , bind it to the ListView1.SelectedValue and update it after clicking on the Submit button?
Currently, I have the following code for opening the EditWindow :
EditWindow frm = new EditWindow();
frm.Owner = this;
frm.DataContext = ListView1.SelectedValue;
frm.ShowDialog();
Thank you.
|
|
|
|
|
Hi,
This is just a guess, but maybe if instead of setting the edit form datacontext directly to the selected value, try using a one-time data binding instead there. This is just a guess.
|
|
|
|
|
Hi,
thank you for your tip and sorry for my delay in answering.
Unfortunatelly, One-time data binding means that the IDataError or ExceptionValidationRule logic would not provide user immediate feedback on invalid values. So I need something like data object transaction.
As a result, I have created a deep copy of edited data row and after submitting the edit form, I am copying the values back to the original row object. Quite boring, but as far as I know, there is no better solution.
|
|
|
|
|
How do I work with WIndows Forms in WPF?
In my WPF program I created a Windows Form class.
In this Form, I placed an OK button and I went into the properties of the button and set the DialogResult to OK.
Now, I am calling this Dialog (Window Form) from the MainWindow.xaml.cs:
DialogResult dres;
dres = form.ShowDialog();
if (dres != DialogResult.OK) return;[/code]
The compiler is complaining:
Error 3 'System.Nullable<bool>' does not contain a definition for 'OK' and no extension method 'OK'
accepting a first argument of type 'System.Nullable<bool>' could be found (are you missing a using directive
or an assembly reference?)
|
|
|
|
|
WinForms uses its own version of DialogResult. You need to add a reference to Windows Forms to your project and then reference the OK as System.Windows.Forms.DialogResult.OK .
"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
|
|
|
|
|
Is it possible to subclass a Window in WPF, so that I can create a base Window class? If so, how?
Everything makes sense in someone's mind
|
|
|
|
|
Hi Kevin,
Create your CustomWindow derived from Window and if you want, you can create the Template for your new Window and assign to it. Let me know if you need more help on it.
Don't forget to Click on [Vote] and [Good Answer] on the posts that helped you.
Regards - Kunal Chowdhury | Software Developer | Chennai | India | My Blog | My Tweets | Silverlight Tutorial
|
|
|
|
|
I'd like to see an example of that, if you have one.
Everything makes sense in someone's mind
|
|
|
|
|
Hi,
Have a look into this blog post for Silverlight: Creating a Custom Out-Of-Browser Window in Silverlight[^]
There are some good example for WPF too. I will share those links if I recall the URLs from my bookmark.
Till then check for the Silverlight one. You will get the basic understanding from the same.
Let me know, if you have any queries.
Don't forget to Click on [Vote] and [Good Answer] on the posts that helped you.
Regards - Kunal Chowdhury | Software Developer | Chennai | India | My Blog | My Tweets | Silverlight Tutorial
|
|
|
|
|
Hi Experts,
I googled a lot to display multi columns on selecting a combobox(i.e datagridcombobox) in WPF datagrid, but couldn't find relevant solution. Pls help.
-Thanks in advance
Kartheesh.
|
|
|
|
|
This may be a trivial question but I'm completely new to Silverlight and right now I just want to know if I can embed a Silverlight control in my "classic" AST.NET (3.5) WebForm page?
Googled for samples but no result.
_____________________________
...and justice for all
|
|
|
|
|
You cannot embed silverlight control individually.
You need to generate .xap file from the silverlight page/control
and then you can easily embed it in aspx page as an object.
Find following code to embed .xap file.
<div id="silverlightControlHost">
<object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="100%" height="100%">
<param name="source" value="ClientBin/SLNetWCF.xap"/>
<param name="onError" value="onSilverlightError" />
<param name="background" value="white" />
<param name="minRuntimeVersion" value="3.0.40624.0" />
<param name="autoUpgrade" value="true" />
<a href="http://go.microsoft.com/fwlink/?LinkID=149156&v=3.0.40624.0" style="text-decoration:none">
<img src="http://go.microsoft.com/fwlink/?LinkId=108181" alt="Get Microsoft Silverlight" style="border-style:none"/>
</a>
</object><iframe id="_sl_historyFrame" style="visibility:hidden;height:0px;width:0px;border:0px"></iframe></div>
HTH
Jinal Desai - LIVE
Experience is mother of sage....
|
|
|
|
|
d00_ape wrote: Googled for samples but no result.
You cannot do this and that is why you found no results.
As is posted in the other answer, you can embed your xap control inside the page.
You can probably search for some controls for Asp.net which do something similar to what you are using in Silverlight.
My signature "sucks" today
|
|
|
|
|
Hi,
Is there any way to remove(or hide) the legend from the charting control(PieSeries) and bind the ItemKey instead of ItemValue to display the ItemKey on mouseover .
As I have the following colloection:
ItemKey ItemValue
Delhi - 5
UP - 4
MP - 3
I am binding the following way:
<chartingToolkit:PieSeries <br />
IndependentValueBinding="{Binding ItemKey}" <br />
DependentValueBinding="{Binding ItemValue}"<br />
AnimationSequence="Simultaneous"<br />
IsSelectionEnabled = "true">
Thanks,
Sri
|
|
|
|
|
You need to use style templates as shown here.
My signature "sucks" today
|
|
|
|
|
Is it possible to bind multiple values to a single component in XAML?
I want to put two values into a single TextBlock with one binding attribute. Possible?
.45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|