RadGridView binding to LLBLGen Entity Collections Master Detail / Updates

13 posts, 0 answers
  1. erwin
    erwin avatar
    358 posts
    Member since:
    Dec 2006

    Posted 23 Jul 2008 Link to this post

    Has anybody managed to bind the Grid View in Master/Detail to LLBLGen
    related EntityCollections with Edit / Insert / Delete enabled and
    database-generated ID fields?

    If so, I'd be interested in some code examples - or some hints about how to
    implement insert of detail records to new master records (that have no ID yet)
    and the implementation of deferred delete logic.

    Regards
    Erwin



  2. Dimitar Kapitanov
    Admin
    Dimitar Kapitanov avatar
    632 posts

    Posted 08 Aug 2008 Link to this post

    Hi erwin,

    I am sorry for writing just now - I needed some time to prepare the example for you.

    Attached you will find a small and simple solution that demonstrates how RadGridView displays and handles hierarchical data that comes from a LLBLGen generated DAL. To run the sample application, you will need to have a distribution of LLBLGen Pro ver.2.6 and RadControls for WinForms Q2 2008 (ver.7.0.0.0.0) installed.

    Please give us your feedback on what else should be demonstrated and/or enhanced in the provided example.
     

    Sincerely yours,
    Dimitar Kapitanov
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. erwin
    erwin avatar
    358 posts
    Member since:
    Dec 2006

    Posted 09 Aug 2008 Link to this post

    Dimitar, thanks for the sample.

    What is unclear to me:

    when I insert a new row in the master table, how can I then insert new rows
    into the detail table.

    how should I handle deletes

    how should I handle ID columns generated by the database

    I have some constraints on the child table (some values should be unique
    within all child records. Where's the best place to add checking and error
    handling code?

    Basically what I'm looking for is a user-friendly master/detail grid
    layout that allows CRUD on the master and and detail tables.

    regards Erwin




    regard

    Were some issues fixed on 2008Q2 because even my old code that threw
    errors on Q1 seems to work now (at least for displaying).

    regards
    erwin




  5. Dimitar Kapitanov
    Admin
    Dimitar Kapitanov avatar
    632 posts

    Posted 11 Aug 2008 Link to this post

    Hello Erwin,

    The task of inserting the rows is relatively easy. You need to use the GridViewRowCollection and its methods like:

    You can access the GridViewRowCollection  on the level to be modified through the property Rows of the RadGridViewTemplate instance that handles the respected level. In case of the second level for example you get the second level template from the ChildGridViewTemplates property of RadGridVIew's MasterGridViewTemplate property. The whole idea is that the template hierarchy is organized into "parent-child" manner - the "parent template" has a ChildGridViewTemplates that on its turn contains the "child" templates.

    So the GridViewRowCollection  has a method with the following signature:
    public GridViewDataRowInfo AddNew(GridViewDataRowInfo parent) 
    where you give the "master" row instance and the method returns a reference to a newly created "child instance". All fields that are generated by the data base like IDs are pre-populated and available

    Also you can tune the behavior of the new row through the event DefaultValuesNeeded event exposed by the RadGridView component.


    The delete operation is handled again through the Rows collection with the methods:
    public bool Remove(GridViewDataRowInfo item) 
    public void RemoveAt(int index) 

    Also you can put/execute your logic regarding the child rows in the event RowsChanging event exposed by the RadGridView component. You can cancel the update there. Also through the arguments you can see the type of the operation (insert, delete, clear, etc.) and the template that owns the Rows collection (thus providing the context of the level in the hierarchy).

    If there is anything else we can help with, do not hesitate to contact us.

    Best wishes,
    Dimitar Kapitanov
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  6. erwin
    erwin avatar
    358 posts
    Member since:
    Dec 2006

    Posted 11 Aug 2008 Link to this post

    Thanks for the reply. However, I don't want to add a new row by code.

    The question is/was:

    How can I configure the grid so that if the User adds a new master record,
    he can then expand the hierarchy and add child records to the newly created
    master record.

    Some functional sample code, where the user can actually create, update,
    insert and delete master and details rows (plus all combinations)
    through the UI would help me a lot.


    Erwin
  7. Dimitar Kapitanov
    Admin
    Dimitar Kapitanov avatar
    632 posts

    Posted 14 Aug 2008 Link to this post

    Hi Erwin,

    At present, you have experienced one of the design limitations, which should be addressed for the Q3 release. We assumed (for optimization reasons) that when there are no child rows no  expansion should occur, thus rendering the visual building of a hierarchy impossible. This will be corrected through a property that sets which behavior is to be used. Please give us your feedback on this approach.

    Kind regards,
    Dimitar Kapitanov
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  8. erwin
    erwin avatar
    358 posts
    Member since:
    Dec 2006

    Posted 19 Aug 2008 Link to this post

    Have to say, I'm disappointed, that everywhere where I do a little bit
    more than just scratching the surface of RadControls for WinForms
    I run into what you call "Design Limitations".


  9. Vassil Petev
    Admin
    Vassil Petev avatar
    1765 posts

    Posted 21 Aug 2008 Link to this post

    Hello erwin,

    This is indeed a design limitation, albeit if I had to reply to your previous reply, I would have said it in another way.

    The ability to create, update, insert and delete rows when there are no children in the hierarchy is not present in the current version of the control. This is a very valid feature request, which we plan to implement for the next major version of RadGridView. I suspect that this is an important feature for you, and I can provide you with a pre-release version of this feature as soon as it is ready. Of course, we would be happy to hear your comments about the implementation Dimitar suggested so that we take care of this limitation.


    Best wishes,
    Vassil
    Unit Manager
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  10. erwin
    erwin avatar
    358 posts
    Member since:
    Dec 2006

    Posted 21 Aug 2008 Link to this post

    Hi Vassil,

    I'm currently developing a design study for a new version of a PC inventory system. Can upload some screenshots if you are interested.
    The projects is at a stage where you get the WOW effect, similar to looking
    at the demos of RadControls, but when it gets to actually implement functionality or when I demo the prototype with users of the old system which is based on the standard .net controls, there are nasty bugs and limitations creeping up - see my bug reports.

    This is a bit frustrating, and sometimes I this leaks through when I put a reply here or file a bug report.

    regards
    Erwin
  11. erwin
    erwin avatar
    358 posts
    Member since:
    Dec 2006

    Posted 21 Aug 2008 Link to this post

    As for your suggestion about prelease of the RadGridView, I'd give the pre-release version a try, but can not promise thorough testing, because I can't predict resource planning for this UI design study, also I would probably need some support on how to implement binding to the LLBLGen OR mapper.

    Regards
    Erwin
  12. Vassil Petev
    Admin
    Vassil Petev avatar
    1765 posts

    Posted 26 Aug 2008 Link to this post

    Hi erwin,

    We will be able to assist you with LLBLGen Pro - this won't be a problem.

    I would also like to review the screenshots you mentioned - please, forward them to VPETEV at Telerik COM. We are looking for rich applications, created by our clients. Let's discuss this, and some other ideas through mail - hopefully we will be able to help you out.


    Sincerely yours,
    Vassil
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  13. Ramius
    Ramius avatar
    127 posts
    Member since:
    Feb 2008

    Posted 19 Jan 2009 Link to this post

    Hello,

    i also need the feature Erwin asked for. ( The ability to create, update, insert and delete rows when there are no children in the hierarchy  )

    Do you have a timeframe when it will be available ?

    Greetings,

    Ramius
  14. Nick
    Admin
    Nick avatar
    767 posts

    Posted 20 Jan 2009 Link to this post

    Hi Ramius,

    Thank you for your feedback. We currently do not have a specific target release however we always determine the priority of a new feature based on customer demand.

    Thank you for your vote, we will raise the priority for this feature. Do not hesitate to write us back if you have more questions.

    Best wishes,
    Nick
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Back to Top
UI for WinForms is Visual Studio 2017 Ready