This question is locked. New answers and comments are not allowed.
Hi,
I'm trying to use the MVC grid with dynamic type and Ajax binding. it is working fine until i enable the filterable option enabled in the grid.
When i enable the filter option in the grid, the default filter dropdown has no operators populated in it. below is the code that i have been using and attached a sample screenshot of how the default filter is looking like
in the above code, you will see 'config' instance. this i'm using it for some configuration purpose. please see the attachment and help me resolving this issue
Thanks in advance!
Ravindra
than
I'm trying to use the MVC grid with dynamic type and Ajax binding. it is working fine until i enable the filterable option enabled in the grid.
When i enable the filter option in the grid, the default filter dropdown has no operators populated in it. below is the code that i have been using and attached a sample screenshot of how the default filter is looking like
Html.Telerik().Grid<
dynamic
>()
.Name("Grid")
.Columns(columns =>
{
if (context.Columns != null)
{
foreach (ColumnSettings item in context.Columns)
{
columns.Bound(item.Key).Title(item.Header).Filterable(item.Filterble).Sortable(item.Sortable);
}
}
else
{
columns.AutoGenerate(true);
}
})
.DataBinding(dataBinding => dataBinding.Ajax().Select("_AjaxBinding", "Grid"))
.Pageable(paging => paging.Enabled(config.IsPagable))
.Sortable(sorting => sorting.Enabled(config.IsSortable))
.Filterable(filter => filter.Enabled(config.IsFilterable))
.Groupable(grouping => grouping.Enabled(config.IsGroupable))
in the above code, you will see 'config' instance. this i'm using it for some configuration purpose. please see the attachment and help me resolving this issue
Thanks in advance!
Ravindra
than
5 Answers, 1 is accepted
0
Ravindra
Top achievements
Rank 1
answered on 29 Apr 2011, 03:56 AM
This got resolved by specifying the column type as below
columns.Bound(
typeof
(
decimal
), Key)
0
alonav
Top achievements
Rank 1
answered on 24 May 2011, 04:12 PM
Hi,
I tried to implement the grid with dynamic and it works fine but i still have 2 issues:
issue 1:
i use GridEditMode.InLine for edit and i need to add a key for edit.
when i add it like this:
i get:
Server Error in '/' Application.
Exception Details: Microsoft.CSharp.RuntimeBinder.RuntimeBinderException: 'object' does not contain a definition for 'UnitId'
Source Error:
Source File: c:\GreenroadTech\Applications\Main\GRT.MVC\GRT.MVC\Views\Activities\Index.cshtml Line: 64
Stack Trace:
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.225
issue 2:
i use GridEditMode.PopUpfor edit and i need to add a key for edit and i managed to add a key but when i try to edit a row i get a blank popup
P.S: i rather use popup
THNX
Alon
I tried to implement the grid with dynamic and it works fine but i still have 2 issues:
issue 1:
i use GridEditMode.InLine for edit and i need to add a key for edit.
when i add it like this:
.DataKeys(keys => { keys.Add(
"UnitId"); })
i get:
Server Error in '/' Application.
'object' does not contain a definition for 'UnitId'
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.Exception Details: Microsoft.CSharp.RuntimeBinder.RuntimeBinderException: 'object' does not contain a definition for 'UnitId'
Source Error:
|
Source File: c:\GreenroadTech\Applications\Main\GRT.MVC\GRT.MVC\Views\Activities\Index.cshtml Line: 64
Stack Trace:
|
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.225
issue 2:
i use GridEditMode.PopUpfor edit and i need to add a key for edit and i managed to add a key but when i try to edit a row i get a blank popup
P.S: i rather use popup
THNX
Alon
0
Hi alonav,
Regards,
Atanas Korchev
the Telerik team
Try this instead:
keys.Add(c => c.UnitId)
Regards,
Atanas Korchev
the Telerik team
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Public Issue Tracking
system and vote to affect the priority of the items
0
alonav
Top achievements
Rank 1
answered on 24 May 2011, 04:32 PM
Already tried it and got:
Server Error in '/' Application.
Compiler Error Message: CS1963: An expression tree may not contain a dynamic operation
Source Error:
Source File: c:\GreenroadTech\Applications\Main\GRT.MVC\GRT.MVC\Views\Activities\Index.cshtml Line: 66
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.225
What about the other issue- empty popup edit window?
Server Error in '/' Application.
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.Compiler Error Message: CS1963: An expression tree may not contain a dynamic operation
Source Error:
|
Source File: c:\GreenroadTech\Applications\Main\GRT.MVC\GRT.MVC\Views\Activities\Index.cshtml Line: 66
Show Detailed Compiler Output:
Show Complete Compilation Source:
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.225
What about the other issue- empty popup edit window?
0
Hi alonav,
Atanas Korchev
the Telerik team
You can check this code library project which shows how to use editing in grid bound to dynamic model. If this doesn't help I would ask you to send us your project so we can take a look and see what is wrong with the configuration.
Kind regards,Atanas Korchev
the Telerik team
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Public Issue Tracking
system and vote to affect the priority of the items