Home Forums WPF controls Xceed DataGrid for WPF CurrentItem is not being set at all.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #40327 |

    Hello,

    The following is the entire xaml for my page, I am trying to set the CurrentItem [ProductName] above the grid, but the values are not being set, I am using a static datasource created by blend.   Any ideas on what I am doing wrong please?

    <UserControl.Resources>
    		<ResourceDictionary>
    			<ResourceDictionary.MergedDictionaries>
    				<ResourceDictionary Source=“/Modules.Products;component/ProjectDataSources.xaml” />
    			</ResourceDictionary.MergedDictionaries>
    		</ResourceDictionary>
    	</UserControl.Resources>
     
    	<Grid DataContext=”{Binding Source={StaticResource ProductSampleData}} ShowGridLines=“True”>
    		<Grid.Resources>
    			<Style TargetType=”{x:Type xcdg:DataRow}>
    				<Setter Property=“Background”
    						Value=”{x:Static xcdg:CardBackgroundBrushes.Retro} />
    			</Style>
    		</Grid.Resources>
    		
    		<Grid.RowDefinitions>
    			<RowDefinition Height=“Auto” />
    			<RowDefinition Height=“*” />
    		</Grid.RowDefinitions>
     
    		<StackPanel Orientation=“Horizontal” VerticalAlignment=“Center” HorizontalAlignment=“Center”	    Grid.Row=“0”>
    			<TextBlock Text=”{Binding ElementName=ProductGrid, Path=CurrentItem[ProductName]} FontSize=“32”/>
    		</StackPanel>
     
    		<xcdg:DataGridControl x:Name=“ProductGrid”
    							  ItemsSource=”{Binding ProductData}
    							  AutoCreateColumns=“True”
    							  EditTriggers=“None”
    							  Margin=“10”
    							  CurrentItem=“Grid.Items[0]”
    							  MaxHeight=“400”
    							  Opacity=“1.0”
    							  Grid.Row=“1”
    							  ReadOnly=“True”
    							  Background=”{x:Static xcdg:DataGridControlBackgroundBrushes.AuroraRed}>
    			<xcdg:DataGridControl.View>
    				<xcdg:CardflowView3D IsCardFlippingEnabled=“True”
    									 ShowReflections=“True”
    									 CardHeightToViewportRatio=“0.5”
    									 FieldOfView=“140”
    									 SideCardsCount=“7”
    									 SideCardsXOffset=“1.45”
    									 SideCardsXSpacing=“0.55”
    									 SideCardsZOffset=“-0.9”>
    					<xcdg:CardflowView3D.Theme>
    						<xcdg:ChameleonTheme  GradientLightColor=“LightYellow”
    											  GradientDarkColor=“Yellow” />
    					</xcdg:CardflowView3D.Theme>
    				</xcdg:CardflowView3D>
    			</xcdg:DataGridControl.View>
    		</xcdg:DataGridControl>
    	</Grid>

     

    Imported from legacy forums. Posted by Jay (had 1019 views)

    Xceed Support
    Member
    Post count: 5658

    Hi Jay,

    Since we don’t know how your data works in your code behind, we will first presume that the “ProductData” object is coming from a database result.

    To remedy your problem, we suggest that you try one of the two following solutions:

       Path=CurrentItem[‘ProductName’]
    Or
       Path=CurrentItem[0] (Zero being the index of the column you wish to access)

    However, if “ProductData” in the code behind was simply an object, try this instead:

       Path=CurrentItem.ProductName

     

    Imported from legacy forums. Posted by Sebastien [Xceed] (had 1167 views)

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.