New data bound row registered through DI source

3 posts, 0 answers
  1. Travis
    Travis avatar
    49 posts
    Member since:
    Dec 2012

    Posted 03 May 2013 Link to this post

    Hello,

    I am learning how to wire up a new row with my backing data source list. In and of itself, straightforward enough, the objects constituting the backing list need to have a parameterless constructor. Simple enough.

    Now for the twist. I have an architecture in the view that wires up some bbv EventBroker events, which ordinarily (ideally, preferred) wire up through a Ninject Dependency Injection Kernel OnActivation, I register some pub/sub events to route communication between objects behind the scenes.

    So... Is it possible for me to wire up the RadGridView object-factory (object-provider? -context?) in such a way that I can factory-create the object(s) backing the row(s) being created?

    Thank you once again for the rich UX API, and thank you...

    Regards,

    Michael Powell
  2. Travis
    Travis avatar
    49 posts
    Member since:
    Dec 2012

    Posted 03 May 2013 Link to this post

    Possibly related, corollary to this one: the events are working through the EventBroker as far as they shake out. By that I mean, the data model backing the RadGridView is receiving the correct updates. However, attempts to refresh or invalidate the grid are not working.

    Here's the scenario: I am using a Checkbox (bool) property bound to a model view (wrapper to the model). This appears in the grid and I can edit okay. I want it to be a one-row-at-a-time-checked operation. When I check one, the others should uncheck, and so on. If I uncheck one, no-op on the others (effectively).

    As I said the model backing the grid is itself working. However, the grid is not receiving the updates. I have verified that I am issuing a PropertyChanged event for the model. This is consistent throughout the model and model view.

    Any ideas? Do I need to force each row to subsequently invalidate?

    *Edit*: Okay, so through some EventBroker wizardry, I have the view containing the RadGridView also listening for the selected event, and subsequently coordinating GridViewRowInfo.InvalidateRow() for DataBoundItems matching the thing being viewed.
  3. Peter
    Admin
    Peter avatar
    1160 posts

    Posted 08 May 2013 Link to this post

    Hi Michael,

    It seems that your application is quite complex and you are using many technologies in it and I am not sure that I understand your scenario precisely.

    However, RadGridView should update automatically when the underlying source is updated (considering the objects are in an IBindingList collection and they implement the INotifyPropertyChanged interface). If this does not happen in your scenario I could suggest to update the grid manually in the OnPropertyChanged event using MasterTemplete's Refresh method:
    this.radGridView1.MasterTemplate.Refresh();
    and vice versa you can update the underlying source using the grid's CellValueChanged event and push the changed values back to the database.

    I really hope that this is applicable for your application.

    Greetings,
    Peter
    the Telerik team
    WinForms Q1 2013 boasts PivotGrid, PDF Viewer, Chart enhancements and more. Check out all of the latest highlights.
Back to Top