WPF passing the Int argument to a data object provider method
        Posted  
        
            by SAD
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by SAD
        
        
        
        Published on 2010-04-18T09:15:00Z
        Indexed on 
            2010/04/18
            9:23 UTC
        
        
        Read the original article
        Hit count: 385
        
Hi, I'm trying to produce a master/detail datagrid view. I'm using object data providers. Now I have seen many examples when the argument of a method for returning the records for the detail view is a string, like in this example:
    <!-- the orders datasource -->
    <ObjectDataProvider x:Key="OrdersDataProvider"
       ObjectType="{x:Type local:OrdersDataProvider}"/>
    <ObjectDataProvider x:Key="Orders" MethodName="GetOrdersByCustomer"
            ObjectInstance="{StaticResource OrdersDataProvider}" >
        <ObjectDataProvider.MethodParameters>
            <x:Static Member="system:String.Empty"/>
        </ObjectDataProvider.MethodParameters>
    </ObjectDataProvider>
But in my case, the argument that I want to pass is the int ID not the string. Can I still somehow use the object data provider to return all the records from the database for the detail view if the argument passed to a method has to be an int? How could it be implemented in MVVM?
Thanks a lot for any advice1
© Stack Overflow or respective owner