hi, does binding an EntitySet to DevExpress ASPXGridView is allowed directly, or i need to do something to allow filling the grid from an EntitySet, also write to the EntitySet(ex: if i have an "Order", and its EntitySet property "OrderDetails")

asked Jan 18 '11 at 08:11

ahmad%20emad's gravatar image

ahmad emad

Hello Ahmad,

Could you tell me, which version of DataObjects.Net you are using? I'm asking because in 4.4 beta 1 we've made significant changes in this subject.

(Jan 18 '11 at 08:15) Dmitri Maximov Dmitri%20Maximov's gravatar image

Hi Dmitri, thanks for you replay, my version is V4.3.6(build 6965), so i think i should install version 4.4.1, but what is the changes?

(Jan 18 '11 at 08:21) ahmad emad ahmad%20emad's gravatar image

There are tons of changes, actually. The release notes can be found here. I should mention that as 4.4 has dramatic changes, you should use the Project Upgrade Tool that will help you to convert 4.3 project to 4.4 one.

Concerning your question: 4.3 version provides binding of EntitySet to grids but you have to keep transaction open until UI form is closed, or you should use DisconnectedState component, while 4.4 provides special profile for Session (ClientProfile) which doesn't require all these tricks.

Hope that helps.

(Jan 18 '11 at 08:37) Dmitri Maximov Dmitri%20Maximov's gravatar image

Hi Dmitri, could you please provide me with the name space which contain those changes, as i am unable to find them.

(Jan 18 '11 at 10:22) ahmad emad ahmad%20emad's gravatar image

Ahmad, the changes are described in DataObjects.Net 4.4 beta 1 Release Notes, and the link points right there.

(Jan 18 '11 at 10:31) Dmitri Maximov Dmitri%20Maximov's gravatar image

sorry for misunderstanding

(Jan 18 '11 at 13:16) ahmad emad ahmad%20emad's gravatar image

One Answer:

Some hints using ASPxGridView:

  1. Add <dx:LinqServerModeDataSource ID="linqDataSource" runat="server" OnSelecting="linqDataSource_Selecting" /> within aspxgridview instance and link gridview to this datasource.

  2. Create method linqDataSource_Selecting with something line this one:

    protected void linqDataSource_Selecting(object sender, DevExpress.Data.Linq.LinqServerModeDataSourceSelectEventArgs e) { e.QueryableSource = Query.All<MyEntity>().Where(...); e.KeyExpression = "Id"; // specify key field }

If you have any problems just ask, i have working application using ASPxGridView + DO4 v4.3.

answered Jan 18 '11 at 16:57

Peter%20%C5%A0ulek's gravatar image

Peter Šulek

edited Jan 18 '11 at 16:58

Thanks Peter,right now i am trying something similar to your idea: i am creating ArrayList of the type to be binded to the grid(just temp array), then I registered methods on grid events(Inserting, updating and deleting). i am trying to let the grid perform operations on an EntitySet of an Entity (the Details of master record) using reflection (as types are unknown till runtime). i have a question regarding handle inserting within grid RowInserting event here thanks again

(Jan 19 '11 at 06:51) ahmad emad ahmad%20emad's gravatar image

Thanks Peter, i used your solution (LinqServerModeDataSource) and it works

(Jan 19 '11 at 13:53) ahmad emad ahmad%20emad's gravatar image

You're welcome :-)

(Jan 19 '11 at 14:58) Peter Šulek Peter%20%C5%A0ulek's gravatar image
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!
toggle preview

powered by OSQA