Calling a UDF for populating a RadGridView, fails

2 posts, 0 answers
  1. Enric
    Enric avatar
    32 posts
    Member since:
    Apr 2013

    Posted 17 Sep 2013 Link to this post

    Hi ya, I'm trying to populate one RadGridView using an UDF Sql Server which waits a parameter but it doesn't work:


    XAML:

    <telerik:RadGridView x:Name="dgvHistoricoOR"  HorizontalAlignment="Left" FontFamily="Segoe UI"
                                           FontSize="12" FontStyle="Normal"
              Margin="10,44,-185,0"  VerticalAlignment="Top" Height="175" Width="437"
              ColumnWidth="SizeToCells" Grid.ColumnSpan="2" Grid.RowSpan="2">
     
              <telerik:RadGridView.Columns>
                  <telerik:GridViewDataColumn DataMemberBinding="{Binding ord_repalpha}" Header="{Resx RadGridViewOr_Or}"
                                              Width="40"/>
                          <telerik:GridViewDataColumn DataMemberBinding="{Binding F_Alta}" Header="{Resx RadGridViewOr_Alta}"
                                                      Width="60"/>
                          <telerik:GridViewDataColumn DataMemberBinding="{Binding F_Cierre}" Header="{Resx RadGridViewOr_Cierre}"
                                                      Width="60"/>
              </telerik:RadGridView.Columns>

    Code-behind:


    ada = New SqlDataAdapter("SELECT * FROM OR_Historico_Por_Cliente(@par1)", aBD.connection)
            ada.SelectCommand.Parameters.AddWithValue("@par1", Documento)
     
     
            ada.Fill(ds, "OR_Historico_Por_Cliente")
            Me.dgvHistoricoOR.ItemsSource = "OR_Historico_Por_Cliente"
     
            Me.dgvHistoricoOR.DataContext = ds




    OR_Historico_Por_Cliente('') UDF Sql2k8 returns a TABLE

    I don't get data, my Grid remains empty

    I wonder, when I call Fill method, should I include the value for the parameter???


    Help!
  2. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 20 Sep 2013 Link to this post

    Hi,

    The approach filling RadGridView will be the same as with MS DataGrid. Would you please also try populating the DataGrid?  

    Regards,
    Didie
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  3. UI for WPF is Visual Studio 2017 Ready
Back to Top