public
void
ConfigureExport()
{
radgrdResultDetail.ExportSettings.ExportOnlyData =
true
;
radgrdResultDetail.ExportSettings.IgnorePaging =
false
;
radgrdResultDetail.ExportSettings.OpenInNewWindow =
false
;
}
protected
void
xlsExport_Click(
object
sender, EventArgs e)
{
ConfigureExport();
radgrdResultDetail.MasterTableView.ExportToCSV();
}
protected
void
csvExport_Click(
object
sender, EventArgs e)
{
ConfigureExport();
radgrdResultDetail.MasterTableView.ExportToExcel();
}
RepeatColumns
="4" RepeatDirection="Vertical" AlignRows="false"
The problem is level 1 has uneven items, ideally I want each rows filled as close as possible to the maximum height before moving to the next column, whats is happening is its trying to create and even number of rows resulting in lots of empty spaces at the bottom. Is there a way to turn this off.
Is it possible to create a list of resources for each individual day, regardless of the view?
<%If Request.Url.AbsoluteUri.ToLower().Contains("site1url/login") Then%><
link
href
=
"site1url/Css/style.css"
rel
=
"stylesheet"
type
=
"text/css"
/><%Else%><
link
href
=
"site2url/Css/style.css"
rel
=
"stylesheet"
type
=
"text/css"
/><%End If%>
<
div
class
=
"TopBar"
>
<
label
class
=
"FloatRight TopBarPageTitle CursorArrow"
><
h1
>File Manager</
h1
></
label
>
</
div
>
<
div
class
=
"ControlWrapper"
>
<
div
class
=
"tabStripContainer"
>
<
telerik:RadTabStrip
ID
=
"Radtabstrip1"
runat
=
"server"
Width
=
"100%"
MultiPageID
=
"MultiPage1"
SelectedIndex
=
"0"
TextOnlyTabs
=
"False"
EnableEmbeddedSkins
=
"False"
Skin
=
"CustSkin"
>
<
Tabs
>
<
telerik:RadTab
ToolTip
=
"Image Manager"
Text
=
"Image Manager"
PageViewID
=
"Page3"
></
telerik:RadTab
>
<
telerik:RadTab
ToolTip
=
"Document Manager"
Text
=
"Document Manager"
PageViewID
=
"Page1"
></
telerik:RadTab
>
</
Tabs
>
</
telerik:RadTabStrip
>
<
div
class
=
"SubSectionWithBorder"
>
<
telerik:RadMultiPage
ID
=
"MultiPage1"
runat
=
"server"
Width
=
"100%"
SelectedIndex
=
"0"
>
<
telerik:RadPageView
ID
=
"Page3"
runat
=
"server"
>
<
fieldset
>
<
legend
><
h2
>Image Manager</
h2
></
legend
>
<
telerik:RadFileExplorer
ID
=
"imageExplorer"
TreePaneWidth
=
"200px"
Width
=
"100%"
height
=
"500px"
runat
=
"Server"
EnableOpenFile
=
"false"
AllowPaging
=
"true"
PageSize
=
"15"
BorderWidth
=
"1"
BorderColor
=
"Gray"
>
</
telerik:RadFileExplorer
>
</
fieldset
>
</
telerik:RadPageView
>
</
telerik:RadMultiPage
>
</
div
>
</
div
>
</
div
>
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
docExplorer.Configuration.ViewPaths = New String() {path1}
docExplorer.Configuration.UploadPaths = New String() {path1}
docExplorer.Configuration.DeletePaths = New String() {path1}
docExplorer.Configuration.SearchPatterns = New String() {"*.doc", "*.txt", "*.docx", "*.xls", "*.xlsx", "*.pdf", "*.zip"}
docExplorer.Configuration.MaxUploadFileSize = 5120000
End Sub
We developed a form with different validation scenario's. By changing dropdowns the form the validators are extended.
This scenario is handled via the javascript OnValidation handler (see example below).
When i change the dropdown ddPaymentType after an error message the eventArgs are set correct.
The summary however keeps showing the old errormessage. The tbAccountHolder TextBox is still marked (red borders) as invalid.
The error message disappears when i enter the TextBox with my cursor.
How do i reset the TextBox, when the validation scenario changes?
Kind regards,
Dick van Straaten
function accountHolderValidation_Validate(sender, eventArgs) {
ResetValidator(sender, eventArgs);
var ddPaymentType = document.getElementById("<%= ddPaymentType.ClientID %>");
var tbAccountHolder = document.getElementById("<%= tbAccountHolder.ClientID %>");
if (ddPaymentType.value == "Collect" && (tbAccountHolder.value == "0123456789" || tbAccountHolder.value == "")) {
eventArgs._isValid = false;
eventArgs._cancel = true;
}
}
RegExpTextBoxSetting accountHolderValidation = CreateRegExpTextBoxSetting(@"(?:[0-9A-Za-z\-\. ]*)", new string[] { "tbAccountHolder" }, false, null);
accountHolderValidation.ClientEvents.OnValidating = "accountHolderValidation_Validate";
radInputManager.InputSettings.Add(accountHolderValidation);
<
telerik:RadAjaxManager
runat
=
"server"
ID
=
"RadAjaxManager1"
DefaultLoadingPanelID
=
"RadAjaxLoadingPanel1"
>
<
AjaxSettings
>
<
telerik:AjaxSetting
AjaxControlID
=
"FiltroClientes"
>
<
UpdatedControls
>
<
telerik:AjaxUpdatedControl
ControlID
=
"FiltroClientes"
/>
</
UpdatedControls
>
</
telerik:AjaxSetting
>
<
telerik:AjaxSetting
AjaxControlID
=
"ApplyButton"
>
<
UpdatedControls
>
<
telerik:AjaxUpdatedControl
ControlID
=
"CliGrandeza"
/>
</
UpdatedControls
>
</
telerik:AjaxSetting
>
<
telerik:AjaxSetting
AjaxControlID
=
"CliGrandeza"
>
<
UpdatedControls
>
<
telerik:AjaxUpdatedControl
ControlID
=
"CliGrandeza"
/>
</
UpdatedControls
>
</
telerik:AjaxSetting
>
</
AjaxSettings
>
<
ClientEvents
OnRequestStart
=
"onRequestStart"
/>
</
telerik:RadAjaxManager
>
<
telerik:RadAjaxLoadingPanel
runat
=
"server"
ID
=
"RadAjaxLoadingPanel1"
Skin
=
"Default"
/>
<
telerik:RadWindow
ID
=
"RadWindow1"
runat
=
"server"
Behaviors
=
"Move,Close,Resize"
Title
=
"Filtragem da informação:"
Modal
=
"true"
Width
=
"500"
Height
=
"350"
>
<
ContentTemplate
>
<
telerik:RadFilter
runat
=
"server"
ID
=
"FiltroClientes"
FilterContainerID
=
"CliGrandeza"
ShowApplyButton
=
"false"
OnFieldEditorCreating
=
"FiltroClientes_FieldEditorCreating"
Style
=
"margin: 10px 0 0 10px"
>
</
telerik:RadFilter
>
<
asp:Panel
ID
=
"FilterButtonPanel"
runat
=
"server"
Style
=
"margin: 10px 0 0 10px; font-size: medium"
>
<
asp:LinkButton
runat
=
"server"
ID
=
"ApplyButton"
OnClick
=
"ApplyButton_Click"
Text
=
"Aplicar filtro"
OnClientClick
=
"hideFilterBuilderDialog()"
/>
</
asp:Panel
>
</
ContentTemplate
>
</
telerik:RadWindow
>
<
telerik:RadGrid
ID
=
"CliGrandeza"
runat
=
"server"
AutoGenerateColumns
=
"False"
PageSize
=
"20"
CssClass
=
"BaixaGrid"
GridLines
=
"None"
AllowPaging
=
"True"
AllowSorting
=
"True"
OnNeedDataSource
=
"CliGrandeza_NeedDataSource"
AllowFilteringByColumn
=
"True"
ShowGroupPanel
=
"True"
EnableHeaderContextMenu
=
"True"
EnableLinqExpressions
=
"False"
OnPreRender
=
"CliGrandeza_PreRender"
OnItemDataBound
=
"CliGrandeza_OnItemDataBound"
ShowFooter
=
"True"
CellSpacing
=
"0"
ShowStatusBar
=
"True"
Width
=
"955px"
OnItemCommand
=
"CliGrandeza_ItemCommand"
>
<
GroupingSettings
CaseSensitive
=
"false"
ShowUnGroupButton
=
"True"
RetainGroupFootersVisibility
=
"true"
/>
<
MasterTableView
DataKeyNames
=
"NumCli"
IsFilterItemExpanded
=
"false"
Width
=
"100%"
ShowGroupFooter
=
"true"
CommandItemDisplay
=
"Top"
AllowMultiColumnSorting
=
"True"
AllowFilteringByColumn
=
"true"
NoMasterRecordsText
=
"Não há informação que corresponda à seleção pretendida"
>
<
EditFormSettings
>
<
EditColumn
FilterControlAltText
=
"Filter EditCommandColumn column"
/>
</
EditFormSettings
>
<
PagerStyle
Mode
=
"NextPrev"
/>
<
HeaderStyle
Font-Bold
=
"true"
/>
<
FooterStyle
Font-Size
=
"Smaller"
Font-Italic
=
"true"
Font-Bold
=
"true"
/>
<
CommandItemSettings
ShowAddNewRecordButton
=
"False"
ShowExportToCsvButton
=
"True"
ShowExportToExcelButton
=
"True"
ShowExportToPdfButton
=
"False"
ShowExportToWordButton
=
"True"
>
</
CommandItemSettings
>
<
RowIndicatorColumn
Visible
=
"False"
>
</
RowIndicatorColumn
>
<
ExpandCollapseColumn
Visible
=
"True"
FilterControlAltText
=
"Filter ExpandColumn column"
>
</
ExpandCollapseColumn
>
<
Columns
>
<
telerik:GridBoundColumn
HtmlEncode
=
"true"
DataField
=
"NumCli"
HeaderText
=
"Cliente"
ReadOnly
=
"True"
SortExpression
=
"NumCli"
UniqueName
=
"NumCli"
Aggregate
=
"Count"
FooterText
=
"Clientes: "
FilterControlAltText
=
"Filter NumCli column"
>
<
FooterStyle
HorizontalAlign
=
"Left"
Width
=
"90px"
/>
<
HeaderStyle
HorizontalAlign
=
"Left"
Width
=
"90px"
Wrap
=
"False"
/>
<
ItemStyle
Font-Size
=
"Smaller"
Width
=
"90px"
Wrap
=
"False"
/>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
HtmlEncode
=
"true"
DataField
=
"Nome"
HeaderText
=
"Nome"
ReadOnly
=
"True"
SortExpression
=
"Nome"
UniqueName
=
"Nome"
DataFormatString="<nobr>{0}</
nobr
>"
FilterControlAltText="Filter Nome column">
<
FooterStyle
HorizontalAlign
=
"Left"
Width
=
"470px"
/>
<
HeaderStyle
HorizontalAlign
=
"Center"
Width
=
"470px"
Wrap
=
"False"
/>
<
ItemStyle
Font-Size
=
"Smaller"
Wrap
=
"False"
/>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
HtmlEncode
=
"true"
DataField
=
"Localidade"
HeaderText
=
"Localidade"
ReadOnly
=
"True"
SortExpression
=
"Localidade"
UniqueName
=
"Localidade"
DataFormatString="<nobr>{0}</
nobr
>"
FilterControlAltText="Filter Localidade column">
<
FooterStyle
HorizontalAlign
=
"Left"
Width
=
"170px"
/>
<
HeaderStyle
HorizontalAlign
=
"Center"
Width
=
"170px"
Wrap
=
"False"
/>
<
ItemStyle
Font-Size
=
"Smaller"
Wrap
=
"False"
/>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
HtmlEncode
=
"true"
DataField
=
"Tcliente"
HeaderText
=
"Tipo Cliente"
ReadOnly
=
"True"
UniqueName
=
"Tcliente"
Visible
=
"False"
>
</
telerik:GridBoundColumn
>
…..
<
telerik:GridCalculatedColumn
Aggregate
=
"Sum"
HeaderText
=
"Ano-2"
UniqueName
=
"TotalAnoPen"
DataType
=
"System.Double"
DataFields
=
"Facturas2, Creditos2"
Expression
=
"ISNULL({0},0)+ISNULL({1},0)"
DataFormatString="<nobr>{0:c}</
nobr
>"
FooterText="Total Ano-2: "
SortExpression="TotalAnoPen">
<
FooterStyle
HorizontalAlign
=
"Right"
Width
=
"85px"
/>
<
HeaderStyle
HorizontalAlign
=
"Right"
Width
=
"85px"
Wrap
=
"False"
/>
<
ItemStyle
Font-Size
=
"Smaller"
HorizontalAlign
=
"Right"
Wrap
=
"False"
/>
</
telerik:GridCalculatedColumn
>
</
Columns
>
</
MasterTableView
>
<
GroupingSettings
CaseSensitive
=
"False"
ShowUngroupButton
=
"true"
/>
<
ExportSettings
FileName
=
"Clientes"
HideStructureColumns
=
"true"
ExportOnlyData
=
"true"
IgnorePaging
=
"True"
OpenInNewWindow
=
"true"
>
<
Csv
ColumnDelimiter
=
"Tab"
RowDelimiter
=
"NewLine"
FileExtension
=
"TXT"
EncloseDataWithQuotes
=
"true"
/>
<
Excel
FileExtension
=
"xls"
Format
=
"Html"
/>
</
ExportSettings
>
<
ClientSettings
AllowColumnsReorder
=
"True"
ReorderColumnsOnClient
=
"True"
EnableRowHoverStyle
=
"false"
AllowDragToGroup
=
"True"
>
<
Selecting
AllowRowSelect
=
"True"
CellSelectionMode
=
"None"
EnableDragToSelectRows
=
"False"
/>
<
Scrolling
AllowScroll
=
"True"
UseStaticHeaders
=
"True"
SaveScrollPosition
=
"true"
ScrollHeight
=
"500px"
/>
<
Resizing
EnableRealTimeResize
=
"True"
ResizeGridOnColumnResize
=
"True"
AllowColumnResize
=
"True"
AllowResizeToFit
=
"True"
/>
<
Animation
AllowColumnReorderAnimation
=
"True"
/>
</
ClientSettings
>
<
FilterMenu
EnableImageSprites
=
"False"
/>
</
telerik:RadGrid
>
<
telerik:RadCodeBlock
ID
=
"RadCodeBlock1"
runat
=
"server"
>
<
script
type
=
"text/javascript"
>
<!--
function pageLoad()
{
var filter = $find("<%=FiltroClientes.ClientID %>");
var menu = filter.get_contextMenu();
menu.add_showing(FilterMenuShowing);
}
function FilterMenuShowing(sender, args)
{
var filter = $find("<%=FiltroClientes.ClientID %>");
var currentExpandedItem = sender.get_attributes()._data.ItemHierarchyIndex;
var fieldName = filter._expressionItems[currentExpandedItem];
var allFields = filter._dataFields;
if (fieldName == "Tcliente" || fieldName == "TDistrito" || fieldName == "TVolta" || fieldName == "TZona")
{
for (var i = 0, j = allFields.length; i <
j
; i++)
{
if (allFields[i].FieldName == fieldName)
{
sender.findItemByValue("StartsWith").set_visible(false);
sender.findItemByValue("EndsWith").set_visible(false);
sender.findItemByValue("GreaterThan").set_visible(false);
sender.findItemByValue("GreaterThanOrEqualTo").set_visible(false);
sender.findItemByValue("LessThan").set_visible(false);
sender.findItemByValue("LessThanOrEqualTo").set_visible(false);
sender.findItemByValue("Contains").set_visible(false);
sender.findItemByValue("DoesNotContain").set_visible(false);
sender.findItemByValue("Between").set_visible(false);
sender.findItemByValue("NotBetween").set_visible(false);
}
}
}
}
function openFilterBuilderDialog()
{
$find('<%=RadWindow1.ClientID %>').show();
}
function hideFilterBuilderDialog()
{
$find('<%=RadWindow1.ClientID %>').close();
}
function OnHeaderMenuItemClicked(sender, args)
{
if (args.get_item().get_value() == "FilterBuilder")
{
openFilterBuilderDialog();
}
}
function onPanelBarItemClicked(sender, args)
{
if (args.get_item().get_commandName() == "OpenRadFilter")
{
openFilterBuilderDialog();
}
}
function onRequestStart(sender, args)
{
if (args.get_eventTarget().indexOf("ExportToExcelButton") >= 0 ||
args.get_eventTarget().indexOf("ExportToWordButton") >= 0 ||
args.get_eventTarget().indexOf("ExportToPdfButton") >= 0 ||
args.get_eventTarget().indexOf("ExportToCsvButton") >= 0)
{
args.set_enableAjax(false);
}
}
-->
</
script
>
public partial class VeMapCliGrandeza : System.Web.UI.Page
{
DisPPweb.dal dados = new DisPPweb.dal();
DateTime dataFim = DateTime.Now;
DateTime dataIni = IniciaDatas();
protected void CliGrandeza_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
{
CliGrandeza.DataSource = dados.DSvendas3Anos(Session["Grupo"].ToString(), dataIni, dataFim);
}
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
DataIniBox.SelectedDate = dataIni;
DataFimBox.SelectedDate = dataFim;
ConfirmaDatasBtn.Enabled = true;
CliGrandeza.Visible = false;
RadToolBar1.Visible = false;
RadFilterDropDownEditor dropDownTipoCliente = new RadFilterDropDownEditor();
FiltroClientes.FieldEditors.Add(dropDownTipoCliente);
dropDownTipoCliente.FieldName = "Tcliente";
dropDownTipoCliente.DisplayName = "Tipo de cliente";
dropDownTipoCliente.DataTextField = "Tcliente";
dropDownTipoCliente.DataValueField = "Tcliente";
dropDownTipoCliente.DataSource = dados.GetDataTable("SELECT DISTINCT Texto AS Tcliente FROM dbo.TiposCliente").DefaultView.ToTable(true, "Tcliente");
RadFilterDropDownEditor dropDownDistrito = new RadFilterDropDownEditor();
FiltroClientes.FieldEditors.Add(dropDownDistrito);
dropDownDistrito.FieldName = "TDistrito";
dropDownDistrito.DisplayName = "Distrito";
dropDownDistrito.DataTextField = "TDistrito";
dropDownDistrito.DataValueField = "TDistrito";
dropDownDistrito.DataSource = dados.GetDataTable("SELECT DISTINCT Texto AS TDistrito FROM dbo.Distritos").DefaultView.ToTable(true, "TDistrito");
RadFilterDropDownEditor dropDownZona = new RadFilterDropDownEditor();
FiltroClientes.FieldEditors.Add(dropDownZona);
dropDownZona.FieldName = "TZona";
dropDownZona.DisplayName = "Zona";
dropDownZona.DataTextField = "TZona";
dropDownZona.DataValueField = "TZona";
dropDownZona.DataSource = dados.GetDataTable("SELECT DISTINCT Texto AS TZona FROM dbo.Zonas").DefaultView.ToTable(true, "TZona");
RadFilterDropDownEditor dropDownVolta = new RadFilterDropDownEditor();
FiltroClientes.FieldEditors.Add(dropDownVolta);
dropDownVolta.FieldName = "TVolta";
dropDownVolta.DisplayName = "Volta";
dropDownVolta.DataTextField = "TVolta";
dropDownVolta.DataValueField = "TVolta";
dropDownVolta.DataSource = dados.GetDataTable("SELECT DISTINCT Texto AS TVolta FROM dbo.Voltas").DefaultView.ToTable(true, "TVolta");
}
}
protected void FiltroClientes_FieldEditorCreating(object sender, RadFilterFieldEditorCreatingEventArgs e)
{
if (e.EditorType == "RadFilterDropDownEditor")
{
e.Editor = new RadFilterDropDownEditor();
}
}
protected void ApplyButton_Click(object sender, EventArgs e)
{
FiltroClientes.FireApplyCommand();
}