473,903 Members | 3,835 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 programmaticall y 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:Syste m.Windows.Contr ols;assembly=Sy stem.Windows.Co ntrols.Data"

xmlns:basics="c lr-namespace:Syste m.Windows.Contr ols;assembly=Sy stem.Windows.Co ntrols" x:Class="ITAcco untReport.Page"
xmlns="http://schemas.microso ft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microso ft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microso ft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxml formats.org/markup-compatibility/2006"
mc:Ignorable="d ">
<Grid>
<Grid.RowDefini tions>
<RowDefinitio n Height="25"/>
<RowDefinitio n Height="*"/>
</Grid.RowDefinit ions>
<Grid.ColumnDef initions>
<ColumnDefiniti on Width="25"/>
<ColumnDefiniti on Width="380"/>
<ColumnDefiniti on Width="260"/>
<ColumnDefiniti on Width="260"/>
<ColumnDefiniti on Width="*"/>
<ColumnDefiniti on Width="25"/>
</Grid.ColumnDefi nitions>
<Grid.Backgroun d>
<LinearGradient Brush EndPoint="0.5,1 " StartPoint="0.5 ,0">
<GradientStop Color="#3E5f8a" Offset="0.259"/>
<GradientStop Color="#FFFFFFF F" Offset="1"/>
</LinearGradientB rush>
</Grid.Background >
<TextBlock x:Name="txtVend orName" HorizontalAlign ment="Left"
Grid.Row="0" Grid.Column="0" Grid.ColumnSpan ="2" Text="Vendor Name"
Width="Auto" Foreground="Whi te" Margin="0,0,0,0 "/>
<ComboBox x:Name="cbVendo rName" HorizontalAlign ment="Left"
Margin="80,0,0, 0" Grid.Row="0" Grid.Column="0" Grid.ColumnSpan ="2"
Width="300" />
<TextBlock Grid.Row="0" Grid.Column="2" HorizontalAlign ment="left"
x:Name="txtSele ctStartDate" Foreground="Whi te" Text="Select Start Date"/>
<basics:DatePic ker Grid.Row="0" HorizontalAlign ment="Left"
Margin="100,0,0 ,0" Grid.Column="2" x:Name="dtStart Date" Width="150" />
<TextBlock Grid.Row="0" Grid.Column="3" HorizontalAlign ment="Left"
x:Name="txtSele ctEndDate" Text="Select End Date" Foreground="Whi te" />
<basics:DatePic ker Grid.Row="0" HorizontalAlign ment="Left"
Margin="100,0,0 ,0" Grid.Column="3" x:Name="dtEndDa te" Width="150" />
<Button x:Name="Search" Content="Search " HorizontalAlign ment="Left"
Grid.Column="4" Grid.ColumnSpan ="2"/>
<data:DataGri d x:Name="FolderD atagrid"
AutoGenerateCol umns="False" IsReadOnly="Tru e" Grid.Row="1" Grid.Column="1"
Grid.ColumnSpan ="4">
<data:DataGrid. Background>
<LinearGradient Brush EndPoint="0.5,1 " StartPoint="0.5 ,0">
<GradientStop Color="white" Offset="0.259"/>
<GradientStop Color="#C1C1C1" Offset="1"/>
</LinearGradientB rush>
</data:DataGrid.B ackground>
<data:DataGrid. Columns>
<data:DataGridT extColumn Header="Folder Number"
Binding="{Bindi ng FLD_RSN}" Visibility="Col lapsed" />
<data:DataGridT extColumn Header="Vendor ID" Width="100"
Binding="{Bindi ng A_VENDOR_ID}" />
<data:DataGridT extColumn Header="Vendor Name" Width="200"
Binding="{Bindi ng A_VENDOR_NAME}" />
<data:DataGridT extColumn Header="Vendor Desc" Width="500"
Binding="{Bindi ng A_VDR_DESC}" />
</data:DataGrid.C olumns>
<data:DataGrid. RowDetailsTempl ate>
<DataTemplate >
<data:DataGri d x:Name="Documen tDataGrid"
AreRowDetailsFr ozen="True" RowDetailsVisib ilityMode="Coll apsed"
HorizontalGridL inesBrush="Blac k" GridLinesVisibi lity="All"
BorderBrush="Bl ack" BorderThickness ="2" AutoGenerateCol umns="FALSE"
ItemsSource="{B inding CAWDOCUMENT}" Height="419" Margin="0,-5,0,0"
IsReadOnly="Tru e" VerticalAlignme nt="Bottom" >

<data:DataGrid. Background>
<LinearGradient Brush EndPoint="0.5,1 "
StartPoint="0.5 ,0">
<GradientStop Color="#C1C1C1" Offset="0.259"/>
<GradientStop Color="#FFFFFFF F" Offset="1"/>
</LinearGradientB rush>
</data:DataGrid.B ackground>
<data:DataGrid. Columns>
<data:DataGridT extColumn Header="DOC_RSN "
Binding="{Bindi ng DOC_RSN}" Visibility="Col lapsed" />
<data:DataGridT extColumn Header="DOC TYPE"
Width="100" Binding="{Bindi ng DOC_TYPE}" />
<data:DataGridT extColumn Header="DOC
Description" Width="200" Binding="{Bindi ng DOC_DESC}" />
<data:DataGridT extColumn Header="Check Number"
Width="100" Binding="{Bindi ng A_CHECK_NO}" />
<data:DataGridT extColumn Header="Amount"
Width="100" Binding="{Bindi ng A_AMOUNT}"/>
<data:DataGridT extColumn Header="Check Date"
Width="600" Binding="{Bindi ng A_CHECK_DATE}"/>
<data:DataGridT emplateColumn Header="Image"
Width="100">
<data:DataGridT emplateColumn.C ellTemplate>
<DataTemplate >
<HyperlinkButto n Content="Image"
TargetName="Ima ge" Foreground="Whi te" NavigateUri="{B inding IMAGE_FILE}">
<HyperlinkButto n.Background >
<LinearGradient Brush
EndPoint="0.5,1 " StartPoint="0.5 ,0">
<GradientStop
Color="#3E5f8a" Offset="0.259"/>
<GradientStop
Color="#FFFFFFF F" Offset="1"/>
</LinearGradientB rush>
</HyperlinkButton .Background>
</HyperlinkButton >
</DataTemplate>
</data:DataGridTe mplateColumn.Ce llTemplate>
</data:DataGridTe mplateColumn>
</data:DataGrid.C olumns>
</data:DataGrid>
</DataTemplate>
</data:DataGrid.R owDetailsTempla te>
</data:DataGrid>
</Grid>

</UserControl>

Code Behind
Imports System.Windows. Data
Partial Public Class Page
Inherits UserControl
Dim ClientHost As ServiceReferenc e1.Service1Clie nt = New
ServiceReferenc e1.Service1Clie nt
Dim dg As New DataGrid
Dim folderrow As ServiceReferenc e1.CAWFOLDER
Public Sub New()
InitializeCompo nent()
AddHandler ClientHost.GetV endorCompleted, AddressOf
ClientHost_GetV endorCompleted
ClientHost.GetV endorAsync()
End Sub
Private Sub ClientHost_GetV endorCompleted( ByVal sender As Object, ByVal
e As ServiceReferenc e1.GetVendorCom pletedEventArgs )
If Not e.Result Is Nothing Then
For Each item In e.Result
cbVendorName.It ems.Add(item)
Next
End If
End Sub
Private Sub cbVendorName_Se lectionChanged( ByVal sender As Object, ByVal
e As System.Windows. Controls.Select ionChangedEvent Args) Handles
cbVendorName.Se lectionChanged
AddHandler ClientHost.GetV endorInfoComple ted, AddressOf
ClientHost_GetV endorInfoComple ted
ClientHost.GetV endorInfoAsync( cbVendorName.Se lectedItem.ToSt ring)
End Sub
Private Sub ClientHost_GetV endorInfoComple ted(ByVal sender As Object,
ByVal e As ServiceReferenc e1.GetVendorInf oCompletedEvent Args)
If Not e.Result Is Nothing Then
FolderDatagrid. ItemsSource = e.Result
End If
End Sub
Private Sub FolderDatagrid_ LoadingRowDetai ls(ByVal sender As Object,
ByVal e As System.Windows. Controls.DataGr idRowDetailsEve ntArgs) Handles
FolderDatagrid. LoadingRowDetai ls
FolderDatagrid. SelectedIndex = e.Row.GetIndex
AddHandler ClientHost.GetV endorDocsComple ted, AddressOf
clientHost_GetV endorDocComplet ed
Dim row As ServiceReferenc e1.CAWFOLDER = FolderDatagrid. SelectedItem()
folderrow = row
If Not row Is Nothing Then
dg = e.DetailsElemen t.FindName("Doc umentDataGrid")
ClientHost.GetV endorDocsAsync( row.FLD_RSN)
End If
End Sub
Private Sub clientHost_GetV endorDocComplet ed(ByVal sender As Object,
ByVal e As ServiceReferenc e1.GetVendorDoc sCompletedEvent Args)
If Not e.Result Is Nothing Then
dg.ItemsSource = e.Result
End If
End Sub

End Class

Nov 4 '08 #1
2 6601
On Nov 4, 5:37*pm, creaves0622 <creaves0...@di scussions.micro soft.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 programmaticall y 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:Syste m.Windows.Contr ols;assembly=Sy stem.Windows.C ontrols.Data"

xmlns:basics="c lr-namespace:Syste m.Windows.Contr ols;assembly=Sy stem.Windows .Controls" *x:Class="ITAcc ountReport.Page "
* * xmlns="http://schemas.microso ft.com/winfx/2006/xaml/presentation"
* * xmlns:x="http://schemas.microso ft.com/winfx/2006/xaml"
* * xmlns:d="http://schemas.microso ft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxml formats.org/markup-compatibility/2006"
mc:Ignorable="d ">
* * <Grid>
* * * * <Grid.RowDefini tions>
* * * * * * <RowDefinitio n Height="25"/>
* * * * * * <RowDefinitio n Height="*"/>
* * * * </Grid.RowDefinit ions>
* * * * <Grid.ColumnDef initions>
* * * * * * <ColumnDefiniti on Width="25"/>
* * * * * * <ColumnDefiniti on Width="380"/>
* * * * * * <ColumnDefiniti on Width="260"/>
* * * * * * <ColumnDefiniti on Width="260"/>
* * * * * * <ColumnDefiniti on Width="*"/>
* * * * * * <ColumnDefiniti on Width="25"/>
* * * * </Grid.ColumnDefi nitions>
* * * * <Grid.Backgroun d>
* * * * * * <LinearGradient Brush EndPoint="0.5,1 " StartPoint="0.5 ,0">
* * * * * * * * <GradientStop Color="#3E5f8a" Offset="0.259"/>
* * * * * * * * <GradientStop Color="#FFFFFFF F" Offset="1"/>
* * * * * * </LinearGradientB rush>
* * * * </Grid.Background >
* * * * <TextBlock x:Name="txtVend orName" HorizontalAlign ment="Left" *
Grid.Row="0" Grid.Column="0" Grid.ColumnSpan ="2" Text="Vendor Name"
Width="Auto" Foreground="Whi te" Margin="0,0,0,0 "/>
* * * * <ComboBox *x:Name="cbVend orName" *HorizontalAlig nment="Left"
Margin="80,0,0, 0" Grid.Row="0" Grid.Column="0" Grid.ColumnSpan ="2"
Width="300" />
* * * * <TextBlock Grid.Row="0" Grid.Column="2" HorizontalAlign ment="left"
x:Name="txtSele ctStartDate" Foreground="Whi te" *Text="Select Start Date"/>
* * * * <basics:DatePic ker Grid.Row="0" HorizontalAlign ment="Left"
Margin="100,0,0 ,0" Grid.Column="2" x:Name="dtStart Date" Width="150" />
* * * * <TextBlock Grid.Row="0" Grid.Column="3" HorizontalAlign ment="Left" *
x:Name="txtSele ctEndDate" Text="Select End Date" Foreground="Whi te"/>
* * * * <basics:DatePic ker Grid.Row="0" HorizontalAlign ment="Left"
Margin="100,0,0 ,0" *Grid.Column="3 " x:Name="dtEndDa te" Width="150" */>
* * * * <Button x:Name="Search" Content="Search " HorizontalAlign ment="Left" *
Grid.Column="4" Grid.ColumnSpan ="2"/>
* * * * <data:DataGri d x:Name="FolderD atagrid" * * *
AutoGenerateCol umns="False" IsReadOnly="Tru e" Grid.Row="1" Grid.Column="1"
Grid.ColumnSpan ="4">
* * * * * * <data:DataGrid. Background>
* * * * * * * * <LinearGradient Brush EndPoint="0.5,1 " StartPoint="0.5 ,0">
* * * * * * * * * * <GradientStop Color="white" Offset="0.259"/>
* * * * * * * * * * <GradientStop Color="#C1C1C1" Offset="1"/>
* * * * * * * * </LinearGradientB rush>
* * * * * * </data:DataGrid.B ackground>
* * * * * * <data:DataGrid. Columns>
* * * * * * * * <data:DataGridT extColumn Header="FolderN umber"
Binding="{Bindi ng FLD_RSN}" Visibility="Col lapsed" />
* * * * * * * * <data:DataGridT extColumn Header="VendorI D" Width="100"
Binding="{Bindi ng A_VENDOR_ID}" />
* * * * * * * * <data:DataGridT extColumn Header="VendorN ame" Width="200"
Binding="{Bindi ng A_VENDOR_NAME}" />
* * * * * * * * <data:DataGridT extColumn Header="VendorD esc" Width="500"
Binding="{Bindi ng A_VDR_DESC}" />
* * * * * * </data:DataGrid.C olumns>
* * * * * * <data:DataGrid. RowDetailsTempl ate>
* * * * * * * * <DataTemplate >
* * * * * * * * * * <data:DataGri d x:Name="Documen tDataGrid"
AreRowDetailsFr ozen="True" *RowDetailsVisi bilityMode="Col lapsed" *
HorizontalGridL inesBrush="Blac k" GridLinesVisibi lity="All" *
BorderBrush="Bl ack" BorderThickness ="2" *AutoGenerateCo lumns="FALSE"
ItemsSource="{B inding CAWDOCUMENT}" * Height="419" Margin="0,-5,0,0"
IsReadOnly="Tru e" *VerticalAlignm ent="Bottom" >

* * * * * * * * * * * * <data:DataGrid. Background>
* * * * * * * * * * * * * * <LinearGradient Brush EndPoint="0.5,1 "
StartPoint="0.5 ,0">
* * * * * * * * * * * * * * * * <GradientStop Color="#C1C1C1" Offset="0.259"/>
* * * * * * * * * * * * * * * * <GradientStop Color="#FFFFFFF F" Offset="1"/>
* * * * * * * * * * * * * * </LinearGradientB rush>
* * * * * * * * * * * * </data:DataGrid.B ackground>
* * * * * * * * * * * * <data:DataGrid. Columns>
* * * * * * * * * * * * * * <data:DataGridT extColumn Header="DOC_RSN "
Binding="{Bindi ng DOC_RSN}" Visibility="Col lapsed" />
* * * * * * * * * * * * * * <data:DataGridT extColumn Header="DOC TYPE"
Width="100" Binding="{Bindi ng DOC_TYPE}" />
* * * * * * * * * * * * * * <data:DataGridT extColumn Header="DOC
Description" Width="200" Binding="{Bindi ng DOC_DESC}" />
* * * * * * * * * * * * * * <data:DataGridT extColumn Header="Check Number"
Width="100" Binding="{Bindi ng A_CHECK_NO}" />
* * * * * * * * * * * * * * <data:DataGridT extColumn Header="Amount"
Width="100" Binding="{Bindi ng A_AMOUNT}"/>
* * * * * * * * * * * * * * <data:DataGridT extColumn Header="Check Date"
Width="600" Binding="{Bindi ng A_CHECK_DATE}"/>
* * * * * * * * * * * * * * <data:DataGridT emplateColumn Header="Image"
Width="100">
* * * * * * * * * * * * * * * * <data:DataGridT emplateColumn.C ellTemplate>
* * * * * * * * * * * * * * * * * * <DataTemplate >
* * * * * * * * * * * * * * * * * * * * <HyperlinkButto n *Content="Image "
TargetName="Ima ge" Foreground="Whi te" *NavigateUri="{ Binding IMAGE_FILE}">
* * * * * * * * * * * * * * * * * * * * * * <HyperlinkButto n.Background >
* * * * * * * * * * * * * * * * * * * * * * * * <LinearGradient Brush
EndPoint="0.5,1 " StartPoint="0.5 ,0">
* * * * * * * * * * * * * * * * * * * * * * * * * * <GradientStop
Color="#3E5f8a" Offset="0.259"/>
* * * * * * * * * * * * * * * * * * * * * * * * * * <GradientStop
Color="#FFFFFFF F" Offset="1"/>
* * * * * * * * * * * * * * * * * * * * * * * * </LinearGradientB rush>
* * * * * * * * * * * * * * * * * * * * * * </HyperlinkButton .Background>
* * * * * * * * * * * * * * * * * * * * </HyperlinkButton >
* * * * * * * * * * * * * * * * * * </DataTemplate>
* * * * * * * * * * * * * * * * </data:DataGridTe mplateColumn.Ce llTemplate>
* * * * * * * * * * * * * * </data:DataGridTe mplateColumn>
* * * * * * * * * * * * </data:DataGrid.C olumns>
* * * * * * * * * * </data:DataGrid>
* * * * * * * * </DataTemplate>
* * * * * * </data:DataGrid.R owDetailsTempla te>
* * * * </data:DataGrid>
* * </Grid>

</UserControl>

Code Behind
Imports System.Windows. Data
Partial Public Class Page
* * Inherits UserControl
* * Dim ClientHost As ServiceReferenc e1.Service1Clie nt = New
ServiceReferenc e1.Service1Clie nt
* * Dim dg As New DataGrid
* * Dim folderrow As ServiceReferenc e1.CAWFOLDER
* * Public Sub New()
* * * * InitializeCompo nent()
* * * * AddHandler ClientHost.GetV endorCompleted, AddressOf
ClientHost_GetV endorCompleted
* * * * ClientHost.GetV endorAsync()
* * End Sub
* * Private Sub ClientHost_GetV endorCompleted( ByVal sender As Object,ByVal
e As ServiceReferenc e1.GetVendorCom pletedEventArgs )
* * * * If Not e.Result Is Nothing Then
* * * * * * For Each item In e.Result
* * * * * * * * cbVendorName.It ems.Add(item)
* * * * * * Next
* * * * End If
* * End Sub
* * Private Sub cbVendorName_Se lectionChanged( ByVal sender As Object,ByVal
e As System.Windows. Controls.Select ionChangedEvent Args) Handles
cbVendorName.Se lectionChanged
* * * * AddHandler ClientHost.GetV endorInfoComple ted, AddressOf
ClientHost_GetV endorInfoComple ted
* * * * ClientHost.GetV endorInfoAsync( cbVendorName.Se lectedItem.ToSt ring)
* * End Sub
* * Private Sub ClientHost_GetV endorInfoComple ted(ByVal sender As Object,
ByVal e As ServiceReferenc e1.GetVendorInf oCompletedEvent Args)

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

* * Private Sub FolderDatagrid_ LoadingRowDetai ls(ByVal sender As Object,
ByVal e As System.Windows. Controls.DataGr idRowDetailsEve ntArgs) Handles
FolderDatagrid. LoadingRowDetai ls
* * * * FolderDatagrid. SelectedIndex = e.Row.GetIndex
* * * * AddHandler ClientHost.GetV endorDocsComple ted, AddressOf
clientHost_GetV endorDocComplet ed
* * * * Dim row As ServiceReferenc e1.CAWFOLDER = FolderDatagrid. .SelectedItem()
* * * * folderrow = row
* * * * If Not row Is Nothing Then
* * * * * * dg = e.DetailsElemen t.FindName("Doc umentDataGrid")
* * * * * * ClientHost.GetV endorDocsAsync( row.FLD_RSN)
* * * * End If
* * End Sub
* * Private Sub clientHost_GetV endorDocComplet ed(ByVal sender As Object,
ByVal e As ServiceReferenc e1.GetVendorDoc sCompletedEvent Args)
* * * * 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_newsgroup s" wrote:
On Nov 4, 5:37 pm, creaves0622 <creaves0...@di scussions.micro soft.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 programmaticall y 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:Syste m.Windows.Contr ols;assembly=Sy stem.Windows.C ontrols.Data"

xmlns:basics="c lr-namespace:Syste m.Windows.Contr ols;assembly=Sy stem.Windows .Controls" x:Class="ITAcco untReport.Page"
xmlns="http://schemas.microso ft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microso ft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microso ft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxml formats.org/markup-compatibility/2006"
mc:Ignorable="d ">
<Grid>
<Grid.RowDefini tions>
<RowDefinitio n Height="25"/>
<RowDefinitio n Height="*"/>
</Grid.RowDefinit ions>
<Grid.ColumnDef initions>
<ColumnDefiniti on Width="25"/>
<ColumnDefiniti on Width="380"/>
<ColumnDefiniti on Width="260"/>
<ColumnDefiniti on Width="260"/>
<ColumnDefiniti on Width="*"/>
<ColumnDefiniti on Width="25"/>
</Grid.ColumnDefi nitions>
<Grid.Backgroun d>
<LinearGradient Brush EndPoint="0.5,1 " StartPoint="0.5 ,0">
<GradientStop Color="#3E5f8a" Offset="0.259"/>
<GradientStop Color="#FFFFFFF F" Offset="1"/>
</LinearGradientB rush>
</Grid.Background >
<TextBlock x:Name="txtVend orName" HorizontalAlign ment="Left"
Grid.Row="0" Grid.Column="0" Grid.ColumnSpan ="2" Text="Vendor Name"
Width="Auto" Foreground="Whi te" Margin="0,0,0,0 "/>
<ComboBox x:Name="cbVendo rName" HorizontalAlign ment="Left"
Margin="80,0,0, 0" Grid.Row="0" Grid.Column="0" Grid.ColumnSpan ="2"
Width="300" />
<TextBlock Grid.Row="0" Grid.Column="2" HorizontalAlign ment="left"
x:Name="txtSele ctStartDate" Foreground="Whi te" Text="Select Start Date"/>
<basics:DatePic ker Grid.Row="0" HorizontalAlign ment="Left"
Margin="100,0,0 ,0" Grid.Column="2" x:Name="dtStart Date" Width="150" />
<TextBlock Grid.Row="0" Grid.Column="3" HorizontalAlign ment="Left"
x:Name="txtSele ctEndDate" Text="Select End Date" Foreground="Whi te" />
<basics:DatePic ker Grid.Row="0" HorizontalAlign ment="Left"
Margin="100,0,0 ,0" Grid.Column="3" x:Name="dtEndDa te" Width="150" />
<Button x:Name="Search" Content="Search " HorizontalAlign ment="Left"
Grid.Column="4" Grid.ColumnSpan ="2"/>
<data:DataGri d x:Name="FolderD atagrid"
AutoGenerateCol umns="False" IsReadOnly="Tru e" Grid.Row="1" Grid.Column="1"
Grid.ColumnSpan ="4">
<data:DataGrid. Background>
<LinearGradient Brush EndPoint="0.5,1 " StartPoint="0.5 ,0">
<GradientStop Color="white" Offset="0.259"/>
<GradientStop Color="#C1C1C1" Offset="1"/>
</LinearGradientB rush>
</data:DataGrid.B ackground>
<data:DataGrid. Columns>
<data:DataGridT extColumn Header="Folder Number"
Binding="{Bindi ng FLD_RSN}" Visibility="Col lapsed" />
<data:DataGridT extColumn Header="Vendor ID" Width="100"
Binding="{Bindi ng A_VENDOR_ID}" />
<data:DataGridT extColumn Header="Vendor Name" Width="200"
Binding="{Bindi ng A_VENDOR_NAME}" />
<data:DataGridT extColumn Header="Vendor Desc" Width="500"
Binding="{Bindi ng A_VDR_DESC}" />
</data:DataGrid.C olumns>
<data:DataGrid. RowDetailsTempl ate>
<DataTemplate >
<data:DataGri d x:Name="Documen tDataGrid"
AreRowDetailsFr ozen="True" RowDetailsVisib ilityMode="Coll apsed"
HorizontalGridL inesBrush="Blac k" GridLinesVisibi lity="All"
BorderBrush="Bl ack" BorderThickness ="2" AutoGenerateCol umns="FALSE"
ItemsSource="{B inding CAWDOCUMENT}" Height="419" Margin="0,-5,0,0"
IsReadOnly="Tru e" VerticalAlignme nt="Bottom" >

<data:DataGrid. Background>
<LinearGradient Brush EndPoint="0.5,1 "
StartPoint="0.5 ,0">
<GradientStop Color="#C1C1C1" Offset="0.259"/>
<GradientStop Color="#FFFFFFF F" Offset="1"/>
</LinearGradientB rush>
</data:DataGrid.B ackground>
<data:DataGrid. Columns>
<data:DataGridT extColumn Header="DOC_RSN "
Binding="{Bindi ng DOC_RSN}" Visibility="Col lapsed" />
<data:DataGridT extColumn Header="DOC TYPE"
Width="100" Binding="{Bindi ng DOC_TYPE}" />
<data:DataGridT extColumn Header="DOC
Description" Width="200" Binding="{Bindi ng DOC_DESC}" />
<data:DataGridT extColumn Header="Check Number"
Width="100" Binding="{Bindi ng A_CHECK_NO}" />
<data:DataGridT extColumn Header="Amount"
Width="100" Binding="{Bindi ng A_AMOUNT}"/>
<data:DataGridT extColumn Header="Check Date"
Width="600" Binding="{Bindi ng A_CHECK_DATE}"/>
<data:DataGridT emplateColumn Header="Image"
Width="100">
<data:DataGridT emplateColumn.C ellTemplate>
<DataTemplate >
<HyperlinkButto n Content="Image"
TargetName="Ima ge" Foreground="Whi te" NavigateUri="{B inding IMAGE_FILE}">
<HyperlinkButto n.Background >
<LinearGradient Brush
EndPoint="0.5,1 " StartPoint="0.5 ,0">
<GradientStop
Color="#3E5f8a" Offset="0.259"/>
<GradientStop
Color="#FFFFFFF F" Offset="1"/>
</LinearGradientB rush>
</HyperlinkButton .Background>
</HyperlinkButton >
</DataTemplate>
</data:DataGridTe mplateColumn.Ce llTemplate>
</data:DataGridTe mplateColumn>
</data:DataGrid.C olumns>
</data:DataGrid>
</DataTemplate>
</data:DataGrid.R owDetailsTempla te>
</data:DataGrid>
</Grid>

</UserControl>

Code Behind
Imports System.Windows. Data
Partial Public Class Page
Inherits UserControl
Dim ClientHost As ServiceReferenc e1.Service1Clie nt = New
ServiceReferenc e1.Service1Clie nt
Dim dg As New DataGrid
Dim folderrow As ServiceReferenc e1.CAWFOLDER
Public Sub New()
InitializeCompo nent()
AddHandler ClientHost.GetV endorCompleted, AddressOf
ClientHost_GetV endorCompleted
ClientHost.GetV endorAsync()
End Sub
Private Sub ClientHost_GetV endorCompleted( ByVal sender As Object, ByVal
e As ServiceReferenc e1.GetVendorCom pletedEventArgs )
If Not e.Result Is Nothing Then
For Each item In e.Result
cbVendorName.It ems.Add(item)
Next
End If
End Sub
Private Sub cbVendorName_Se lectionChanged( ByVal sender As Object, ByVal
e As System.Windows. Controls.Select ionChangedEvent Args) Handles
cbVendorName.Se lectionChanged
AddHandler ClientHost.GetV endorInfoComple ted, AddressOf
ClientHost_GetV endorInfoComple ted
ClientHost.GetV endorInfoAsync( cbVendorName.Se lectedItem.ToSt ring)
End Sub
Private Sub ClientHost_GetV endorInfoComple ted(ByVal sender As Object,
ByVal e As ServiceReferenc e1.GetVendorInf oCompletedEvent Args)

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

Private Sub FolderDatagrid_ LoadingRowDetai ls(ByVal sender As Object,
ByVal e As System.Windows. Controls.DataGr idRowDetailsEve ntArgs) Handles
FolderDatagrid. LoadingRowDetai ls
FolderDatagrid. SelectedIndex = e.Row.GetIndex
AddHandler ClientHost.GetV endorDocsComple ted, AddressOf
clientHost_GetV endorDocComplet ed
Dim row As ServiceReferenc e1.CAWFOLDER = FolderDatagrid. .SelectedItem()
folderrow = row
If Not row Is Nothing Then
dg = e.DetailsElemen t.FindName("Doc umentDataGrid")
ClientHost.GetV endorDocsAsync( row.FLD_RSN)
End If
End Sub
Private Sub clientHost_GetV endorDocComplet ed(ByVal sender As Object,
ByVal e As ServiceReferenc e1.GetVendorDoc sCompletedEvent Args)
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
2012
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
4219
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
2383
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 working with the javascript rather than the server control. The web page looks like this: <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="video5.aspx.cs" Inherits="GalleryServerPro.Web.video5" %>
1
2872
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 silverlight client to Silverlight streaming service. I tried to user WebClient and HttpWebRequest for that purpose but, unfortunately I can found the way to do so. There are some problems with both classes. 1. There is no property of get...
3
689
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 per their MSDN policy. -------------------- I have a web site under .NET 2.0 that renders videos using the Silverlight media player. The web page looks like this: <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="video2.aspx.cs"
7
7165
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 Silverlight 2.0. To get these tools please visit this page Get Started : The Official Microsoft Silverlight Site and follow Step 1. Occasionally you find the need to have users upload multiple files at once. You could use multiple FileUpload...
3
12374
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
10882
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10989
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10504
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
8057
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5899
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
6100
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4734
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4315
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3327
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.