This question is locked. New answers and comments are not allowed.
Hello All,
I am using a dynamically build Grid in my mvc 3 app. I am displaying it from a partial View.
I have set my GridColumnSettings up with no trouble. However; A few things I am struggling with.
1. If I add the GridCommandColumnSettings in my columns I get the error:
InvalidOperationException: Templates can be used only with field access, property access, single-dimension array index, or single-parameter custom indexer expressions.]
This is my Settings code
I do not understand what that is saying.
2. I cant seem to find anywhere that shows how to add a ClientTemplate of type checkbox to the GridColumnSettings, is that possible and if so an example would be great.
3. How do I implement sorting etc. since this is a partial view?
Another thing, why cant my GridColumnSettings Title have a space in it?
ex
it will error on the Title.
Any help would be greatly appreciated.
Thanks
Squeal
I am using a dynamically build Grid in my mvc 3 app. I am displaying it from a partial View.
I have set my GridColumnSettings up with no trouble. However; A few things I am struggling with.
1. If I add the GridCommandColumnSettings in my columns I get the error:
InvalidOperationException: Templates can be used only with field access, property access, single-dimension array index, or single-parameter custom indexer expressions.]
This is my Settings code
public static GridColumnSettings[] columns(){ GridColumnSettings[] columns = new[] { new GridCommandColumnSettings { Commands = { new GridEditActionCommand(), new GridDeleteActionCommand() }, Width = "200px", Title = "Commands" }, new GridColumnSettings { Member = "DeliveryID", Title = "DeliveryID", Visible = false}, new GridColumnSettings { Member = "MarkAs", Title = "Mark_As_Delivered" }, new GridColumnSettings { Member = "Priority", Title = "Priority"}, new GridColumnSettings { Member = "Build", Title = "Build"}, new GridColumnSettings { Member = "System", Title = "System_#"}, new GridColumnSettings { Member = "DeliveryName", Title = "Delivery_Name"}, new GridColumnSettings { Member = "Owner", Title = "Owner"}, new GridColumnSettings { Member = "HostName", Title = "Host"}, new GridColumnSettings { Member = "DeliveryType", Title = "Delivery_Type"}, new GridColumnSettings { Member = "ShipTo", Title = "Ship_To"}, new GridColumnSettings { Member = "DeliverTo", Title = "Deliver_To"}, new GridColumnSettings { Member = "DeliveryNotes", Title = "Delivery_Notes"}, new GridColumnSettings { Member = "Usage", Title = "Usage"}, new GridColumnSettings { Member = "EstDate", Title = "Est.Date"}, new GridColumnSettings { Member = "ActDate", Title = "Act.Date"}, new GridColumnSettings { Member = "OrderNotes", Title = "Order_Notes"} }; return columns;}I do not understand what that is saying.
2. I cant seem to find anywhere that shows how to add a ClientTemplate of type checkbox to the GridColumnSettings, is that possible and if so an example would be great.
3. How do I implement sorting etc. since this is a partial view?
Another thing, why cant my GridColumnSettings Title have a space in it?
ex
new GridColumnSettings { Member = "DeliveryName", Title = "Delivery Name"}, Any help would be greatly appreciated.
Thanks
Squeal