I want to use a "GridDropDownColumn" column as shown in the example:
<
form
id
=
"form1"
runat
=
"server"
>
<
telerik:RadScriptManager
ID
=
"RadScriptManager1"
runat
=
"server"
>
<
scripts
>
<
asp:ScriptReference
Assembly
=
"Telerik.Web.UI"
Name
=
"Telerik.Web.UI.Common.Core.js"
/>
<
asp:ScriptReference
Assembly
=
"Telerik.Web.UI"
Name
=
"Telerik.Web.UI.Common.jQuery.js"
/>
<
asp:ScriptReference
Assembly
=
"Telerik.Web.UI"
Name
=
"Telerik.Web.UI.Common.jQueryInclude.js"
/>
</
scripts
>
</
telerik:RadScriptManager
>
<
telerik:RadGrid
ID
=
"RadGrid1"
runat
=
"server"
AllowSorting
=
"True"
AllowPaging
=
"True"
DataSourceID
=
"LinqDataSource1"
AutoGenerateColumns
=
"False"
ShowGroupPanel
=
"True"
EnableHeaderContextMenu
=
"True"
>
<
pagerstyle
mode
=
"NextPrevAndNumeric"
/>
<
ClientSettings
AllowDragToGroup
=
"True"
/>
<
mastertableview
commanditemdisplay
=
"Top"
datakeynames
=
"ProductID"
datasourceid
=
"LinqDataSource1"
editmode
=
"InPlace"
>
<
Columns
>
<
telerik:GridBoundColumn
DataField
=
"ProductName"
HeaderText
=
"ProductName"
SortExpression
=
"ProductName"
UniqueName
=
"ProductName"
/>
<
telerik:GridDropDownColumn
DataField
=
"CategoryID"
DataType
=
"System.Int32"
HeaderText
=
"Category"
UniqueName
=
"CategoryID"
DataSourceID
=
"LinqDataSource2"
ListValueField
=
"CategoryID"
ListTextField
=
"CategoryName"
SortExpression
=
"Categories.CategoryName"
GroupByExpression
=
"Categories.CategoryName [Category] Group By Categories.CategoryName"
/>
<
telerik:GridBoundColumn
DataField
=
"UnitPrice"
HeaderText
=
"UnitPrice"
SortExpression
=
"UnitPrice"
UniqueName
=
"UnitPrice"
/>
<
telerik:GridBoundColumn
DataField
=
"UnitsInStock"
HeaderText
=
"UnitsInStock"
SortExpression
=
"UnitsInStock"
UniqueName
=
"UnitsInStock"
/>
<
telerik:GridCheckBoxColumn
DataField
=
"Discontinued"
HeaderText
=
"Discontinued"
SortExpression
=
"Discontinued"
UniqueName
=
"Discontinued"
/>
</
Columns
>
</
mastertableview
>
</
telerik:RadGrid
>
<
asp:LinqDataSource
ID
=
"LinqDataSource1"
runat
=
"server"
ContextTypeName
=
"TelerikWebSample.DataClasses1DataContext"
EntityTypeName
=
""
TableName
=
"Products"
/>
<
asp:LinqDataSource
ID
=
"LinqDataSource2"
runat
=
"server"
ContextTypeName
=
"TelerikWebSample.DataClasses1DataContext"
EntityTypeName
=
""
TableName
=
"Categories"
Select
=
"new (CategoryID, CategoryName)"
/>
</
form
>
When grouped by that column I get the following error:
"Field Categories.CategoryName not found in the source table. Please check the expression syntax."
However, when you add a new column that is not visible with the "Categories.CategoryName" field, everything works perfectly.
<
telerik:GridBoundColumn
DataField
=
"Categories.CategoryName"
UniqueName
=
"CategoryName"
Visible
=
"False"
/>
What is this about?.
Is there a solution to avoid unnecessarily using this non-visible column?
Thanks for the help.
Delvis