|
I want to know how to bind the data in the grid using listview control.
|
|
|
|
|
That's a fairly broad question, and not easily answered based on the level of detail in your statement (it's not really a question). Have a look at this[^] article and this[^] one.
|
|
|
|
|
Using silverlight, I need to display a world map. I should display the name of the country on keeping the mouse pointer over the country. Can anyone please help me? For example similar to this: http://whos.amung.us/maps/54u1eg18/textbook/default-orange
|
|
|
|
|
|
|
|
Good People,
I have created a custom listbox (via editing/creating my template for it). I do this via the build .dll option at start up in Expression Blend. When I use it in a project, if I resize it, everything flies apart or gets squished into each other (resizing larger or smaller respectively).
How do I make it stay together as one unit collectively so that upon resizing, it stays together?
Also, in my custom listbox, I added a listbox item and created a template for it. Alas, how do I access the custom listitem that I used the template to create? How do I bind data to it (from a CLR object)? For example, the custom list item has several labels and an image I need to change based upon what it's reading. Do I access it via procedural code (i.e. C#)? I tried, I found the custom control (i.e. this.CustomListBox), however I was unable to access any of it's content (i.e. title label and the list item box and its contents).
Thanks for any help or information you can provide.
BP
modified on Sunday, May 11, 2008 10:55 AM
|
|
|
|
|
To make sure that the resizing behaviour is correct, you should try resizing your template in blend and seeing how it behaves. Make sure that the columns and rows in the grid are setup correctly, and that the objects have the right column, row, columnspan, rowspans and margins. Double click the grid to enable row/column editing.
You can do the data binding in blend, in the project tab there are buttons to add a new data source. However I reccomend to check out the data binding documentation. As well as the articles here on code project.
Also you might want to post a bit more such as your DataTemplate the object it is for and the collection that is bound, if you have any more questions.
|
|
|
|
|
Hi,
I am creating a combo box, the database field is a binary with a true or false value.
I have to convert this and show "Lock" if the value is "true" and Unlock if the value is "False".
How do I do it with the databinding,
To begin with, I created an array,
private string[] binaryOnOffText = new string[2] { "Lock", "UnLock" };
public string[] BinaryOnOffText
{
get
{
return this.binaryOnOffText;
}
set
{
this.binaryOnOffText = value;
OnPropertyChanged("BinaryOnOffText");
}
}
And in my xaml I have used the booleantoIndexConverter,
<ComboBox ItemsSource="{Binding Path=BinaryOnOffText}" SelectedIndex="{Binding Path=OpenOnExitReq, Converter={StaticResource booleanToIndexConverter}}" >
</ComboBox>
public class BooleanToIndexConverter : IValueConverter
{
#region IValueConverter Members
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
bool boolValue = System.Convert.ToBoolean(value, CultureInfo.InvariantCulture);
if (boolValue)
return (int)1;
return (int)0;
}
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
return null;
}
#endregion
}
The binding does not work when I create the dialog(when I get the selection on the Lock irrespective of whatever value is saved), it work otherwise.
Am I missing something?
Thanks In Advance
|
|
|
|
|
Comboboxes has two sets of bindings.
One to get the data into the combobox.
The other to bind the SelectedValue of the combobox.
You need to databind the SelectValue property. Read up on this property and it will all fall into place.
modified 27-Feb-21 21:01pm.
|
|
|
|
|
How do i read up on this selectedvalue property?
|
|
|
|
|
Google: wpf combobox selectedvalue
MSDN Documentation
Visual Studio Dynamic Help
modified 27-Feb-21 21:01pm.
|
|
|
|
|
For some reason I can't watch Silverlight dnrTV presentations anymore.
http://www.dnrtv.com/[^]
I upgraded to Windows Media Player 11 last night and I suspect it may be the culprit. Strange thing is that I use WMP 11 at work and dnrTV runs OK there. Tried uninstalling/reinstalling Silverlight, to no avail. Says "Unable to load media 'dnrTV_0110.wmv'." Happens in both IE and Firefox (in IE it just hangs).
I do have some downloaded wmv files on my PC and they run OK in WMP. Channel 9 is Silverlight and that is OK. ??? Has anyone else experienced this?
Both home and work PCs are XP Pro SP2. I'm using Silverlight 1.0.
Kevin
|
|
|
|
|
Are you behind the proxy? I used to get this error when I was behind the firewall... because Firewall may block the file..
I dont have Silverlight 1.0. but I have Silvelight 2 beta1. I have checked the video and it's working fine in my machine..
|
|
|
|
|
Hi Karl,
I've just been reading this article on CP:
http://www.codeproject.com/KB/WPF/WPFMasterPageControl.aspx[^]
Did you make any headway on your amendments to Karin's initial idea? Seems like a neat solution and its something I want to implement but seems problematic at the moment in terms of these potential binding issues.
Thanks,
Jammer
Going where everyone here has gone before!
My Blog
|
|
|
|
|
Jammer,
Never got any responses at all.
modified 27-Feb-21 21:01pm.
|
|
|
|
|
Hi All,
I have a 'normal' WPF application that I've working on in Blend and VS. The problem I'm having is when debugging with break points.
When a breakpoint is hit I can't then tab away from the app i'm debugging in order to step through the code in VS ...
Any ideas?
Jammer
Going where everyone here has gone before!
My Blog
|
|
|
|
|
You're starting the application in Visual Studio right??
modified 27-Feb-21 21:01pm.
|
|
|
|
|
Absolutely ... with an F5 ...
Jammer
Going where everyone here has gone before!
My Blog
|
|
|
|
|
Jammer,
What does tab away mean?
Are you referring to ALT-TAB?
Can you switch to Visual Studio using the task bar?
modified 27-Feb-21 21:01pm.
|
|
|
|
|
Hi Karl,
Indeed ALT-TAB ...
In fact this WPF window stays on top of everything! Even other apps like Outlook!
Jammer
Going where everyone here has gone before!
My Blog
|
|
|
|
|
puzzle time.
Is this the main window secondary window?
Are you using the Top Most feature in your XAML or code?
Is this a Modal Dialog Window? In the old days we could make a window system modal.
This only happens on your system with this code and not other programs?
modified 27-Feb-21 21:01pm.
|
|
|
|
|
This is really confusing me now. The app has one window that is hosting a frame. Application pages are loaded into this frame.
I haven't applied any code to the behaviour of the window. Its not using the TopMost nor is it a modal dialog.
The only happens with this project ...
I've tried everything I can think of, i'm dumbfounded at this stage.
Jammer
Going where everyone here has gone before!
My Blog
|
|
|
|
|
Try creating a separate solution and put the window in but not the other stuff.
If that works, then keeping adding pieces until you nail it down.
modified 27-Feb-21 21:01pm.
|
|
|
|
|
Sounds like the only option at this stage! Very weird!
Jammer
Going where everyone here has gone before!
My Blog
|
|
|
|