<
telerik:RadGrid
ID
=
"radGrid"
runat
=
"server"
AutoGenerateColumns
=
"False"
OnNeedDataSource
=
"radGrid_NeedDataSource"
AllowFilteringByColumn
=
"True"
AllowPaging
=
"True"
AllowSorting
=
"True"
ShowFooter
=
"True"
ShowGroupPanel
=
"True"
ShowStatusBar
=
"True"
CellSpacing
=
"0"
OnColumnCreating
=
"radGrid_ColumnCreating"
OnItemCommand
=
"radGrid_ItemCommand"
EnableLinqExpressions
=
"false"
Width
=
"900px"
>
<
ExportSettings
IgnorePaging
=
"True"
ExportOnlyData
=
"true"
OpenInNewWindow
=
"true"
FileName
=
"Event List"
HideStructureColumns
=
"true"
>
</
ExportSettings
>
<
ClientSettings
AllowColumnsReorder
=
"True"
AllowDragToGroup
=
"True"
AllowKeyboardNavigation
=
"True"
>
<
Scrolling
AllowScroll
=
"false"
EnableVirtualScrollPaging
=
"True"
/>
<
Animation
AllowColumnReorderAnimation
=
"True"
AllowColumnRevertAnimation
=
"True"
/>
<
ClientEvents
OnRowDblClick
=
"RowDblClick"
/>
</
ClientSettings
>
<
MasterTableView
NoDetailRecordsText
=
"No Events Currently Listed"
NoMasterRecordsText
=
"No Events Currently Listed"
CommandItemDisplay
=
"None"
AllowMultiColumnSorting
=
"True"
EditMode
=
"PopUp"
>
<
CommandItemSettings
ExportToPdfText
=
"Export to PDF"
ShowAddNewRecordButton
=
"False"
ShowExportToExcelButton
=
"True"
ShowExportToCsvButton
=
"True"
ShowExportToPdfButton
=
"True"
ShowExportToWordButton
=
"True"
/>
<
RowIndicatorColumn
FilterControlAltText
=
"Filter RowIndicator column"
Visible
=
"True"
>
</
RowIndicatorColumn
>
<
ExpandCollapseColumn
FilterControlAltText
=
"Filter ExpandColumn column"
Visible
=
"True"
>
</
ExpandCollapseColumn
>
<
Columns
>
</
Columns
>
<
EditFormSettings
EditFormType
=
"WebUserControl"
UserControlName
=
"~/Controls/EventEmailer.ascx"
PopUpSettings-Modal
=
"true"
PopUpSettings-Height
=
"500"
PopUpSettings-Width
=
"900"
CaptionDataField
=
"TitleOfEvent"
>
<
EditColumn
FilterControlAltText
=
"Filter EditCommandColumn column"
UniqueName
=
"EditCommandColumn1"
>
</
EditColumn
>
</
EditFormSettings
>
</
MasterTableView
>
<
FilterMenu
EnableImageSprites
=
"False"
EnableRoundedCorners
=
"True"
>
</
FilterMenu
>
</
telerik:RadGrid
>
if
(!IsPostBack)
{
//clear items.
radGrid.MasterTableView.Columns.Clear();
//add events
EventList = LoadEvents(CurrentStyle);
CustomFilteringDropDown title =
new
CustomFilteringDropDown();
radGrid.MasterTableView.Columns.Add(title);
AddGridColumns(
ref
title,
"HtmlEncodeTitle"
,
"Title"
,
string
.Empty,
"portaltablelink"
,
true
,
"TitleOfEvent"
, 400);
CustomFilteringDropDown startDate =
new
CustomFilteringDropDown();
radGrid.MasterTableView.Columns.Add(startDate);
AddGridColumns(
ref
startDate,
"startDate"
,
"Start"
,
"ddd, dd MMM yy"
,
string
.Empty,
false
,
"startDate"
, 100);
CustomFilteringDropDown endDate =
new
CustomFilteringDropDown();
radGrid.MasterTableView.Columns.Add(endDate);
AddGridColumns(
ref
endDate,
"endDate"
,
"End"
,
"ddd, dd MMM yy"
,
string
.Empty,
false
,
"endDate"
, 100);
CustomFilteringDropDown town =
new
CustomFilteringDropDown();
radGrid.MasterTableView.Columns.Add(town);
AddGridColumns(
ref
town,
"Town"
,
"Town"
,
string
.Empty,
string
.Empty,
true
,
"Town"
, 150);
CustomFilteringDropDown country =
new
CustomFilteringDropDown();
radGrid.MasterTableView.Columns.Add(country);
AddGridColumns(
ref
country,
"Country"
,
"Country"
,
string
.Empty,
string
.Empty,
true
,
"Country"
, 150);
GridEditCommandColumn editColumn =
new
GridEditCommandColumn();
radGrid.MasterTableView.Columns.Add(editColumn);
editColumn.UniqueName =
"EditCommandColumn"
;
editColumn.ButtonType = GridButtonColumnType.ImageButton;
editColumn.EditImageUrl =
"~/Styles/ClientDefault/Images/ContactUs/email_dialog_icon.png"
;
editColumn.EditText =
"Email Delegates this link"
;
}
private
void
AddGridColumns(
ref
CustomFilteringDropDown item,
string
dataField,
string
headerText,
string
dataFormat,
string
cssClass,
bool
enableFilter,
string
groupByClause,
int
width)
{
item.DataField = dataField;
item.UniqueName = dataField;
item.HtmlEncode =
false
;
item.Groupable =
true
;
item.GroupByExpression =
string
.Format(
"{0} Group By {1}"
, groupByClause, groupByClause);
item.AllowSorting =
true
;
item.AllowFiltering = enableFilter;
item.SortExpression = dataField;
item.HeaderText = headerText;
item.DataFormatString =
"{0:"
+ dataFormat +
"}"
;
item.ItemStyle.CssClass = cssClass;
item.HeaderStyle.Width = Unit.Pixel(width);
item.FilterControlWidth = Unit.Pixel(width);
}
Just an FYI. "async file upload via ajax" in chrome does not seem to work
thx
I was following this sample I found online that shows how to overwrite the telerik skin for a combo box control with your own custom css file in a separate project and it adds the images as WebResources like this:
[assembly: WebResource("TelerikCustomSkins.ComboBox_Images.rcbArrowCell.gif", "image/gif")]
I was trying to do this for the radwizard control but its missing the arrow that shows on the current step when you use one of the default skins. I'm guessing that must be an image but where can I get the default images for these skins so I can add them as Web Resources to my skin project class?
Using the code from this page.... https://demos.telerik.com/aspnet-ajax/htmlchart/examples/functionality/responsive-chart/defaultvb.aspx?show-source=true
It only resizes 1 of the 3 Charts on the page when you resize the window in Chrome.
Can you guys confirm if I'm crazy or it's for sure an issue?
I'm trying to send a GridDataItem object that's retrieved from the selected row of a RadGrid.
But I'm getting an Uncaught RangeError: Maximum call stack size exceeded error when I make this AJAX call.
When I run the code, my AJAX success fires, but the breakpoint I have on the WebMethod never hits. After this, the pages freezes momentarily, then I get the error I mentioned above.
$(document).ready(function () {
$('#<%=btnTransferIn.ClientID%>').on('click', function () {
var grid = $find("<%= gridStudents.ClientID %>"); //Returns an Object
var gridSelItems = grid.get_selectedItems(); //Returns Array
var selectedItem = gridSelItems[0]; //Returns an Object
AjaxTransfer(gridSelItems);
});
});
function AjaxTransfer(selectedItem) {
$.ajax({
type: "POST",
url: "GradeSheet2.aspx/btnTransferIn_Click",
data: { 'gsi': selectedItem },
dataType: "json",
contentType: "application/json; charset=utf-8",
success: alert('Complete')
})
}
This is the WebMethod I want to call:
[System.Web.Services.WebMethod]
public static string btnTransferIn_Click(GridDataItem gsi)
{
return "Done";
}
I noticed, if I change the WebMethod's parameter to a string and I pass in a string instead of an object, it works. So it seems like there's something wrong with the object or the way I'm passing it to the WebMethod.
I checked the object in the console before I make the AJAX call and I think it looks alright.. Although, I don't have a high understanding of all of it.
http://i.stack.imgur.com/TUv8C.png
Please let me know if more information is needed.
Thanks in advance!
Hello,
I have a grid with row BatchEditMode and GridTemplateColumn with RadAsyncUpload in Edittemplate. I try to save file to fileserver on OnBatchEditCommand, but I can not access to RadAsyncUpload from code behind.
<
telerik:RadGrid
runat
=
"server"
Skin
=
"Metro"
RenderMode
=
"Lightweight"
ID
=
"gvAuditorium"
AutoGenerateColumns
=
"False"
DataSourceID
=
"dsAuditorium"
AllowAutomaticDeletes
=
"false"
AllowAutomaticInserts
=
"False"
AllowAutomaticUpdates
=
"False"
AllowPaging
=
"True"
OnBatchEditCommand
=
"gvAuditorium_OnBatchEditCommand"
>
<
MasterTableView
DataKeyNames
=
"RoomId"
PageSize
=
"50"
EditMode
=
"Batch"
CommandItemDisplay
=
"TopAndBottom"
>
<
CommandItemSettings
ShowAddNewRecordButton
=
"False"
ShowRefreshButton
=
"False"
></
CommandItemSettings
>
<
BatchEditingSettings
EditType
=
"Row"
OpenEditingEvent
=
"Click"
></
BatchEditingSettings
>
<
Columns
>
<
telerik:GridBoundColumn
DataField
=
"Number"
SortExpression
=
"Number"
UniqueName
=
"Number"
HeaderText
=
"Номер аудитории"
ReadOnly
=
"True"
></
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"RoomName"
SortExpression
=
"RoomName"
UniqueName
=
"RoomName"
HeaderText
=
"Название"
ReadOnly
=
"True"
></
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"TypeRoomName"
SortExpression
=
"TypeRoomName"
UniqueName
=
"TypeRoomName"
HeaderText
=
"Тип аудитории"
ReadOnly
=
"True"
></
telerik:GridBoundColumn
>
<
telerik:GridNumericColumn
DataField
=
"Square"
SortExpression
=
"Square"
UniqueName
=
"Square"
DataFormatString
=
"{0:N2}"
DecimalDigits
=
"2"
HeaderText
=
"Площадь"
/>
<
telerik:GridNumericColumn
DataField
=
"PlaceCount"
SortExpression
=
"PlaceCount"
UniqueName
=
"PlaceCount"
DecimalDigits
=
"0"
DataFormatString
=
"{0:0}"
HeaderText
=
"Количество мест"
/>
<
telerik:GridTemplateColumn
DataField
=
"ScanFileName"
UniqueName
=
"ScanFileName"
HeaderText
=
"План аудитории"
>
<
ItemTemplate
>
<
asp:HyperLink
runat
=
"server"
ID
=
"hlToFile"
Target
=
"_blank"
Visible='<%# Eval("hasFile") %>' Text='<%# Bind("ScanFileName") %>' NavigateUrl='<%# "~/_layouts/15/FastAuditoriumFilling/AuditoriumFileDownload.aspx?RoomId=" + Eval("RoomId") %>' ></
asp:HyperLink
>
</
ItemTemplate
>
<
EditItemTemplate
>
<
telerik:RadAsyncUpload
runat
=
"server"
ID
=
"auFileUpload"
Skin
=
"Metro"
RenderMode
=
"Lightweight"
AllowedFileExtensions
=
"pdf"
></
telerik:RadAsyncUpload
>
</
EditItemTemplate
>
</
telerik:GridTemplateColumn
>
</
Columns
>
</
MasterTableView
>
</
telerik:RadGrid
>
protected
void
gvAuditorium_OnBatchEditCommand(
object
sender, GridBatchEditingEventArgs e)
{
if
(e.Commands.Count > 0)
{
foreach
(var editingCommand
in
e.Commands)
{
int
roomId = (
int
)editingCommand.Item.GetDataKeyValue(
"RoomId"
);
Hashtable newValues = editingCommand.NewValues;
RadAsyncUpload auFileUpload = gvAuditorium.FindControl(gvAuditorium.MasterTableView.ClientID +
"_ScanFileName"
).FindControl(
"auFileUpload"
)
as
RadAsyncUpload;
if
(auFileUpload !=
null
&& auFileUpload.UploadedFiles.Count > 0)
{
//SAVE FILE
}
//SAVE DATA TO DB
}
}
}
If e.Commands.Count == 1, then all OK, but if e.Commands.Count > 1 then RadAsyncUpload auFileUpload = gvAuditorium.FindControl(gvAuditorium.MasterTableView.ClientID +"_ScanFileName").FindControl("auFileUpload") as RadAsyncUpload; get always first edit control.
How can I save files from all edited lines?
hi,
i try to export my grid data to excel with ExcelML format, i have column with timespan type and it stay empty in the export file,
how i can export this kind of type or other non primitive type
01.
<
telerik:RadGrid
ID
=
"RadGrid1"
runat
=
"server"
AllowSorting
=
"True"
DataSourceID
=
"ObjectDataSource1"
AllowPaging
=
"true"
PageSize
=
"20"
OnExcelMLExportRowCreated
=
"RadGrid1_OnExcelMLExportRowCreated"
>
02.
<
MasterTableView
CommandItemDisplay
=
"Top"
AutoGenerateColumns
=
"False"
DataKeyNames
=
"Index"
DataSourceID
=
"ObjectDataSource1"
UseAllDataFields
=
"True"
>
03.
<
Columns
>
04.
<
telerik:GridBoundColumn
DataField
=
"Index"
DataType
=
"System.Guid"
HeaderText
=
"Index"
05.
ReadOnly
=
"true"
Visible
=
"false"
SortExpression
=
"Index"
UniqueName
=
"Index"
>
06.
</
telerik:GridBoundColumn
>
07.
<
telerik:GridBoundColumn
DataField
=
"FirstName"
HeaderText
=
"FirstName"
SortExpression
=
"FirstName"
08.
UniqueName
=
"FirstName"
>
09.
</
telerik:GridBoundColumn
>
10.
<
telerik:GridBoundColumn
DataField
=
"LastName"
HeaderText
=
"LastName"
SortExpression
=
"LastName"
11.
UniqueName
=
"LastName"
>
12.
</
telerik:GridBoundColumn
>
13.
<
telerik:GridBoundColumn
DataField
=
"Age"
DataType
=
"System.Int32"
HeaderText
=
"Age"
14.
SortExpression
=
"Age"
UniqueName
=
"Age"
>
15.
</
telerik:GridBoundColumn
>
16.
<
telerik:GridBoundColumn
DataField
=
"Time"
DataType
=
"System.TimeSpan"
HeaderText
=
"Time"
17.
SortExpression
=
"Time"
UniqueName
=
"Time"
>
18.
</
telerik:GridBoundColumn
>
19.
</
Columns
>
20.
</
MasterTableView
>
21.
<
ExportSettings
ExportOnlyData
=
"true"
/>
22.
</
telerik:RadGrid
>
23.
<
asp:ObjectDataSource
ID
=
"ObjectDataSource1"
runat
=
"server"
SelectMethod
=
"GetContacts"
TypeName
=
"myClasses.ContactList"
></
asp:ObjectDataSource
>
i attach image how it look after the export
i can get to the cell of this type under the OnExcelMLExportRowCreated event but the data is read only and i can't change it
I'm trying to export a grid containing RadCalendar to PDF, is there any tricks here or restrictions?
<
telerik:RadGrid
ID
=
"Grid"
runat
=
"server"
AllowSorting
=
"false"
AutoGenerateColumns
=
"False"
ShowGroupPanel
=
"False"
Skin
=
"Silk"
AllowPaging
=
"True"
AllowMultiRowSelection
=
"True"
PageSize
=
"20"
ShowFooter
=
"False"
AllowFilteringByColumn
=
"false"
>
<
MasterTableView
AllowCustomPaging
=
"False"
AllowCustomSorting
=
"True"
GroupLoadMode
=
"Client"
Name
=
"Grid"
Width
=
"100%"
>
<
Columns
>
<
telerik:GridTemplateColumn
AllowFiltering
=
"False"
HeaderText
=
"Some Month"
UniqueName
=
"SomeMonthColumn"
>
<
ItemTemplate
>
<
div
>
<
asp:Label
ID
=
"SomeLabel"
runat
=
"server"
Text
=
""
></
asp:Label
>
</
div
>
<
div
>
<
telerik:RadCalendar
ID
=
"RadCalendar1"
runat
=
"server"
Skin
=
"Silk"
RenderMode
=
"Classic"
></
telerik:RadCalendar
>
</
div
>
</
ItemTemplate
>
</
telerik:GridTemplateColumn
>
</
Columns
>
</
MasterTableView
>
</
telerik:RadGrid
>
Hello,
Is there a way to produce a PDF with a specific number of months, so for example the PDF would have 3 images under each other for 3 different months?
thank you,
-Sam
Hello everyone.
First of all I am new to Telerik.
I need to create a RadGrid that has no DataSource and is shown as in figure1.
The user can edit the "Quantity" cell and the "Discount" cell but can not edit the other cells.
In the "Description" cell (and only in that cell) the user can press F2 and the window in figure2 will be displayed.
How can I do that?