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
When I try to export data to Excel from RadGrid in localhost it works fine, but if I publish my page in the server it stops working.
I have the next code:
protected void btnExportToExcel_Click(object sender, EventArgs e)
{
radGridAlerts.ExportSettings.Excel.Format = GridExcelExportFormat.Xlsx;
radGridAlerts.ExportSettings.FileName = "Alerts Data";
radGridAlerts.ExportSettings.IgnorePaging = true;
radGridAlerts.MasterTableView.ExportToExcel();
}
Do you know why happens?
Hi,
Does telerik support expand/collapse child views?
I tried to add one, but it either shows no icon for expand/collapse all rows, or double icon. see attached.
Below is the code I am using
<telerik:RadGrid ID="grdMain" runat="server" GridLines="None" EnableAJAX="true" EnableAJAXLoadingTemplate="true"
PageSize="50" AllowMultiRowSelection="true">
<ExportSettings>
<Pdf PageBottomMargin="" PageFooterMargin="" PageHeaderMargin="" PageHeight="11in"
PageLeftMargin="" PageRightMargin="" PageTopMargin="" PageWidth="8.5in" />
</ExportSettings>
<ClientSettings Selecting-AllowRowSelect="true" />
<MasterTableView AllowPaging="True" DataMember="Master" AutoGenerateColumns="False"
AllowSorting="True" HierarchyLoadMode="Client" Name="MainTable" EnableHierarchyExpandAll="true">
<ItemStyle BackColor="White" />
<AlternatingItemStyle BackColor="#F2F2F2" />
<Columns>
<telerik:GridExpandColumn />
......Rest of the columns code
Please suggest if there is a way to hide the additional expand/collapse icon
thank you
First a suggestion for Control Panel - it might be a good idea to create a forum for it. It's not a product, but could require support, and it's difficult to know which forum messages might be posted in to research issues...
So I'm having a couple issues with Telerik Control Panel I'd like to get help with:
Hope that makes sense.
Thanks!
Eddie
Some columns in my grid are being added dynamically; their count and names come from a collection. All items in the grid have the same dynamic columns.
My data object looks like this:
class MyDataObject
{
int ID;
string Name;
List<
DynamicColumn
> DynamicColumns;
}
/// <
summary
>
/// Holds a value for a single dynamic column cell
/// </
summary
>
class DynamicColumn
{
int DynamicColumnDefinitionId; // points to an item in a global collection that defines the dynamic columns for the whole grid.
int Value;
}
The resulting grid could have these columns:
| ID | Name | DynamicColummn1 | DynamicColummn2 | ... |
My question:
How can I sort by one of the dynamic columns? Can I use a sort expression like "DynamicColumn[i]" ?
Hello,
I'am using Visual Studio 2012. framework 4.0
Telerik Dll Version 2016.2.607.40
i'am getting error as "unrecognized tag prefix telerik"
same solution working on another machine
i'm attaching the screen shot for same
thanks
Hello.
If i have a simple table, and i select the table and some other stuff and click BOLD, all element tags get wrapped by a <strong> tag, not only text (for instance tfoot, thead etc are all wrapped with <strong>. Is there any configuration to this ?
Would apreciate any help.
Best regards.
Hi,
I have 2 web pages
When I press the image button a modal popup window opens.
Only problem is the window (modal popup) should be opened on top of page B.
It should be centered on page B and everything else on page B should be grayed out.
Is this possible?
Page A:
<
html
xmlns
=
"http://www.w3.org/1999/xhtml"
><
br
><
head
runat
=
"server"
><
br
> <
link
rel
=
"stylesheet"
type
=
"text/css"
href
=
"App_Themes/EriksBlue.css"
/><
br
> <
title
>Catalogs</
title
><
br
> <
telerik:RadStyleSheetManager
id
=
"RadStyleSheetManager1"
runat
=
"server"
/><
br
></
head
><
br
><
body
><
br
> <
form
id
=
"form1"
runat
=
"server"
><
br
> <
telerik:RadScriptManager
ID
=
"RadScriptManager1"
runat
=
"server"
><
br
> <
Scripts
><
br
> <
asp:ScriptReference
Assembly
=
"Telerik.Web.UI"
Name
=
"Telerik.Web.UI.Common.Core.js"
/><
br
> <
asp:ScriptReference
Assembly
=
"Telerik.Web.UI"
Name
=
"Telerik.Web.UI.Common.jQuery.js"
/><
br
> <
asp:ScriptReference
Assembly
=
"Telerik.Web.UI"
Name
=
"Telerik.Web.UI.Common.jQueryInclude.js"
/><
br
> </
Scripts
><
br
> </
telerik:RadScriptManager
><
br
> <
script
type
=
"text/javascript"
><
br
> //Put your JavaScript code here.<
br
> function openPopUp(url) {<
br
> window.radopen(url, "CatalogWindow", window.innerWidth * 0.8, window.innerHeight * 0.8);<
br
> }<
br
> </
script
><
br
><
br
><
telerik:RadWindowManager
ID
=
"RadWindowManager1"
runat
=
"server"
EnableShadow
=
"true"
Animation
=
"FlyIn"
><
br
> <
Windows
><
br
> <
telerik:RadWindow
RenderMode
=
"Lightweight"
VisibleStatusbar
=
"false"
VisibleTitlebar
=
"true"
ID
=
"CatalogWindow"
runat
=
"server"
Modal
=
"true"
Behaviors
=
"Close"
><
br
> </
telerik:RadWindow
><
br
> </
Windows
><
br
></
telerik:RadWindowManager
><
br
><
br
> <
telerik:RadPanelBar
RenderMode
=
"Auto"
runat
=
"server"
ID
=
"rpbCatalogs"
Width
=
"100%"
><
br
> </
telerik:RadPanelBar
><
br
> </
form
><
br
></
body
><
br
></
html
>
Page B:
<
html
xmlns
=
"http://www.w3.org/1999/xhtml"
><
br
><
head
runat
=
"server"
><
br
> <
title
></
title
><
br
></
head
><
br
><
body
><
br
> <
iframe
src
=
"http://localhost:7688/"
style
=
"border:none;"
width
=
"600"
height
=
"800"
><
br
><
br
> </
iframe
><
br
></
body
><
br
></
html
>
protected void rgMessages_ItemCommand(object sender, GridCommandEventArgs e)
{
if (e.CommandName == "RowClick")
{
// Do Something when Row is Clicked
{
else if (e.CommandName == "RowDoubleClick")
{
// Do Something Else when Row is Double Clicked
}
}