LiveLinq ViewRow

Posted by: ejbang on 8 November 2017, 1:50 pm EST

    • Post Options:
    • Link

    Posted 8 November 2017, 1:50 pm EST

    I want to change the value in ViewRow when View is added.

    I want to know how to do it.

    View viewList = (from p in _scope.GetItems()

    select new

    {

    p.PublisherNO,

    p.ISBN,

    p.ETC

    }).AsDynamic();

    viewList.Changed += ViewListChanged;

    private void ViewListChanged(object sender, C1.LiveLinq.SourceChangeEventArgs e)

    {

    if (e.ChangeType == C1.LiveLinq.SourceChangeType.Add)

    {

    // I want to set PublisherNO of ViewRow

    }

    }

  • Posted 9 November 2017, 12:56 am EST

    Hi,

    Thank you for sharing the code-snippet.

    Could you refer to following documentation link: http://help.grapecity.com/componentone/NetHelp/EFDataSource/webframe.html#UpdatableViews.html

    and let us know whether it helps you/not. If it does not then I would try to share a sample with you for the requirement.

    Regards,

    Ruchir Agarwal

  • Posted 9 November 2017, 12:21 pm EST

    Thank you for your reply.

    private void ViewListChanged(object sender, C1.LiveLinq.SourceChangeEventArgs e)

    {

    if (e.ChangeType == C1.LiveLinq.SourceChangeType.Add)

    {

    // I want to set PublisherNO of ViewRow ???

    }

    }

    I want to know how to access ViewRow in object sender or SourceChangeEventArgs e.

    Thanks,

    Richard

  • Posted 9 November 2017, 10:01 pm EST

    Hello Richard,

    Thank you for sharing further information.

    I have modified the sample that comes along with ComponentOne and uploaded the same and which can be downloaded using the following URL: https://www.dropbox.com/s/vnyjag37trf4etc/LiveViewsObjects_modified.zip?dl=0

    The sample contains two DataGridView, and as soon as you click on Add Row template for second grid, ViewRow’s OrderID and ShipCity are set and shown in first grid.

    Hope this helps.

    Thanks,

    Ruchir Agarwal

  • Posted 12 November 2017, 11:32 pm EST

    Thank you for helping me solve the problem.

    View viewList = (from p in _scope.GetItems()

    select new

    {

    p.PublisherNO,

    p.ISBN,

    p.ETC

    }).AsDynamic();

    I want to change the PublisherNO using viewList.CurrentItem.

    I want to know how to use CurrentItem.

    Thanks,

    Richard

  • Posted 15 January 2018, 4:06 pm EST

    Hello Richard,

    I am discussing this requirement with the developers {Tracking ID: 297457}. I will share the solution with you once we have some information.

    Regards,

    Ruchir Agarwal

  • Posted 12 February 2018, 2:27 pm EST

    Hello Richard,

    If our understanding for your requirement is correct then, you use anonymous type for View<>, but CurrentItem has object type, hence you want to cast object to your anonymous type.

    If its so, then please refer to the workaround mentioned in the following post:

    https://stackoverflow.com/questions/1409734/cast-to-anonymous-type

    Regards,

    Ruchir Agarwal

Need extra support?

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

Learn More

Forum Channels