|
yes SORRY.. lol, i thought WF meant winform... so maybey your confused about the forum? its name is (WPF / WCF / WF)
besides, I found out how noob I was, I simply had my main form launch another form giving its self as a parameter... problem solved!!!
|
|
|
|
|
Man before you say some thing be sure that you are right...
WF does not mean winform... It means Work Flow...
Have u ever heard the name of Work Flow..
|
|
|
|
|
"lol, i thought WF meant winform" yea reading my post it does really read like I think your wrong... I should sit back and reread my posts
No, I meant to show that that was probably a misconception by me... sorry for coming off as rude...
Once again I'm aware I am a noob, and my formal education is limited intro c++ (sorting, recursion, ect)
I'm coding a GUI for an SQL database for my families business, and I would love professional input..., so once again I just want to reiterate, I KNOW you know more than me, throw me some direction.
The reason I'm using Windows forms and not WPF is that I couldn't use the dataGridView object (at least as far as I know). What direction should I use to display SQL data with WPF with data-binding? I want the data to resemble excel for this particular database table.
|
|
|
|
|
Mattzimmerer wrote: I simply had my main form launch another form giving its self as a parameter... problem solved!!!
That is probably the worst way to do it.
Passing Data Between Forms[^]
|
|
|
|
|
Lol, yea probally, what should I do then?
|
|
|
|
|
Hello everybody,
I'm a starter at WPF, now i would like to make a WPF userControl library which include a Rating bar userControl. All the steps of creating the rating Bar has been done, however i would like to add a property RatingValue:
public static readonly DependencyProperty RatingValueProperty =
DependencyProperty.Register("RatingValue", typeof(int), typeof(RatingControl),
new FrameworkPropertyMetadata(0, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, new PropertyChangedCallback(RatingValueChanged)));
public int RatingValue
{
get { return (int)GetValue(RatingValueProperty); }
set
{
SetValue(RatingValueProperty, value);
}
}
private static void RatingValueChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
{
}
that the user of my UserControl can modify by a value from 0 to 5 that are shown in a dropdown list (combo box) in the Properties windows (as some exist properties of Usercontrols like Visibility, windows style, background ...)
How can i do? Thank you very much in advance,
Viet
|
|
|
|
|
possibly you can do that with some attribute or design DLL, I don't know...
but there is an easy way to achieve that without any extra work if you simply change the type of your property from an int to an enum A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station....
_________________________________________________________
My programs never have bugs, they just develop random features.
|
|
|
|
|
I have a webservice that returns data from the NW database....
product.ProductPic = (byte[])reader.GetValue(8);
On the client that is requesting the data I have code like this....
Byte[] bImage = Product.ProductPic;
System.Windows.Media.Imaging.BitmapImage bmpImage = new System.Windows.Media.Imaging.BitmapImage();
bmpImage.SetSource(new MemoryStream(bImage));
imgProduct.Source = bmpImage;
When I try to run this I get the following error...
System.Exception: Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))
From what I have read this could mean that the image is saved in a unsupported format for Silverlight. How can I know what type of image is stored in the database? Can I convert this some how?
|
|
|
|
|
|
hi ..
i need to add a User Control to another User Control in a same Solution , can anyone tell me the way to add Control???
any example???
thnxxx
|
|
|
|
|
A UserControl is a root element. You cannot have two UserControls inside a single xaml file (if that is what you meant by your question).
What you can do, however, is to have a ContentControl inside a UserControl . This ContentControl can be another xaml. Again, my assumption is that is what you wanted to do.Me, I'm dishonest. And a dishonest man you can always trust to be dishonest. Honestly. It's the honest ones you want to watch out for...
|
|
|
|
|
|
Hi Mahmood,
You can design your first UserControl and then you can add it inside your second UserControl which you placed inside your main page. Just check the following code structure:
UserControl 1: SmallLoader
============================
<UserControl x:Name="ucSmallLoader"
.
.
.
</UserControl>
UserControl 2: BigLoader
============================
<UserControl x:Name="ucBigLoader"
.
.
.
<myUc:SmallLoader ... />
.
.
.
</UserControl>
Silverlight Page: MainPage
============================
<UserControl ...
.
.
.
<myUc:BigLoader ... />
.
.
.
</UserControl>
Let's know if you have any queries. Cheers...
<b>Regards -</b> Kunal Chowdhury | Software Developer | Chennai | India | <a href="http://kunal2383.blogspot.com" alt="Visit my Blog posts">My Blog</a> | <a href="http://twitter.com/kunal2383" alt="Follow my Tweets">My Tweets</a>
|
|
|
|
|
In silverlight map control, how do we specify the map source as "http://dev.mapindia.live.com/mapcontrol/mapcontrol.ashx?v=6.2"
There are examples on doing this in javascript, but not in silverlight...
http://dev.mapindia.live.com/sdk/[^]
<script type="text/javascript" src="http://dev.mapindia.live.com/mapcontrol/mapcontrol.ashx?v=6.2"></script>
|
|
|
|
|
hi
I want to use multiple grid on UserCotrol, how can i use??
any example??
thnxx
|
|
|
|
|
A very simple way to do this would be to place multiple grids inside another control.
For e.g.
<UserControl>
<StackPanel>
<Grid></Grid>
<Grid></Grid>
</StackPanel>
<UserControl/>
|
|
|
|
|
As Abhinav stated, you can host a Grid inside a StackPanel. It's important to realise that panels are content containers, so they can be laid out inside other panels just as easily as buttons or labels can. This means that you can be very flexible with the layout so that you can host grids inside grids inside stackpanels, and so on."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
I have a control inside a datagridtemplatecolumn (in the celleditingtemplate to be accurate, please find the bold line in the xaml below)
As I have multiple grids with multiple columns of this kind I search for a generic way to get the TextBox's binding (the property name "ItemName" ín this special case) when I have a handle to the template column in code.
Alternatively I could get the property from the column x:Name, but I did not manage this either
Any help would be appreciated...
Regards
Klaus
<dg:DataGridTemplateColumn x:Name="dbcItemName" Header="{Loc C_ItemName}" HeaderStyle="{StaticResource styFilterTextBoxColumn}">
<dg:DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding Path=ItemName, Mode=OneWay}"/>
</DataTemplate>
</dg:DataGridTemplateColumn.CellTemplate>
<dg:DataGridTemplateColumn.CellEditingTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Stretch" >
<TextBox IsEnabled="{Binding IsNew}" MinWidth="30" Text="{Binding Path=ItemName, Mode=TwoWay}"/> <Button IsEnabled="{Binding IsNew}" x:Name="pbSelectItemName" Click="pbSelectItemName_Click" >...</Button>
</StackPanel>
</DataTemplate>
</dg:DataGridTemplateColumn.CellEditingTemplate>
</dg:DataGridTemplateColumn>
|
|
|
|
|
I don't quite understand your question.
A template is nothing more than a XAML fragment (i.e. a piece of text) until it is actually created.
In this case each DataGridRow create a UI component from the template.
Your question is probably wrong but a straight answer would be to enumerate the visual tree of the DataGrid until you find the collection of DataRow, and then look at the logical child UI control of each row (because the editing control is only a visual child when editing) to get the list of text boxes (1 per row), then you could work with the list of textboxes....A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station....
_________________________________________________________
My programs never have bugs, they just develop random features.
|
|
|
|
|
Super Lloyd , thank you for answering,
Maybe I have to explain more detailed:
I have a datagrid which contains multiple "normal" datagridtextcolumns and multiple datagridtemplatecolumns, each of these have the datatemplate I described in the first post.
Additionally,each column has a filter textbox (lets call it txFilter) in the column header, that allows ... yes, filtering of the datagrid
Inside my filter functionality I have to retrieve the binding of the column in which I entered something in txFilter, which works fine for "normal" columns (as they are bound).
Datatemplatecolumns are different, because they are not bound but may contain more than one bound control, in my case it is exactly one textbox.
Now I am wondering how I can retrieve to which property the textbox in the datatemplatecolumn is bound
Hope you can help
Klaus
|
|
|
|
|
I have 2 answers to your problem:
1. you are doing it wrong! how do you know there is TextBox in your DataGridTemplateColumn? There might not be!
Perhaps you sould provide the binding to the property to filter on as an attached property to your header?
2. if you know there is going to be a some text in the column, you can use the VisualTreeHelper to explore the cell, until you find a TextBlock / TextElement / Run and extract its valueA train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station....
_________________________________________________________
My programs never have bugs, they just develop random features.
|
|
|
|
|
Super Lloyd
I'd like to thank you for the support.
It was not clear to me how the datatemplate is used at runtime, so finding the textbox in the datatemplate is the wrong way, definitely.
Maybe there is a short cut for me, as I name my columns in a way that I can derive the binding from it ... but I cannot find the name (given using X:Name in Xaml) when I look into the column object during debug. Maybe I am doing something really wrong? So when please enlight me
Regards
Klaus
|
|
|
|
|
Why not use an attached dependency property on your column, such as "Filter.PropertyPath" on your column header?
Other than that the Name property should work, I wonder why it doesn't...A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station....
_________________________________________________________
My programs never have bugs, they just develop random features.
|
|
|
|
|
Sorry for getting back but as "intermediate beginner in WPF" I think I still have difficulties with the concepts, but:
Regarding the name: I do not see that the class DataGridTemplateColumn (and the normal columns) has a property "Name", so where does "x:Name" go to then and how can I get it at runtime?
Regarding the attached property: The filtering controls are plumbed into the datagridheader using a controltemplate (unfortunately not constructed by me, I followed this article Filtering the WPF DataGrid automatically via the header (inline filtering)[])
Besides the difficulty to construct the binding of the attached property I see the problem that its (the attached propertie's) binding must somehow refer to the binding of the column (which does not exist in the case of the datagridtemplatecolumn), or am I completely wrong
Thanks for your support
Klaus
|
|
|
|
|
x:Name will end up in 2 places.
1 Some WPF classes have a name property (FrameworkElement and Style for exemple) and x:Name will set it.
2. also, in case of a code behind class, the XAML precompiler will generate member with the name in x:Name, provided they are at the top level naming scope (read INameScope documentation) (i.e. not in a template)
ex:
Window1.xaml
<Window
x:Class="WpfApplication1.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Window1" Height="300" Width="300">
<Button x:Name="but" Content="Click"/>
</Window>
Window1.xaml.cs
public partial class Window1 : Window
{
public Window1()
{
InitializeComponent();
but.Click += (o, e) => MessageBox.Show("Button Clicked");
}
}
Other than that a Binding is made of 3 part, a PropertyPath, a source and a target.
The source is generally the DataContext (if not specified) and is different for each row in the grid. And the target is also different in each row (it's the cell) what you want is the PropertyPath, which can easily be set somewhere else.
mm.. reading the article... you are trying to implement UpdateFilter() and need to know the propertyName, are you?
how about you create an attached property in FilteringDataGrid called "FilterPath"?
you can use build in snippet in VS2005/2008, type "propa" followed by TAB, fill the blank!
Then when you declare your columns, set the property:
<dg:DataGridTemplateColumn
FilteringDataGrid.FilterPath="MyProperty"
x:Name="dbcItemName"
Header="{Loc C_ItemName}"
HeaderStyle="{StaticResource styFilterTextBoxColumn}">
<dg:DataGridTemplateColumn.CellTemplate>.....
...... A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station....
_________________________________________________________
My programs never have bugs, they just develop random features.
|
|
|
|
|
Super Lloyd
yes this works fine ... thanks for your help ...
Regards
Klaus
|
|
|
|