ClientView<T> Row type conversion

Posted by: jejego79 on 11 January 2018, 11:45 pm EST

    • Post Options:
    • Link

    Posted 11 January 2018, 11:45 pm EST

    Hi

    I tried to change the type below but it failed. Do you have a good idea?

    
    BindingSource _bindingSource = new BindingSource();
    _bindingSource.DataSource = scope.GetItems();
    _flexGrid.DataSource = _bindingSource;
    ...
    

    MyType myType = _bindingSource.CurrentItem as MyType;

    I want to change the currently selected ClientView type to MyType?

    Thank~

  • Posted 16 January 2018, 12:56 am EST

    Hello,

    You may use the following code snippet for it:

    BindingSource bs = new BindingSource();
    bs.DataSource = _scope.GetItems<Customer>();
    Customer cs = bs.Current as Customer;
    var myCustType=[b] (((C1.LiveLinq.LiveViews.ViewRow)bs.Current).Value as Customer);[/b]   
    // or var a =[b] (((C1.LiveLinq.LiveViews.ViewRow)bs.Current).View.CurrentItem as Customer);[/b]
    

    Where Customer type needs to be replaced with your MyType.

    Thanks,

    Ruchir Agarwal

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels