|
Hoo boy, there's a big catch in sorting this that you need to be aware of. The Group Name is not a unique property. What do I mean by this? Well, suppose you create a usercontrol that consists of a group of radio buttons with a single group name, and then you apply that control in more than one location, then the group name would span ALL the radio buttons that contain this group name.
This is a "by-design" feature of WPF, which is intended to allow you to spread your radio buttons across multiple containers.
|
|
|
|
|
Shouldn't really be an issue since you need to iterate through the visual tree to find all the radio buttons.
|
|
|
|
|
It is if you start too high up the Visual Tree. In the example I talked about above, if you start at the root node, you will hit this problem.
|
|
|
|
|
Thank you all for The Assistance
Cheers
|
|
|
|
|
Hello,
I have a frame grabber and a DLL suplied by the FG company which alows me grab frames from the grabber.
When i write an application which directly interacts with the FG DLL every thing works fine:i initialize the FG and every captured frame the DLL trigers an event and the event handler is in my application.
What i did next is to write my own DLL which will wrap the FG DLL and will grab frames and hand it to the application.
The DLL that i wrote i used the MAF technology so my DLL is actualy an addin.
The problem is that the event handler in my addin never executed though i use the same initializations as before.
It seems that the event either never triggered or for some reason the event handler dont catch the event.
Any body have an idea for this problem?
Thanks
|
|
|
|
|
Hi,
I've stated to learn WPF and facing some binding problems when trying to bind data to data grid.
My ViewModel contains an observable collection which bounds to a data grid.
Each item in the collection contains a user name and other additional info.
One of the requirements is to display each item in the data grid,
while each user will have its own color(which is part of the additional info).
For some reason I can't find a way to bind the row background color.
My XAML looks like this:
<DataGrid AutoGenerateColumns="False" ItemsSource="{Binding PostsCollection}">
<DataGrid.Columns>
<DataGridTextColumn Header="UserName" Binding="{Binding UserName}"/>
<DataGridTextCOlumn Header="Status" Binding="{Binding Status}"/>
</DataGrid.Columns>
</DataGrid>
Can anyone help me with this issue?
Thanks,
Best regards,
Eli
|
|
|
|
|
Use the Background and AlternatingRowBackground properties.
|
|
|
|
|
Hi
Background and AlternativeRowBackground isn't good enough.
As I mentioned before , the color of each row shall be retreived from the model(stored in the database).
Also,there can be more than 2 users,and each user have it's own color.
Tanks for your help,
Eli
|
|
|
|
|
You will need to create a RowStyle for your DataGrid and bind the Background property to the ColourProperty on your class. Something like this:-
<DataGrid ItemsSource="{Binding Path=PostCollection}" AutoGenerateColumns="False">
<DataGrid.RowStyle>
<Style TargetType="DataGridRow">
<Setter Property="Background" Value="{Binding Path=RowColour}"/>
</Style>
</DataGrid.RowStyle>
<DataGrid.Columns>
<DataGridTextColumn Header="UserName" Binding="{Binding UserName}"/>
<DataGridTextColumn Header="Status" Binding="{Binding Status}"/>
</DataGrid.Columns>
</DataGrid>
This obviously assumes the colour property of your user class is called RowColour and that it returns a Brush type. If not you will need to provide a converter if your property returns a Color or string type.
Hope this helps
When I was a coder, we worked on algorithms. Today, we memorize APIs for countless libraries — those libraries have the algorithms - Eric Allman
|
|
|
|
|
It sure did...
Wow...I guess WPF is much more difficult than i thought.
Thanks a lot..
Best regards,
Eli
|
|
|
|
|
Glad to help
eli15021979 wrote: Wow...I guess WPF is much more difficult than i thought.
Once you get the hang of it, it becomes second nature, then you will be amazed at what you can accomplish with it.
Good luck.
When I was a coder, we worked on algorithms. Today, we memorize APIs for countless libraries — those libraries have the algorithms - Eric Allman
|
|
|
|
|
I have been searching on the internet for a sample to show me how to show the sql server reporting services (SSRS) reports from a silverlight page i.e. (.xaml)
I have seen where an .aspx file should be used but there is no example on how to use the .aspx page inside or from the .xaml page.
Can you please let me know or point me to a simple site where I can see how to show my SSRS reports from my silverlight application?
Thanks
|
|
|
|
|
|
Thank you for the link which I had seen before.
What I would liek to find out is that in this link which you sent, where do I add the /RpDemoWebForm.aspx webform?
Is it added to the host which has a default.aspx or o the silverlight project?
Thanks
|
|
|
|
|
I have added mine in a folder in the web project (where the default.aspx lives. In that folder I have all the bits required to get the data and the .rdlc files with the viewer aspx
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hi All,
I have a stack panel which has grid to show footer buttons. This grid has some column definitions with some fixed width and with * as well. In Star columns I am having Grids again with some coulmn definitions in which I am placing the buttons. These columna are some fixed width, auto. In auto columns I am placing buttons.
My problem here is when I resizing and minimizing my browser some buttons are becoming invisible. It seems the columns are over written one another.
Is there any way that I can make the buttons stretch and make them not over written by the other columns?
Thanks for the help.
Following the xaml for the control
<Grid x:Name="LayoutRoot">
<StackPanel Orientation="Vertical">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="24" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="24" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="24" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="24" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="24" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="24" />
</Grid.ColumnDefinitions>
<Grid Grid.Column="1" Visibility="{Binding DataPublishingVisible,Converter={StaticResource visibilityConverter}}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="10" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="20" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="10" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Button
Grid.Column="0"
Content="Import"
Visibility="{Binding Button_Import.Visibility}"
IsEnabled="{Binding Button_Import.Enabled}"
command:Click.Command="{Binding Button_Import.Command}" />
<Button
Grid.Column="2"
Content="Export"
Visibility="{Binding Button_Export.Visibility}"
IsEnabled="{Binding Button_Export.Enabled}"
command:Click.Command="{Binding Button_Export.Command}" />
<Button
Grid.Column="4"
Content="Publish"
Visibility="{Binding Button_Publish.Visibility}"
IsEnabled="{Binding Button_Publish.Enabled}"
command:Click.Command="{Binding Button_Publish.Command}" />
<Button
Grid.Column="6"
Content="Cancel"
Visibility="{Binding Button_Cancel.Visibility}"
IsEnabled="{Binding Button_Cancel.Enabled}"
command:Click.Command="{Binding Button_Cancel.Command}" />
<Button
Grid.Column="8"
Content="Save"
Visibility="{Binding Button_Save.Visibility}"
IsEnabled="{Binding Button_Save.Enabled}"
command:Click.Command="{Binding Button_Save.Command}" />
</Grid>
<Grid Grid.Column="3" Visibility="{Binding ListVisible,Converter={StaticResource visibilityConverter}}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Button
Grid.Column="0"
Content="Preview Work Distribution"
Visibility="{Binding Button_Preview.Visibility}"
IsEnabled="{Binding Button_Preview.Enabled}"
command:Click.Command="{Binding Button_Preview.Command}" />
<Rectangle Grid.Column="1" Width="20" Visibility="{Binding Button_Preview.Visibility}" />
<Button
Grid.Column="2"
Content="New"
Visibility="{Binding Button_New.Visibility}"
IsEnabled="{Binding Button_New.Enabled}"
command:Click.Command="{Binding Button_New.Command}" />
<Button
Grid.Column="3"
Content="Delete"
Margin="5,0"
Visibility="{Binding Button_Delete.Visibility}"
IsEnabled="{Binding Button_Delete.Enabled}"
command:Click.Command="{Binding Button_Delete.Command}" />
<Button
Grid.Column="4"
Content="Edit"
Visibility="{Binding Button_Edit.Visibility}"
command:Click.Command="{Binding Button_Edit.Command}" />
</Grid>
<Grid Grid.Column="5" Visibility="{Binding DataEntryVisible,Converter={StaticResource visibilityConverter}}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="10" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="20" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Button
Grid.Column="1"
Content="Clear All"
Visibility="{Binding Button_Clear.Visibility}"
IsEnabled="{Binding Button_Clear.Enabled}"
command:Click.Command="{Binding Button_Clear.Command}" />
<Button
Grid.Column="3"
Content="Cancel"
Visibility="{Binding Button_Cancel.Visibility}"
IsEnabled="{Binding Button_Cancel.Enabled}"
command:Click.Command="{Binding Button_Cancel.Command}" />
<Button
Grid.Column="5"
Content="Save"
Visibility="{Binding Button_Save.Visibility}"
IsEnabled="{Binding Button_Save.Enabled}"
command:Click.Command="{Binding Button_Save.Command}" />
</Grid>
<Grid Grid.Column="7" Visibility="{Binding GenericVisible,Converter={StaticResource visibilityConverter}}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="20" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Button
Grid.Column="1"
Content="Clear All"
Visibility="{Binding Button_Clear.Visibility}"
IsEnabled="{Binding Button_Clear.Enabled}"
command:Click.Command="{Binding Button_Clear.Command}" />
<Button
Grid.Column="5"
Content="Save"
Visibility="{Binding Button_Save.Visibility}"
IsEnabled="{Binding Button_Save.Enabled}"
command:Click.Command="{Binding Button_Save.Command}" />
</Grid>
<Grid Grid.Column="9" Visibility="{Binding TestVisible,Converter={StaticResource visibilityConverter}}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Button
Grid.Column="1"
Content="Back"
Visibility="{Binding Button_Back.Visibility}"
IsEnabled="{Binding Button_Back.Enabled}"
command:Click.Command="{Binding Button_Back.Command}" />
</Grid>
</Grid>
</StackPanel>
</Grid>
Thanks & Regards,
Abdul Aleem Mohammad
St Louis MO - USA
modified 11-Nov-11 14:48pm.
|
|
|
|
|
Can you post some simplified XAML that demonstrates your issue explicitly (so we don't have to guess what you mean exactly)?
Somebody in an online forum wrote: INTJs never really joke. They make a point. The joke is just a gift wrapper.
|
|
|
|
|
Hi,
I got the fix for this problem, Grid columns over write on one another, the best way is to create the columns to fit all the elements in the column.
Thanks & Regards,
Abdul Aleem Mohammad
St Louis MO - USA
|
|
|
|
|
Hi,
I want to hide all the controls in a column in my WPF application.
Note - I dont want to hide column, I want to hide its contents only.
Please help me.
|
|
|
|
|
Where are the columns ? Are they on a DataGrid, ListView or normal Grid ?
When I was a coder, we worked on algorithms. Today, we memorize APIs for countless libraries — those libraries have the algorithms - Eric Allman
|
|
|
|
|
|
Then I think that you are going to have to create a boolean property in your codebehind/viewmodel, and bind each control to this property. Then whenever you want to show or hide your controls you can just set the property accordingly.
Hope this helps
When I was a coder, we worked on algorithms. Today, we memorize APIs for countless libraries — those libraries have the algorithms - Eric Allman
|
|
|
|
|
Thanks You very much . but i am new to wpf can you tell me how can i bind control to property.
|
|
|
|
|
You should do something like this:-
Fisrt of all create a Boolean property in your code behind that you can bind to(ensure your code file uses the INotifyProperty Interface[^] and your property setter raises the PropertyChanged event)
Then declare the Converter that will set your control's Visibility property to Hidden if your boolean property is true like this:
<Grid.Resources>
<BooleanToVisibilityConverter x:Key="HiddenConverter" />
</Grid.Resources>
Then in your XAML you bind the control's Visibility property to the boolean property, declaring the Converter property to use the HiddenConverter set up previously.
<Label Grid.Column="1" Content="Label1" Visibility="{Binding Path=ShowControls, Converter={StaticResource HiddenConverter}" Margin="3"/>
Then whenever you change the state of your boolean property, the control will be shown/hidden appropriately
Hope this helps
When I was a coder, we worked on algorithms. Today, we memorize APIs for countless libraries — those libraries have the algorithms - Eric Allman
|
|
|
|
|
Why not just create a Visibility property? that way you don't need the converter... unless you are using the bool elsewhere, of course .
|
|
|
|