<
telerik:RadGrid
ID
=
"rgCesWeeklyLogs"
runat
=
"server"
AutoGenerateColumns
=
"False"
GridLines
=
"None"
Skin
=
"Windows7"
AllowPaging
=
"true"
AllowSorting
=
"true"
onneeddatasource
=
"rgCesWeeklyLogs_NeedDataSource"
onupdatecommand
=
"rgCesWeeklyLogs_UpdateCommand"
ondatabound
=
"rgCesWeeklyLogs_DataBound"
>
<
MasterTableView
CommandItemDisplay
=
"None"
DataKeyNames
=
"Id"
>
<
CommandItemSettings
ExportToPdfText
=
"Export to Pdf"
/>
<
Columns
>
<
telerik:GridTemplateColumn
UniqueName
=
"EditLog"
>
<
ItemTemplate
>
<
asp:ImageButton
ID
=
"btnEdit"
runat
=
"server"
ImageUrl
=
"~/Images/edit-icon.jpg"
CommandName
=
"Edit"
ToolTip
=
"Edit Record"
/>
</
ItemTemplate
>
</
telerik:GridTemplateColumn
>
<
telerik:GridBoundColumn
DataField
=
"ActivityDate"
ReadOnly
=
"true"
DataFormatString
=
"{0:d}"
/>
<
telerik:GridBoundColumn
DataField
=
"DayOfWeek"
ReadOnly
=
"true"
HeaderText
=
"Day of Week"
/>
<
telerik:GridBoundColumn
DataField
=
"Activity"
HeaderText
=
"Planned Activity"
ColumnEditorID
=
"GridHTMLEditorColumnEditor1"
/>
<
telerik:GridBoundColumn
DataField
=
"Outcome"
HeaderText
=
"Outcome"
ColumnEditorID
=
"ActivityEditor"
/>
<
telerik:GridBoundColumn
DataField
=
"LastUpdated"
HeaderText
=
"Last Updated"
ReadOnly
=
"true"
/>
</
Columns
>
</
MasterTableView
>
</
telerik:RadGrid
>
<
telerik:GridTextBoxColumnEditor
ID
=
"ActivityEditor"
TextBoxMode
=
"MultiLine"
TextBoxStyle-Width
=
"500px"
TextBoxStyle-Height
=
"200px"
runat
=
"server"
/>
<
br
/>
<
telerik:GridHTMLEditorColumnEditor
ID
=
"GridHTMLEditorColumnEditor1"
runat
=
"server"
>
</
telerik:GridHTMLEditorColumnEditor
>
Hi,
I’ve been working on a Custom Radgrid and Radtoolbar control which works very well. At the moment the javascript used is still in the design view of the page and want to include this in my control dll. I’ve looked around the site and can’t find any examples of how to go about doing this.
How would I go about including the below in my code:
function RowClick(sender, eventArgs) {
if (editedRow != null && hasChanges) {
if (confirm("Update changes?")) {
hasChanges = false;
$find("<%=gvGrid.MasterTableView.ClientID %>").updateItem(editedRow);
}
else {
hasChanges = false;
}
}
}
Also how would I change it so gvGrid is dynamic so I can have different names for my grids etc.
Any pointers in the right direction would be great.
Thanks
<
cc1:TabContainer
ID
=
"tcObjects"
CssClass
=
"ajaxtab"
runat
=
"server"
>
<
cc1:TabPanel
ID
=
"tpSearchResults"
runat
=
"server"
TabIndex
=
"0"
Visible
=
"false"
CssClass
=
"css_div_gridpanel"
>
<
ContentTemplate
>
<
div
class
=
"css_div_control"
>
<
div
class
=
"css_div_titlebar"
>
<
div
style
=
"float:left; height: 24px; width: 24px; margin: 2px;"
>
<
asp:Image
ID
=
"imgSearchResults"
runat
=
"server"
Width
=
"24px"
Height
=
"24px"
/>
</
div
>
<
div
class
=
"css_div_title"
>
<
span
class
=
"css_title_lbl"
>
<
asp:Label
ID
=
"lblSearchResults"
runat
=
"server"
></
asp:Label
>
</
span
>
</
div
>
<
asp:Panel
ID
=
"pSearchResults"
CssClass
=
"css_div_actions"
runat
=
"server"
>
<
asp:LinkButton
ID
=
"btnAttach"
OnClick
=
"AttachObjects"
runat
=
"server"
>
<
div
class
=
"css_action_item_enabled"
style
=
"float: right;"
>
<
div
class
=
"css_action_item_icon_add"
>
</
div
>
<
span
class
=
"css_action_link"
>
<
asp:Label
runat
=
"server"
ID
=
"lblAttach"
></
asp:Label
>
</
span
>
</
div
>
</
asp:LinkButton
>
</
asp:Panel
>
</
div
>
<
div
class
=
"css_div_datacontrol_content"
>
<
div
class
=
"css_div_datacontrol_data"
>
<
asp:Panel
ID
=
"GridPanel"
runat
=
"server"
CssClass
=
"css_div_gridpanel"
>
<
telerik:RadGrid
ID
=
"rgSearchResults"
OnNeedDataSource
=
"rgSearchResults_NeedDataSource"
AutoGenerateColumns
=
"true"
HeaderStyle-Wrap
=
"false"
AllowMultiRowSelection
=
"true"
GridLines
=
"None"
Skin
=
"Sunset"
EnableViewState
=
"true"
EnableEmbeddedScripts
=
"false"
EnableEmbeddedSkins
=
"false"
AllowSorting
=
"true"
EnableEmbeddedBaseStylesheet
=
"false"
RegisterWithScriptManager
=
"false"
AllowFilteringByColumn
=
"true"
runat
=
"server"
>
<
MasterTableView
Width
=
"100%"
></
MasterTableView
>
<
GroupingSettings
CaseSensitive
=
"false"
/>
<
HeaderStyle
Width
=
"150px"
/>
<
ClientSettings
EnableRowHoverStyle
=
"true"
AllowColumnsReorder
=
"true"
ReorderColumnsOnClient
=
"true"
Resizing-AllowRowResize
=
"false"
ColumnsReorderMethod
=
"Reorder"
Resizing-AllowColumnResize
=
"true"
Resizing-ResizeGridOnColumnResize
=
"true"
Resizing-EnableRealTimeResize
=
"true"
Scrolling-AllowScroll
=
"true"
>
<
Scrolling
UseStaticHeaders
=
"true"
AllowScroll
=
"true"
/>
<
Selecting
AllowRowSelect
=
"true"
/>
<
ClientEvents
OnGridCreated
=
"GridCreated"
/>
</
ClientSettings
>
</
telerik:RadGrid
>
</
asp:Panel
>
</
div
>
</
div
>
</
div
>
</
ContentTemplate
>
</
cc1:TabPanel
>
</
cc1:TabContainer
>
function
GridCreated(sender, args) {
var
grid = sender;
var
masterTable = sender.get_masterTableView();
masterTable.selectAllItems(
true
);
}
GridClientSelectColumn column =
new
GridClientSelectColumn();
this
.rgSearchResults.Columns.Add(column);
column.Reorderable =
false
;
column.Resizable =
false
;
column.ItemStyle.Width = Unit.Pixel(30);
column.HeaderStyle.Width = Unit.Pixel(30);
this
.rgSearchResults.DataSource = table;
this
.rgSearchResults.DataBind();
Hello,
I can't figure out why doesn't display de inline form (showInsertFormAt, even showInlineInsertForm
).
This only work if i remove the InlineInsertTemplate...
any clues?
<
telerik:RadScriptManager
ID
=
"RadScriptManager1"
runat
=
"server"
/>
<
telerik:RadFormDecorator
ID
=
"RadFormDecorator1"
DecorationZoneID
=
"DecoratedControlsContainer"
runat
=
"server"
/>
<
telerik:RadWindowManager
ID
=
"RadWindowManager1"
runat
=
"server"
EnableShadow
=
"true"
Skin
=
"Office2007"
>
</
telerik:RadWindowManager
>
<
telerik:RadScriptBlock
ID
=
"RadScriptBlock1"
runat
=
"server"
>
<
script
type
=
"text/javascript"
>
function OnClientAppointmentInserting(sender, eventArgs) {
$find("<%= txtidFuncionario.ClientID %>").value = $get("txtidFuncionario").value;
$find("<%= txtDiasPlanificados.ClientID %>").value = $get("txtDiasPlanificados").value;
}
function OnClientTimeSlotClick(sender, eventArgs) {
var slot = sender.get_activeModel().getTimeSlotFromDomElement(eventArgs.get_domEvent().target);
sender.showInlineInsertForm(slot);
}
function OnClientAppointmentClick(sender, e) {
var apt = e.get_appointment();
sender.editAppointmentWithConfirmation(apt);
}
function rowDropping(sender, eventArgs) {
var htmlElement = eventArgs.get_destinationHtmlElement();
var scheduler = $find('<%= RadScheduler1.ClientID %>');
if (isPartOfSchedulerAppointmentArea(htmlElement)) {
var timeSlot = scheduler._activeModel.getTimeSlotFromDomElement(htmlElement);
$find("<%= txtTargetSlot.ClientID %>").value = timeSlot.get_index();
eventArgs.set_destinationHtmlElement("txtTargetSlot");
scheduler.showInlineInsertForm(timeSlot);
}
else {
eventArgs.set_cancel(true);
}
}
function isPartOfSchedulerAppointmentArea(htmlElement) {
return $telerik.$(htmlElement).parents().is("div.rsAllDay") ||
$telerik.$(htmlElement).parents().is("div.rsContent")
}
</
script
>
</
telerik:RadScriptBlock
>
<
telerik:RadTextBox
ID
=
"txtTargetSlot"
runat
=
"server"
CssClass
=
"hidden_field"
>
</
telerik:RadTextBox
>
<
telerik:RadTextBox
ID
=
"txtidFuncionario"
runat
=
"server"
CssClass
=
"hidden_field"
>
</
telerik:RadTextBox
>
<
telerik:RadTextBox
ID
=
"txtDiasPlanificados"
runat
=
"server"
CssClass
=
"hidden_field"
>
</
telerik:RadTextBox
>
<
telerik:RadAjaxManager
runat
=
"server"
ID
=
"RadAjaxManager1"
>
<
AjaxSettings
>
<
telerik:AjaxSetting
AjaxControlID
=
"RadScheduler1"
>
<
UpdatedControls
>
<
telerik:AjaxUpdatedControl
ControlID
=
"RadScheduler1"
LoadingPanelID
=
"RadAjaxLoadingPanel1"
/>
</
UpdatedControls
>
</
telerik:AjaxSetting
>
<
telerik:AjaxSetting
AjaxControlID
=
"RadGrid1"
>
<
UpdatedControls
>
<
telerik:AjaxUpdatedControl
ControlID
=
"RadGrid1"
/>
</
UpdatedControls
>
</
telerik:AjaxSetting
>
</
AjaxSettings
>
</
telerik:RadAjaxManager
>
<
telerik:RadSplitter
ID
=
"RadSplitter1"
LiveResize
=
"true"
runat
=
"server"
Orientation
=
"Vertical"
Width
=
"100%"
>
<
telerik:RadPane
ID
=
"RadPane1"
runat
=
"server"
Width
=
"160"
MinWidth
=
"160"
>
<
telerik:RadGrid
ID
=
"RadGrid1"
runat
=
"server"
DataSourceID
=
"dsPersonal"
Skin
=
"Web20"
OnItemDataBound
=
"RadGrid1_ItemDataBound"
GridLines
=
"None"
AutoGenerateColumns
=
"False"
OnRowDrop
=
"RadGrid1_RowDrop"
AllowAutomaticInserts
=
"True"
AllowAutomaticUpdates
=
"True"
ShowFooter
=
"True"
>
<
ClientSettings
AllowRowsDragDrop
=
"True"
>
<
Selecting
AllowRowSelect
=
"True"
/>
<
ClientEvents
OnRowDropping
=
"rowDropping"
/>
</
ClientSettings
>
<
MasterTableView
AutoGenerateColumns
=
"False"
DataKeyNames
=
"id_funcionario"
DataSourceID
=
"dsPersonal"
>
<
CommandItemSettings
ExportToPdfText
=
"Exportar a PDF"
/>
<
Columns
>
<
telerik:GridBoundColumn
Visible
=
"false"
DataField
=
"id_funcionario"
HeaderText
=
"id_funcionario"
SortExpression
=
"id_funcionario"
UniqueName
=
"id_funcionario"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
ItemStyle-Width
=
"100%"
DataField
=
"nombre_completo"
HeaderText
=
"Personal"
SortExpression
=
"nombre_completo"
UniqueName
=
"nombre_completo"
>
<
ItemStyle
Width
=
"100%"
/>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
Visible
=
"false"
DataField
=
"estado_cumplimiento"
HeaderText
=
"Estado Cumplimiento"
SortExpression
=
"estado_cumplimiento"
UniqueName
=
"estado_cumplimiento"
>
</
telerik:GridBoundColumn
>
</
Columns
>
</
MasterTableView
>
</
telerik:RadGrid
>
</
telerik:RadPane
>
<
telerik:RadSplitBar
ID
=
"RadSplitBar1"
runat
=
"server"
/>
<
telerik:RadPane
ID
=
"RadPane2"
runat
=
"server"
>
<
telerik:RadAjaxLoadingPanel
runat
=
"server"
ID
=
"RadAjaxLoadingPanel1"
Skin
=
"Web20"
/>
<
telerik:RadScheduler
Height
=
"398"
runat
=
"server"
ID
=
"RadScheduler1"
DataEndField
=
"fecha_hasta"
DataKeyField
=
"id_vacacion_planificada"
DataSourceID
=
"dsVacaciones"
DataStartField
=
"fecha_desde"
DataSubjectField
=
"id_vacacion_planificada"
Skin
=
"Web20"
LastDayOfWeek
=
"Sunday"
OnClientTimeSlotClick
=
"OnClientTimeSlotClick"
OnClientAppointmentClick
=
"OnClientAppointmentClick"
Culture
=
"Spanish (Chile)"
AdvancedForm-EnableResourceEditing
=
"true"
AllowDelete
=
"False"
AdvancedForm-Enabled
=
"False"
OnAppointmentInsert
=
"RadScheduler1_AppointmentInsert"
OnClientAppointmentInserting
=
"OnClientAppointmentInserting"
>
<%--<
AdvancedForm
Modal
=
"true"
/>
<
TimeSlotContextMenuSettings
EnableDefault
=
"true"
/>
<
AppointmentContextMenuSettings
EnableDefault
=
"true"
/>--%>
<
AppointmentTemplate
>
<
span
class
=
"AppointmentTemplate_span"
>
<%# Eval("nombre_completo.Text") %></
span
>
</
AppointmentTemplate
>
<
InlineInsertTemplate
>
<
div
class
=
"rsAdvancedEdit"
>
<
div
class
=
"rsAdvTitle"
>
<
h1
class
=
"rsAdvInnerTitle"
>
Inserta una Planificación</
h1
>
<
asp:LinkButton
runat
=
"server"
ID
=
"AdvancedEditCloseButton"
CssClass
=
"rsAdvEditClose"
CommandName
=
"Cancel"
CausesValidation
=
"false"
ToolTip='<%# Container.Appointment.Owner.Localization.AdvancedClose %>'>
<%# Container.Appointment.Owner.Localization.AdvancedClose%>
</
asp:LinkButton
>
</
div
>
<
div
class
=
"rsAdvContentWrapper"
>
<
div
class
=
"frmTemplate"
>
<
span
class
=
"tmp_span"
>Colaborador</
span
><
span
id
=
"spanColaboradorInsert"
runat
=
"server"
></
span
>
<
br
/>
<
span
class
=
"tmp_span"
>Fecha Desde</
span
>
<
telerik:RadDatePicker
ID
=
"rdpFechaDesdeInsert"
runat
=
"server"
Skin
=
"Web20"
/>
<
br
/>
<
span
class
=
"tmp_span"
>Fecha Hasta</
span
>
<
telerik:RadDatePicker
ID
=
"rdpFechaHastaInsert"
runat
=
"server"
Skin
=
"Web20"
/>
<
br
/>
<
span
class
=
"tmp_span"
>Dias Planificados</
span
>
<
telerik:RadTextBox
ID
=
"txtDiasPlanificadosInsert"
runat
=
"server"
Skin
=
"Web20"
>
</
telerik:RadTextBox
>
</
div
>
<
asp:Panel
runat
=
"server"
ID
=
"ButtonsPanel"
CssClass
=
"rsAdvancedSubmitArea"
>
<
div
class
=
"rsAdvButtonWrapper"
>
<
asp:LinkButton
CommandName
=
"Insert"
runat
=
"server"
ID
=
"UpdateButton"
CssClass
=
"rsAdvEditSave"
>
<
span
><%# Container.Appointment.Owner.Localization.Save%></
span
>
</
asp:LinkButton
>
<
asp:LinkButton
runat
=
"server"
ID
=
"CancelButton"
CssClass
=
"rsAdvEditCancel"
CommandName
=
"Cancel"
CausesValidation
=
"false"
>
<
span
><%# Container.Appointment.Owner.Localization.Cancel%></
span
>
</
asp:LinkButton
>
</
div
>
</
asp:Panel
>
</
div
>
</
InlineInsertTemplate
>
<
InlineEditTemplate
>
<
div
class
=
"rsAdvancedEdit"
>
<
div
class
=
"rsAdvTitle"
>
<
h1
class
=
"rsAdvInnerTitle"
>
Inserta una Planificación</
h1
>
<
asp:LinkButton
runat
=
"server"
ID
=
"AdvancedEditCloseButton"
CssClass
=
"rsAdvEditClose"
CommandName
=
"Cancel"
CausesValidation
=
"false"
ToolTip='<%# Container.Appointment.Owner.Localization.AdvancedClose %>'>
<%# Container.Appointment.Owner.Localization.AdvancedClose%>
</
asp:LinkButton
>
</
div
>
<
div
class
=
"rsAdvContentWrapper"
>
<
div
class
=
"frmTemplate"
>
<
span
class
=
"tmp_span"
>Colaborador</
span
><
span
id
=
"spanColaboradorEdit"
runat
=
"server"
><%# Eval("nombre_completo.Text")%></
span
>
<
br
/>
<
span
class
=
"tmp_span"
>Fecha Desde</
span
>
<
telerik:RadDatePicker
ID
=
"rdpFechaDesdeEdit"
runat
=
"server"
Skin
=
"Web20"
DbSelectedDate='<%# Eval("fecha_desde.Text") %>' />
<
br
/>
<
span
class
=
"tmp_span"
>Fecha Hasta</
span
>
<
telerik:RadDatePicker
ID
=
"rdpFechaHastaEdit"
runat
=
"server"
Skin
=
"Web20"
DbSelectedDate='<%# Eval("fecha_hasta.Text") %>' />
<
br
/>
<
span
class
=
"tmp_span"
>Dias Planificados</
span
>
<
telerik:RadTextBox
ID
=
"txtDiasPlanificadosEdit"
runat
=
"server"
Skin
=
"Web20"
Text='<%# Eval("dias_planificados.Text") %>'>
</
telerik:RadTextBox
>
</
div
>
<
asp:Panel
runat
=
"server"
ID
=
"ButtonsPanel"
CssClass
=
"rsAdvancedSubmitArea"
>
<
div
class
=
"rsAdvButtonWrapper"
>
<
asp:LinkButton
CommandName
=
"Update"
runat
=
"server"
ID
=
"UpdateButton"
CssClass
=
"rsAdvEditSave"
>
<
span
><%# Container.Appointment.Owner.Localization.Save%></
span
>
</
asp:LinkButton
>
<
asp:LinkButton
runat
=
"server"
ID
=
"CancelButton"
CssClass
=
"rsAdvEditCancel"
CommandName
=
"Cancel"
CausesValidation
=
"false"
>
<
span
><%# Container.Appointment.Owner.Localization.Cancel%></
span
>
</
asp:LinkButton
>
</
div
>
</
asp:Panel
>
</
div
>
</
InlineEditTemplate
>
<
ResourceTypes
>
<
telerik:ResourceType
DataSourceID
=
"dsVacaciones"
ForeignKeyField
=
"fecha_desde"
KeyField
=
"fecha_desde"
Name
=
"fecha_desde"
TextField
=
"fecha_desde"
/>
<
telerik:ResourceType
DataSourceID
=
"dsVacaciones"
ForeignKeyField
=
"fecha_hasta"
KeyField
=
"fecha_hasta"
Name
=
"fecha_hasta"
TextField
=
"fecha_hasta"
/>
<
telerik:ResourceType
DataSourceID
=
"dsVacaciones"
ForeignKeyField
=
"nombre_completo"
KeyField
=
"nombre_completo"
Name
=
"nombre_completo"
TextField
=
"nombre_completo"
/>
<
telerik:ResourceType
DataSourceID
=
"dsVacaciones"
ForeignKeyField
=
"dias_planificados"
KeyField
=
"dias_planificados"
Name
=
"dias_planificados"
TextField
=
"dias_planificados"
/>
</
ResourceTypes
>
</
telerik:RadScheduler
>
</
telerik:RadPane
>
</
telerik:RadSplitter
>
Hi All,
I have a ajaxified Radgrid, having some columns,
there is one button column for file dowwnload.
when we hit that button
the files from server should get downloaded.
But due to ajaxification, we are not able to download the files.
If i remove the radajaxmanager then i am able to download the files.
protected void GrdDocs_OnItemCommand(object sender, GridCommandEventArgs e)
{
if (e.CommandName == "Download")
{
GridDataItem item = e.Item as GridDataItem;
string filePath = item["FILEPATH"].Text;
string filename = Path.GetFileName(filePath);
Response.ClearContent();
Response.Clear();
Response.ContentType = "application/zip";
Response.AppendHeader("content-disposition", "attachment; filename=" + filename);
try
{
//RadAjaxManager1.ResponseScripts.Add(String.Format(@"window.location.href = ""{0}"";", filePath));
Response.TransmitFile(filePath);
Response.Flush();
//Response.End();
}
catch(exception e)
{
}
}
}
------------------
In ASCX page
<telerik:GridButtonColumn ButtonType="LinkButton" CommandName="Download" HeaderText="AVAILABLE FILES"
Text="Download" UniqueName="FILEPATH">
</telerik:GridButtonColumn>
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="Submit">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="" LoadingPanelID="RadAjaxLoadingPanel1" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManager>
Note: The submit button is inside asp:updatePanel.
Private Sub Grid_ColumnCreated(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridColumnCreatedEventArgs) Handles WITSGrid.ColumnCreated
If InStr(e.Column.UniqueName, "USD", CompareMethod.Binary) > 1 Then
e.Column.ItemStyle.HorizontalAlign = HorizontalAlign.Right
Dim x As GridBoundColumn = CType(e.Column, GridBoundColumn)
x.DataFormatString =
"{0:###,###.###}"
End If
End Sub
problem is when that column has 0 values then it is displaying as null vall (empty cell) insted of 0.000. Can you please suggest me.
Regards
admin