Hi Team,
I have a problem with the webdatagrid using <asp:EntityDataSource>. I have configured the datasource like this:
<asp:EntityDataSource ID="EntityDataSource_D_CG_SYSTEM_ROLE" runat="server" ConnectionString="name=DBEntities" DefaultContainerName="DBEntities" EnableDelete="True" EnableFlattening="False" EnableInsert="True" EnableUpdate="True" EntitySetName="D_CG_SYSTEM_ROLE" > </asp:EntityDataSource>
D_CG_SYSTEM_ROLE is my table in the oracle database and the name of the entity class.
DBEntities is the entity container name.
I can insert, update and delete without problems using this datasource and the grid. But when I try to set a filter I get an [EntitySqlException]:
'DICT_ENTRY' could not be resolved in the current scope or context. Make sure that all referenced variables are in scope, that required schemas are loaded, and that namespaces are referenced correctly. Near escaped identifier, line 6, column 1.
I bind the data to the grid like this:
if (e.NewValue.ToString() == "D_CG_SYSTEM_ROLE"){ this.WebDataGrid.DataSourceID = "EntityDataSource_D_CG_SYSTEM_ROLE"; BoundDataField boundField1 = new BoundDataField(true); boundField1.Key = "DICT_ENTRY"; boundField1.Header.Text = "DICT_ENTRY"; boundField1.DataFieldName = "DICT_ENTRY"; // ADD COLUMNS this.WebDataGrid.Columns.Clear(); this.WebDataGrid.Columns.Add(boundField1); this.WebDataGrid.RequestFullAsyncRender();
}
Do you have any suggestions what I'm doing wrong?
Hi Jenswitte19,
We are still following this forum thread.Have you been able to take a look at the provided link ?
If you have any other questions please do not hesitate to contact us.
Sincerely,
Dimi
Developer Support Engineer
Infragistics
www.infragistics.com/support
Hi Team.
sorry for my late reply, I was on vacation.
I looked at the link but nothing in this post helped me.
I tried to get closer to the problem but I'm still not able to solve it. First I thought it could be a problem with the Oracle database, so I created a new solution and mapped it with a sql server db. The problem still exists.
What I did:
- Create a new solution in Visual Studio (ASP.net Web Application)
- Create new database, create a new table on a sql server
- Add a new 'Ado.net Entity Data Model' and connect it to the SQLServer DB
- Add to default.aspx: ScriptManager, EntitiyDataSource, WebDataGrid
- Connect them. After that it looks like that:
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:EntityDataSource ID="EntityDataSource1" runat="server" ConnectionString="name=Entities" DefaultContainerName="Entities" EntitySetName="VALUE_TYPE" >
</asp:EntityDataSource>
<ig:WebDataGrid ID="WebDataGrid1" runat="server" Height="350px" Width="400px" DataSourceID="EntityDataSource1" >
<Behaviors>
<ig:Filtering>
</ig:Filtering>
</Behaviors>
</ig:WebDataGrid>
The name of my table is 'VALUE_TYPE'
- Run it. I get the decribed error.
Perhaps you can try the same to help me?
Hi jenswitte19,
I have tested your scenario following the steps you described, but I am so far unable to reproduce the issue. Can you please provide me with a sample markup for the grid and datasource and code-behind for data binding. Thank you.
Hi Nikolay,
thanks for helping me.
The datasource is an entity (created with the object relational mapper), so there are no further data binding steps.
The ASP EntityDataSource control is designed to connect directly to this entity. The IG WebDataGrid is connected to the ASP EntityDataSource.
I only enable the filtering for the grid. there is not further code behind. You can see the complete relevant code in my last post.
I attached my test visual studio project to this post. Perhaps it helps to clarify something.
You have to change the entity connection or create a sql server database (Mine is connected with the SQLServer database "Test" and has the table "VALUE_TYPE").
When I run this code I see the WebDataGrid on the default.aspx site. When I try to filter I get the exception.
Thanks again for testing.
Hello jenswitte19,
This behavior has been already logged in our internal tracking system with a development ID 115326. You support ticket number regarding this matter is CAS-94619-XSBWR1. You can view the status of the development issue connected to this case by going to Account > Support Activity on our website and selecting the "Development Issues" tab when viewing this case. You will be notified when the fix is available.
Please let me know if you need more information.
Hi Chris,
This is a bug in the grid, but it is currently awaiting release and the fix will be included in the next service release - http://ko.infragistics.com/help/service-releases/.
Let me know if you have any other questions.
Nikolay,
Does the development issue mean the WebDataGrid filtering does not work with an EntityDataSource right now?
I just started working with the WebDataGrid and I have an EntityDataSource and I'm getting this error with filtering too.
I'm wondering if I should continue investigating if I'm doing something wrong or is it a bug with the grid.
Thanks,
Chris