GridView display correct number of rows, but no data

1 posts, 0 answers
  1. Dexter
    Dexter avatar
    34 posts
    Member since:
    Dec 2012

    Posted 13 Mar 2014 Link to this post

    Hi, I'm trying to pass a list into GridView. It always display the correct number of rows according to the list I pass in, but all cells are blank. Any idea why this is so?

    <telerik:RadGridView x:Name="gridCommsEqp" CanUserDeleteRows="False" ItemsSource ="{Binding}" AutoGenerateColumns="False" CanUserInsertRows="False" IsSynchronizedWithCurrentItem="True" ColumnWidth ="Auto" Width ="500" Margin="488,23,62,262" CanUserResizeRows="True" IsReadOnly="True" MouseDoubleClick="gridCommsEqp_MouseDoubleClick">
                <telerik:RadGridView.Columns>
                    <telerik:GridViewDataColumn DataMemberBinding="{Binding Path=SSN}" Header="SSN" UniqueName="SSN" TextWrapping="Wrap"/>
                    <telerik:GridViewDataColumn DataMemberBinding="{Binding Path=Description}" Header="Description" UniqueName="Description" TextWrapping="Wrap"/>
                    <telerik:GridViewDataColumn DataMemberBinding="{Binding Path=CurrentQty}" Header="CurrentQty" UniqueName="CurrentQty" TextWrapping="Wrap"/>
                    <telerik:GridViewDataColumn DataMemberBinding="{Binding Path=TotalQty}" Header="TotalQty" UniqueName="TotalQty" TextWrapping="Wrap"/>
                    <telerik:GridViewDataColumn DataMemberBinding="{Binding Path=Assemblage}" Header="Assemblage" UniqueName="Assemblage" TextWrapping="Wrap"/>
                    <telerik:GridViewDataColumn DataMemberBinding="{Binding Path=UI}" Header="UI" UniqueName="UI" TextWrapping="Wrap"/>
                </telerik:RadGridView.Columns>
            </telerik:RadGridView>

    Dictionary<string, List<CommsEqp>> sd = new Dictionary<string, List<CommsEqp>>();
                sd = issueAdapt.getAllCommsEqp();
                gridCommsEqp.DataContext = sd["nonSetEquips"];
            }
    //gridCommsEqp.DataContext = issueAdapt.getAllCommsEqp().DefaultView.Table;



    Above are my codes. The last line, which is the commented codes, works if I get "issueAdapt.getAllCommsEqp()" to return a DataTable.

Back to Top