473,405 Members | 2,167 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Problem with Silverlight Datagrid

I have a nested datagrid in a xaml file, the parent datagrid loads the vendor
information and the details loads the documents for that vendor in a
datagrid. Everything is working fine until I click in the child datagrid and
then go to the combobox and choose another vendor. When the new vendor is
loaded nothing shows in the datagrid but the itemsource shows the info is
there. Know if I click on the child cell and then click back on the parent
cell everything works fine.

I need to either select a cell programmatically from the parent datagrid to
change the focus back on that, or fix the problem with the datagrid not
showing up

XAML
XAML

<UserControl
xmlns:data="clr-namespace:System.Windows.Controls;assembly=System. Windows.Controls.Data"

xmlns:basics="clr-namespace:System.Windows.Controls;assembly=System. Windows.Controls" x:Class="ITAccountReport.Page"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="25"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="25"/>
<ColumnDefinition Width="380"/>
<ColumnDefinition Width="260"/>
<ColumnDefinition Width="260"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="25"/>
</Grid.ColumnDefinitions>
<Grid.Background>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#3E5f8a" Offset="0.259"/>
<GradientStop Color="#FFFFFFFF" Offset="1"/>
</LinearGradientBrush>
</Grid.Background>
<TextBlock x:Name="txtVendorName" HorizontalAlignment="Left"
Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Text="Vendor Name"
Width="Auto" Foreground="White" Margin="0,0,0,0"/>
<ComboBox x:Name="cbVendorName" HorizontalAlignment="Left"
Margin="80,0,0,0" Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2"
Width="300" />
<TextBlock Grid.Row="0" Grid.Column="2" HorizontalAlignment="left"
x:Name="txtSelectStartDate" Foreground="White" Text="Select Start Date"/>
<basics:DatePicker Grid.Row="0" HorizontalAlignment="Left"
Margin="100,0,0,0" Grid.Column="2" x:Name="dtStartDate" Width="150" />
<TextBlock Grid.Row="0" Grid.Column="3" HorizontalAlignment="Left"
x:Name="txtSelectEndDate" Text="Select End Date" Foreground="White" />
<basics:DatePicker Grid.Row="0" HorizontalAlignment="Left"
Margin="100,0,0,0" Grid.Column="3" x:Name="dtEndDate" Width="150" />
<Button x:Name="Search" Content="Search" HorizontalAlignment="Left"
Grid.Column="4" Grid.ColumnSpan="2"/>
<data:DataGrid x:Name="FolderDatagrid"
AutoGenerateColumns="False" IsReadOnly="True" Grid.Row="1" Grid.Column="1"
Grid.ColumnSpan="4">
<data:DataGrid.Background>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="white" Offset="0.259"/>
<GradientStop Color="#C1C1C1" Offset="1"/>
</LinearGradientBrush>
</data:DataGrid.Background>
<data:DataGrid.Columns>
<data:DataGridTextColumn Header="Folder Number"
Binding="{Binding FLD_RSN}" Visibility="Collapsed" />
<data:DataGridTextColumn Header="Vendor ID" Width="100"
Binding="{Binding A_VENDOR_ID}" />
<data:DataGridTextColumn Header="Vendor Name" Width="200"
Binding="{Binding A_VENDOR_NAME}" />
<data:DataGridTextColumn Header="Vendor Desc" Width="500"
Binding="{Binding A_VDR_DESC}" />
</data:DataGrid.Columns>
<data:DataGrid.RowDetailsTemplate>
<DataTemplate>
<data:DataGrid x:Name="DocumentDataGrid"
AreRowDetailsFrozen="True" RowDetailsVisibilityMode="Collapsed"
HorizontalGridLinesBrush="Black" GridLinesVisibility="All"
BorderBrush="Black" BorderThickness="2" AutoGenerateColumns="FALSE"
ItemsSource="{Binding CAWDOCUMENT}" Height="419" Margin="0,-5,0,0"
IsReadOnly="True" VerticalAlignment="Bottom" >

<data:DataGrid.Background>
<LinearGradientBrush EndPoint="0.5,1"
StartPoint="0.5,0">
<GradientStop Color="#C1C1C1" Offset="0.259"/>
<GradientStop Color="#FFFFFFFF" Offset="1"/>
</LinearGradientBrush>
</data:DataGrid.Background>
<data:DataGrid.Columns>
<data:DataGridTextColumn Header="DOC_RSN"
Binding="{Binding DOC_RSN}" Visibility="Collapsed" />
<data:DataGridTextColumn Header="DOC TYPE"
Width="100" Binding="{Binding DOC_TYPE}" />
<data:DataGridTextColumn Header="DOC
Description" Width="200" Binding="{Binding DOC_DESC}" />
<data:DataGridTextColumn Header="Check Number"
Width="100" Binding="{Binding A_CHECK_NO}" />
<data:DataGridTextColumn Header="Amount"
Width="100" Binding="{Binding A_AMOUNT}"/>
<data:DataGridTextColumn Header="Check Date"
Width="600" Binding="{Binding A_CHECK_DATE}"/>
<data:DataGridTemplateColumn Header="Image"
Width="100">
<data:DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<HyperlinkButton Content="Image"
TargetName="Image" Foreground="White" NavigateUri="{Binding IMAGE_FILE}">
<HyperlinkButton.Background >
<LinearGradientBrush
EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop
Color="#3E5f8a" Offset="0.259"/>
<GradientStop
Color="#FFFFFFFF" Offset="1"/>
</LinearGradientBrush>
</HyperlinkButton.Background>
</HyperlinkButton>
</DataTemplate>
</data:DataGridTemplateColumn.CellTemplate>
</data:DataGridTemplateColumn>
</data:DataGrid.Columns>
</data:DataGrid>
</DataTemplate>
</data:DataGrid.RowDetailsTemplate>
</data:DataGrid>
</Grid>

</UserControl>

Code Behind
Imports System.Windows.Data
Partial Public Class Page
Inherits UserControl
Dim ClientHost As ServiceReference1.Service1Client = New
ServiceReference1.Service1Client
Dim dg As New DataGrid
Dim folderrow As ServiceReference1.CAWFOLDER
Public Sub New()
InitializeComponent()
AddHandler ClientHost.GetVendorCompleted, AddressOf
ClientHost_GetVendorCompleted
ClientHost.GetVendorAsync()
End Sub
Private Sub ClientHost_GetVendorCompleted(ByVal sender As Object, ByVal
e As ServiceReference1.GetVendorCompletedEventArgs)
If Not e.Result Is Nothing Then
For Each item In e.Result
cbVendorName.Items.Add(item)
Next
End If
End Sub
Private Sub cbVendorName_SelectionChanged(ByVal sender As Object, ByVal
e As System.Windows.Controls.SelectionChangedEventArgs) Handles
cbVendorName.SelectionChanged
AddHandler ClientHost.GetVendorInfoCompleted, AddressOf
ClientHost_GetVendorInfoCompleted
ClientHost.GetVendorInfoAsync(cbVendorName.Selecte dItem.ToString)
End Sub
Private Sub ClientHost_GetVendorInfoCompleted(ByVal sender As Object,
ByVal e As ServiceReference1.GetVendorInfoCompletedEventArgs)
If Not e.Result Is Nothing Then
FolderDatagrid.ItemsSource = e.Result
End If
End Sub
Private Sub FolderDatagrid_LoadingRowDetails(ByVal sender As Object,
ByVal e As System.Windows.Controls.DataGridRowDetailsEventArg s) Handles
FolderDatagrid.LoadingRowDetails
FolderDatagrid.SelectedIndex = e.Row.GetIndex
AddHandler ClientHost.GetVendorDocsCompleted, AddressOf
clientHost_GetVendorDocCompleted
Dim row As ServiceReference1.CAWFOLDER = FolderDatagrid.SelectedItem()
folderrow = row
If Not row Is Nothing Then
dg = e.DetailsElement.FindName("DocumentDataGrid")
ClientHost.GetVendorDocsAsync(row.FLD_RSN)
End If
End Sub
Private Sub clientHost_GetVendorDocCompleted(ByVal sender As Object,
ByVal e As ServiceReference1.GetVendorDocsCompletedEventArgs)
If Not e.Result Is Nothing Then
dg.ItemsSource = e.Result
End If
End Sub

End Class

Nov 4 '08 #1
2 6551
On Nov 4, 5:37*pm, creaves0622 <creaves0...@discussions.microsoft.com>
wrote:
I have a nested datagrid in a xaml file, the parent datagrid loads the vendor
information and the details loads the documents for that vendor in a
datagrid. Everything is working fine until I click in the child datagrid and
then go to the combobox and choose another vendor. When the new vendor is
loaded nothing shows in the datagrid but the itemsource shows the info is
there. Know if I click on the child cell and then click back on the parent
cell everything works fine.

I need to either select a cell programmatically from the parent datagrid to
change the focus back on that, or fix the problem with the datagrid not
showing up

XAML
XAML

<UserControl
xmlns:data="clr-namespace:System.Windows.Controls;assembly=System. Windows.C ontrols.Data"

xmlns:basics="clr-namespace:System.Windows.Controls;assembly=System. Windows .Controls" *x:Class="ITAccountReport.Page"
* * xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
* * xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
* * xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
* * <Grid>
* * * * <Grid.RowDefinitions>
* * * * * * <RowDefinition Height="25"/>
* * * * * * <RowDefinition Height="*"/>
* * * * </Grid.RowDefinitions>
* * * * <Grid.ColumnDefinitions>
* * * * * * <ColumnDefinition Width="25"/>
* * * * * * <ColumnDefinition Width="380"/>
* * * * * * <ColumnDefinition Width="260"/>
* * * * * * <ColumnDefinition Width="260"/>
* * * * * * <ColumnDefinition Width="*"/>
* * * * * * <ColumnDefinition Width="25"/>
* * * * </Grid.ColumnDefinitions>
* * * * <Grid.Background>
* * * * * * <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
* * * * * * * * <GradientStop Color="#3E5f8a" Offset="0.259"/>
* * * * * * * * <GradientStop Color="#FFFFFFFF" Offset="1"/>
* * * * * * </LinearGradientBrush>
* * * * </Grid.Background>
* * * * <TextBlock x:Name="txtVendorName" HorizontalAlignment="Left" *
Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Text="Vendor Name"
Width="Auto" Foreground="White" Margin="0,0,0,0"/>
* * * * <ComboBox *x:Name="cbVendorName" *HorizontalAlignment="Left"
Margin="80,0,0,0" Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2"
Width="300" />
* * * * <TextBlock Grid.Row="0" Grid.Column="2" HorizontalAlignment="left"
x:Name="txtSelectStartDate" Foreground="White" *Text="Select Start Date"/>
* * * * <basics:DatePicker Grid.Row="0" HorizontalAlignment="Left"
Margin="100,0,0,0" Grid.Column="2" x:Name="dtStartDate" Width="150" />
* * * * <TextBlock Grid.Row="0" Grid.Column="3" HorizontalAlignment="Left" *
x:Name="txtSelectEndDate" Text="Select End Date" Foreground="White"/>
* * * * <basics:DatePicker Grid.Row="0" HorizontalAlignment="Left"
Margin="100,0,0,0" *Grid.Column="3" x:Name="dtEndDate" Width="150" */>
* * * * <Button x:Name="Search" Content="Search" HorizontalAlignment="Left" *
Grid.Column="4" Grid.ColumnSpan="2"/>
* * * * <data:DataGrid x:Name="FolderDatagrid" * * *
AutoGenerateColumns="False" IsReadOnly="True" Grid.Row="1" Grid.Column="1"
Grid.ColumnSpan="4">
* * * * * * <data:DataGrid.Background>
* * * * * * * * <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
* * * * * * * * * * <GradientStop Color="white" Offset="0.259"/>
* * * * * * * * * * <GradientStop Color="#C1C1C1" Offset="1"/>
* * * * * * * * </LinearGradientBrush>
* * * * * * </data:DataGrid.Background>
* * * * * * <data:DataGrid.Columns>
* * * * * * * * <data:DataGridTextColumn Header="FolderNumber"
Binding="{Binding FLD_RSN}" Visibility="Collapsed" />
* * * * * * * * <data:DataGridTextColumn Header="VendorID" Width="100"
Binding="{Binding A_VENDOR_ID}" />
* * * * * * * * <data:DataGridTextColumn Header="VendorName" Width="200"
Binding="{Binding A_VENDOR_NAME}" />
* * * * * * * * <data:DataGridTextColumn Header="VendorDesc" Width="500"
Binding="{Binding A_VDR_DESC}" />
* * * * * * </data:DataGrid.Columns>
* * * * * * <data:DataGrid.RowDetailsTemplate>
* * * * * * * * <DataTemplate>
* * * * * * * * * * <data:DataGrid x:Name="DocumentDataGrid"
AreRowDetailsFrozen="True" *RowDetailsVisibilityMode="Collapsed" *
HorizontalGridLinesBrush="Black" GridLinesVisibility="All" *
BorderBrush="Black" BorderThickness="2" *AutoGenerateColumns="FALSE"
ItemsSource="{Binding CAWDOCUMENT}" * Height="419" Margin="0,-5,0,0"
IsReadOnly="True" *VerticalAlignment="Bottom" >

* * * * * * * * * * * * <data:DataGrid.Background>
* * * * * * * * * * * * * * <LinearGradientBrush EndPoint="0.5,1"
StartPoint="0.5,0">
* * * * * * * * * * * * * * * * <GradientStop Color="#C1C1C1" Offset="0.259"/>
* * * * * * * * * * * * * * * * <GradientStop Color="#FFFFFFFF" Offset="1"/>
* * * * * * * * * * * * * * </LinearGradientBrush>
* * * * * * * * * * * * </data:DataGrid.Background>
* * * * * * * * * * * * <data:DataGrid.Columns>
* * * * * * * * * * * * * * <data:DataGridTextColumn Header="DOC_RSN"
Binding="{Binding DOC_RSN}" Visibility="Collapsed" />
* * * * * * * * * * * * * * <data:DataGridTextColumn Header="DOC TYPE"
Width="100" Binding="{Binding DOC_TYPE}" />
* * * * * * * * * * * * * * <data:DataGridTextColumn Header="DOC
Description" Width="200" Binding="{Binding DOC_DESC}" />
* * * * * * * * * * * * * * <data:DataGridTextColumn Header="Check Number"
Width="100" Binding="{Binding A_CHECK_NO}" />
* * * * * * * * * * * * * * <data:DataGridTextColumn Header="Amount"
Width="100" Binding="{Binding A_AMOUNT}"/>
* * * * * * * * * * * * * * <data:DataGridTextColumn Header="Check Date"
Width="600" Binding="{Binding A_CHECK_DATE}"/>
* * * * * * * * * * * * * * <data:DataGridTemplateColumn Header="Image"
Width="100">
* * * * * * * * * * * * * * * * <data:DataGridTemplateColumn.CellTemplate>
* * * * * * * * * * * * * * * * * * <DataTemplate>
* * * * * * * * * * * * * * * * * * * * <HyperlinkButton *Content="Image"
TargetName="Image" Foreground="White" *NavigateUri="{Binding IMAGE_FILE}">
* * * * * * * * * * * * * * * * * * * * * * <HyperlinkButton.Background >
* * * * * * * * * * * * * * * * * * * * * * * * <LinearGradientBrush
EndPoint="0.5,1" StartPoint="0.5,0">
* * * * * * * * * * * * * * * * * * * * * * * * * * <GradientStop
Color="#3E5f8a" Offset="0.259"/>
* * * * * * * * * * * * * * * * * * * * * * * * * * <GradientStop
Color="#FFFFFFFF" Offset="1"/>
* * * * * * * * * * * * * * * * * * * * * * * * </LinearGradientBrush>
* * * * * * * * * * * * * * * * * * * * * * </HyperlinkButton.Background>
* * * * * * * * * * * * * * * * * * * * </HyperlinkButton>
* * * * * * * * * * * * * * * * * * </DataTemplate>
* * * * * * * * * * * * * * * * </data:DataGridTemplateColumn.CellTemplate>
* * * * * * * * * * * * * * </data:DataGridTemplateColumn>
* * * * * * * * * * * * </data:DataGrid.Columns>
* * * * * * * * * * </data:DataGrid>
* * * * * * * * </DataTemplate>
* * * * * * </data:DataGrid.RowDetailsTemplate>
* * * * </data:DataGrid>
* * </Grid>

</UserControl>

Code Behind
Imports System.Windows.Data
Partial Public Class Page
* * Inherits UserControl
* * Dim ClientHost As ServiceReference1.Service1Client = New
ServiceReference1.Service1Client
* * Dim dg As New DataGrid
* * Dim folderrow As ServiceReference1.CAWFOLDER
* * Public Sub New()
* * * * InitializeComponent()
* * * * AddHandler ClientHost.GetVendorCompleted, AddressOf
ClientHost_GetVendorCompleted
* * * * ClientHost.GetVendorAsync()
* * End Sub
* * Private Sub ClientHost_GetVendorCompleted(ByVal sender As Object,ByVal
e As ServiceReference1.GetVendorCompletedEventArgs)
* * * * If Not e.Result Is Nothing Then
* * * * * * For Each item In e.Result
* * * * * * * * cbVendorName.Items.Add(item)
* * * * * * Next
* * * * End If
* * End Sub
* * Private Sub cbVendorName_SelectionChanged(ByVal sender As Object,ByVal
e As System.Windows.Controls.SelectionChangedEventArgs) Handles
cbVendorName.SelectionChanged
* * * * AddHandler ClientHost.GetVendorInfoCompleted, AddressOf
ClientHost_GetVendorInfoCompleted
* * * * ClientHost.GetVendorInfoAsync(cbVendorName.Selecte dItem.ToString)
* * End Sub
* * Private Sub ClientHost_GetVendorInfoCompleted(ByVal sender As Object,
ByVal e As ServiceReference1.GetVendorInfoCompletedEventArgs)

* * * * If Not e.Result Is Nothing Then
* * * * * * FolderDatagrid.ItemsSource = e.Result
* * * * End If
* * End Sub

* * Private Sub FolderDatagrid_LoadingRowDetails(ByVal sender As Object,
ByVal e As System.Windows.Controls.DataGridRowDetailsEventArg s) Handles
FolderDatagrid.LoadingRowDetails
* * * * FolderDatagrid.SelectedIndex = e.Row.GetIndex
* * * * AddHandler ClientHost.GetVendorDocsCompleted, AddressOf
clientHost_GetVendorDocCompleted
* * * * Dim row As ServiceReference1.CAWFOLDER = FolderDatagrid..SelectedItem()
* * * * folderrow = row
* * * * If Not row Is Nothing Then
* * * * * * dg = e.DetailsElement.FindName("DocumentDataGrid")
* * * * * * ClientHost.GetVendorDocsAsync(row.FLD_RSN)
* * * * End If
* * End Sub
* * Private Sub clientHost_GetVendorDocCompleted(ByVal sender As Object,
ByVal e As ServiceReference1.GetVendorDocsCompletedEventArgs)
* * * * If Not e.Result Is Nothing Then
* * * * * * dg.ItemsSource = e.Result
* * * * End If
* * End Sub

End Class
Yikes!

I would highly suggest that you post any Silverlight questions on the
forums at http://silverlight.net/ as you are more likely to receive a
response there. I would also suggest that you trim the size of you
message down, alot. Being volunteers here, most of us (myself
included) will just skip over long threads. It's much better to have a
couple sentences and maybe a small code sample to illustrate the
problem.

Thanks,

Seth Rowe [MVP]
http://sethrowe.blogspot.com/
Nov 5 '08 #2
Thanks for the response I will do that, Most places that I post questions
want all the source code, but I will try and take some of it out and repost
it on silverlight.net, thanks for your time

"rowe_newsgroups" wrote:
On Nov 4, 5:37 pm, creaves0622 <creaves0...@discussions.microsoft.com>
wrote:
I have a nested datagrid in a xaml file, the parent datagrid loads the vendor
information and the details loads the documents for that vendor in a
datagrid. Everything is working fine until I click in the child datagrid and
then go to the combobox and choose another vendor. When the new vendor is
loaded nothing shows in the datagrid but the itemsource shows the info is
there. Know if I click on the child cell and then click back on the parent
cell everything works fine.

I need to either select a cell programmatically from the parent datagrid to
change the focus back on that, or fix the problem with the datagrid not
showing up

XAML
XAML

<UserControl
xmlns:data="clr-namespace:System.Windows.Controls;assembly=System. Windows.C ontrols.Data"

xmlns:basics="clr-namespace:System.Windows.Controls;assembly=System. Windows .Controls" x:Class="ITAccountReport.Page"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="25"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="25"/>
<ColumnDefinition Width="380"/>
<ColumnDefinition Width="260"/>
<ColumnDefinition Width="260"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="25"/>
</Grid.ColumnDefinitions>
<Grid.Background>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#3E5f8a" Offset="0.259"/>
<GradientStop Color="#FFFFFFFF" Offset="1"/>
</LinearGradientBrush>
</Grid.Background>
<TextBlock x:Name="txtVendorName" HorizontalAlignment="Left"
Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Text="Vendor Name"
Width="Auto" Foreground="White" Margin="0,0,0,0"/>
<ComboBox x:Name="cbVendorName" HorizontalAlignment="Left"
Margin="80,0,0,0" Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2"
Width="300" />
<TextBlock Grid.Row="0" Grid.Column="2" HorizontalAlignment="left"
x:Name="txtSelectStartDate" Foreground="White" Text="Select Start Date"/>
<basics:DatePicker Grid.Row="0" HorizontalAlignment="Left"
Margin="100,0,0,0" Grid.Column="2" x:Name="dtStartDate" Width="150" />
<TextBlock Grid.Row="0" Grid.Column="3" HorizontalAlignment="Left"
x:Name="txtSelectEndDate" Text="Select End Date" Foreground="White" />
<basics:DatePicker Grid.Row="0" HorizontalAlignment="Left"
Margin="100,0,0,0" Grid.Column="3" x:Name="dtEndDate" Width="150" />
<Button x:Name="Search" Content="Search" HorizontalAlignment="Left"
Grid.Column="4" Grid.ColumnSpan="2"/>
<data:DataGrid x:Name="FolderDatagrid"
AutoGenerateColumns="False" IsReadOnly="True" Grid.Row="1" Grid.Column="1"
Grid.ColumnSpan="4">
<data:DataGrid.Background>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="white" Offset="0.259"/>
<GradientStop Color="#C1C1C1" Offset="1"/>
</LinearGradientBrush>
</data:DataGrid.Background>
<data:DataGrid.Columns>
<data:DataGridTextColumn Header="Folder Number"
Binding="{Binding FLD_RSN}" Visibility="Collapsed" />
<data:DataGridTextColumn Header="Vendor ID" Width="100"
Binding="{Binding A_VENDOR_ID}" />
<data:DataGridTextColumn Header="Vendor Name" Width="200"
Binding="{Binding A_VENDOR_NAME}" />
<data:DataGridTextColumn Header="Vendor Desc" Width="500"
Binding="{Binding A_VDR_DESC}" />
</data:DataGrid.Columns>
<data:DataGrid.RowDetailsTemplate>
<DataTemplate>
<data:DataGrid x:Name="DocumentDataGrid"
AreRowDetailsFrozen="True" RowDetailsVisibilityMode="Collapsed"
HorizontalGridLinesBrush="Black" GridLinesVisibility="All"
BorderBrush="Black" BorderThickness="2" AutoGenerateColumns="FALSE"
ItemsSource="{Binding CAWDOCUMENT}" Height="419" Margin="0,-5,0,0"
IsReadOnly="True" VerticalAlignment="Bottom" >

<data:DataGrid.Background>
<LinearGradientBrush EndPoint="0.5,1"
StartPoint="0.5,0">
<GradientStop Color="#C1C1C1" Offset="0.259"/>
<GradientStop Color="#FFFFFFFF" Offset="1"/>
</LinearGradientBrush>
</data:DataGrid.Background>
<data:DataGrid.Columns>
<data:DataGridTextColumn Header="DOC_RSN"
Binding="{Binding DOC_RSN}" Visibility="Collapsed" />
<data:DataGridTextColumn Header="DOC TYPE"
Width="100" Binding="{Binding DOC_TYPE}" />
<data:DataGridTextColumn Header="DOC
Description" Width="200" Binding="{Binding DOC_DESC}" />
<data:DataGridTextColumn Header="Check Number"
Width="100" Binding="{Binding A_CHECK_NO}" />
<data:DataGridTextColumn Header="Amount"
Width="100" Binding="{Binding A_AMOUNT}"/>
<data:DataGridTextColumn Header="Check Date"
Width="600" Binding="{Binding A_CHECK_DATE}"/>
<data:DataGridTemplateColumn Header="Image"
Width="100">
<data:DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<HyperlinkButton Content="Image"
TargetName="Image" Foreground="White" NavigateUri="{Binding IMAGE_FILE}">
<HyperlinkButton.Background >
<LinearGradientBrush
EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop
Color="#3E5f8a" Offset="0.259"/>
<GradientStop
Color="#FFFFFFFF" Offset="1"/>
</LinearGradientBrush>
</HyperlinkButton.Background>
</HyperlinkButton>
</DataTemplate>
</data:DataGridTemplateColumn.CellTemplate>
</data:DataGridTemplateColumn>
</data:DataGrid.Columns>
</data:DataGrid>
</DataTemplate>
</data:DataGrid.RowDetailsTemplate>
</data:DataGrid>
</Grid>

</UserControl>

Code Behind
Imports System.Windows.Data
Partial Public Class Page
Inherits UserControl
Dim ClientHost As ServiceReference1.Service1Client = New
ServiceReference1.Service1Client
Dim dg As New DataGrid
Dim folderrow As ServiceReference1.CAWFOLDER
Public Sub New()
InitializeComponent()
AddHandler ClientHost.GetVendorCompleted, AddressOf
ClientHost_GetVendorCompleted
ClientHost.GetVendorAsync()
End Sub
Private Sub ClientHost_GetVendorCompleted(ByVal sender As Object, ByVal
e As ServiceReference1.GetVendorCompletedEventArgs)
If Not e.Result Is Nothing Then
For Each item In e.Result
cbVendorName.Items.Add(item)
Next
End If
End Sub
Private Sub cbVendorName_SelectionChanged(ByVal sender As Object, ByVal
e As System.Windows.Controls.SelectionChangedEventArgs) Handles
cbVendorName.SelectionChanged
AddHandler ClientHost.GetVendorInfoCompleted, AddressOf
ClientHost_GetVendorInfoCompleted
ClientHost.GetVendorInfoAsync(cbVendorName.Selecte dItem.ToString)
End Sub
Private Sub ClientHost_GetVendorInfoCompleted(ByVal sender As Object,
ByVal e As ServiceReference1.GetVendorInfoCompletedEventArgs)

If Not e.Result Is Nothing Then
FolderDatagrid.ItemsSource = e.Result
End If
End Sub

Private Sub FolderDatagrid_LoadingRowDetails(ByVal sender As Object,
ByVal e As System.Windows.Controls.DataGridRowDetailsEventArg s) Handles
FolderDatagrid.LoadingRowDetails
FolderDatagrid.SelectedIndex = e.Row.GetIndex
AddHandler ClientHost.GetVendorDocsCompleted, AddressOf
clientHost_GetVendorDocCompleted
Dim row As ServiceReference1.CAWFOLDER = FolderDatagrid..SelectedItem()
folderrow = row
If Not row Is Nothing Then
dg = e.DetailsElement.FindName("DocumentDataGrid")
ClientHost.GetVendorDocsAsync(row.FLD_RSN)
End If
End Sub
Private Sub clientHost_GetVendorDocCompleted(ByVal sender As Object,
ByVal e As ServiceReference1.GetVendorDocsCompletedEventArgs)
If Not e.Result Is Nothing Then
dg.ItemsSource = e.Result
End If
End Sub

End Class

Yikes!

I would highly suggest that you post any Silverlight questions on the
forums at http://silverlight.net/ as you are more likely to receive a
response there. I would also suggest that you trim the size of you
message down, alot. Being volunteers here, most of us (myself
included) will just skip over long threads. It's much better to have a
couple sentences and maybe a small code sample to illustrate the
problem.

Thanks,

Seth Rowe [MVP]
http://sethrowe.blogspot.com/
Nov 5 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: m.a | last post by:
Hello, I installed MSVC 2008 express and I like to install silverlight. Can I do this? Thenone that I got from silverlight web site, complain about msvc version. Regards
18
by: Artificer | last post by:
Any idea if MS will try to promote Silverlight over ASP.NET for web development or will silverlight remain just as a adobe's flash like tecnology?
0
by: =?Utf-8?B?Um9nZXIgTWFydGlu?= | last post by:
I have a web site under .NET 2.0 that renders videos using the Silverlight media player. The <asp:MediaPlayercontrol only works on .NET 3.5, but I managed to get things working under .NET 2.0 by...
1
by: Faisal Shafiq | last post by:
I want to upload a file direct to the Silverlight Streaming Service from a Web Client such as silverlight application. As per our product requirement we want to upload a .WMV file directly from...
3
by: =?Utf-8?B?Um9nZXIgTWFydGlu?= | last post by:
Note: My apologies for repeating this post from last week, but my nospam alias and profile account were incorrect. I think I have fixed this, so hopefully this post will trigger MS into a response...
7
Curtis Rutland
by: Curtis Rutland | last post by:
Building A Silverlight (2.0) Multi-File Uploader All source code is C#. VB.NET source is coming soon. Note: This project requires Visual Studio 2008 SP1 or Visual Web Developer 2008 SP1 and...
3
by: vineetbindal | last post by:
Hi, I want to select a complete row in a datagrid in silverlight and display the contents of that row on next page or same page in textblock can someone please tell me how to do that?
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.