Hierarchical Databinding with Linq to SQL?

You're right, it is long, but kudos on including some code, JIC It does seem apparent that you're not going to be able to do this with ordinary DataBinding. I'm not too keen on storing this in session, but I do understand that you don't want a postback What you might want to do is set up an Ajax call so that you can stick your new record (or your record change) into the DataContext. When the form is submitted, you can call SubmitChanges on the DataContext.

You're right, it is long, but kudos on including some code, JIC. It does seem apparent that you're not going to be able to do this with ordinary DataBinding. I'm not too keen on storing this in session, but I do understand that you don't want a postback.

What you might want to do is set up an Ajax call so that you can stick your new record (or your record change) into the DataContext. When the form is submitted, you can call SubmitChanges on the DataContext.

1 for reading and giving me some coherent perspective :) You mention that you're not too keen on using the session for this, and honestly, I'm not either. I'd much rather have an atomic request - any ideas there on how you would've handled it? Love the Ajax idea.

– JoshJordan Jul 3 '09 at 20:29 Well, the Ajax call would allow you to make an "update this membership" call to the DataContext, without requiring a full postback. The Ajax can potentially be handled with one of the Ajax script handler controls/panels. I'm sorry I'm not more qualified to answer your question in more detail.

I built a prototype for something some months ago this way, but got frustrated and switched to ASP. NET MVC. In MVC this can be handled either through an AJAX call or a JSON call, and it hits a specific method on a C# class, directly.

– Robert Harvey? Jul 3 '09 at 20:43.

Seems to me Josh that trying to manage your many-to-many relationship from within the Faculty Member grid is not the right approach. In fact, I can't really visualise how this would work inside a grid, I am not surprised that you are lost :) Better to use a 'detail' page where the context is = to a single Faculty member and provide a 'double list' interface for division membership maintenence. This would consist of 2 lists.

The righthand list shows all the divisions to which the faculty member is already a member(DivisionMembership rows where FacultymemberId = the context id) , the left hand list would show all the remaining Divisions. You could then provide '>>' and.

1 for the reply, as above. I agree - I wanted to do something similar. In fact, I have such a page, but I also have a requirement to allow management right from within this grid.My intuition tells me that it should be easy to bind to a list property (DivisionMemberships) of the parent BindingContainer, but it seems that this is not supported.

I also want to use as much autogenerated (non-ad-hoc) code as possible. – JoshJordan Jul 9 '09 at 3:07 But what are you going to bind? It would need to be a multi-select list right?

Or a checkbox list? – Michael Dausmann Jul 9 '09 at 3:44 A checkbox list isn't hard to visualize.It should be possible to bind it. – Danra Jul 11 '09 at 0:47.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions