or
<
telerik:OpenAccessLinqDataSource
ID
=
"OA_Promos"
Runat
=
"server"
ContextTypeName
=
"Flow.ST2_Data"
EntityTypeName
=
""
OrderBy
=
"ID desc"
ResourceSetName
=
"Promos"
Select
=
"new (ID, identifier, descriptor, lastUpdated, notes, startDate, endDate, startTime, endTime, priority, Promo_art.Art, Promo_art.width, Promo_art.height, Promo_art.fileName, Promo_topic.SpotID)"
Where
=
"Deleted == @Deleted"
>
<
WhereParameters
>
<
asp:Parameter
DefaultValue
=
"0"
Name
=
"Deleted"
Type
=
"Int16"
/>
</
WhereParameters
>
</
telerik:OpenAccessLinqDataSource
>
<
telerik:GridBoundColumn
DataField
=
"Promo_topic.SpotID"
AllowFiltering
=
"true"
SortExpression
=
"SpotID"
CurrentFilterFunction
=
"EqualTo"
FilterControlAltText
=
"Filter SpotID Column"
AutoPostBackOnFilter
=
"true"
ShowFilterIcon
=
"False"
UniqueName
=
"SpotID"
HeaderText
=
"Spot ID"
DataType
=
"System.UInt32"
></
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"Promo_topic.SpotID"
AllowFiltering
=
"true"
SortExpression
=
"SpotID"
CurrentFilterFunction
=
"Custom"
FilterControlAltText
=
"Filter SpotID Column"
AutoPostBackOnFilter
=
"true"
ShowFilterIcon
=
"False"
UniqueName
=
"SpotID"
HeaderText
=
"Spot ID"
DataType
=
"System.UInt32"
></
telerik:GridBoundColumn
>
protected
void
ItemCommandFired(
object
sender, GridCommandEventArgs e)
{
if
(e.CommandName == RadGrid.FilterCommandName)
{
Pair filterPair = (Pair)e.CommandArgument;
if
(filterPair.First.ToString() ==
"Custom"
)
{
string
colName = filterPair.Second.ToString();
TextBox tbPattern = (e.Item
as
GridFilteringItem)[colName].Controls[0]
as
TextBox;
e.Canceled =
true
;
grid_promos.MasterTableView.FilterExpression =
string
.Format(
"(Promo_topic.SpotID.Equals({0})) AND (Promo_topic.SpotID != null)"
, tbPattern.Text);
grid_promos.Rebind();
}
}
}
var
$ = $telerik.$;
var
dropDown = dropDownTree.get_element();
if
(eventArgs.IsValid ===
false
) {
$(dropDown).find(
".rddtInner"
).addClass(
"RadDropDownTreeFieldErrorHighlight"
);
}
else
{
$(dropDown).find(
".rddtInner"
).removeClass(
"RadDropDownTreeFieldErrorHighlight"
);
}
bool
isConfigured =
false
;
protected
void
RadGrid1_ExcelMLExportRowCreated(
object
source, GridExportExcelMLRowCreatedArgs e)
{
if
(e.RowType == GridExportExcelMLRowType.HeaderRow)
{
//Add custom styles to the desired cells
CellElement cell = e.Row.Cells.GetCellByName(
"Number"
);
cell.StyleValue =
"normalHeaderStyle"
;
cell = e.Row.Cells.GetCellByName(
"Name"
);
cell.StyleValue =
"normalHeaderStyle"
;
cell = e.Row.Cells.GetCellByName(
"Weight in Grams"
);
cell.StyleValue =
"normalHeaderStyle"
;
cell = e.Row.Cells.GetCellByName(
"Energie"
);
cell.StyleValue =
"perTotalHeaderStyle"
;
cell = e.Row.Cells.GetCellByName(
"Eiweiss"
);
cell.StyleValue =
"perTotalHeaderStyle"
;
cell = e.Row.Cells.GetCellByName(
"Fett"
);
cell.StyleValue =
"perTotalHeaderStyle"
;
cell = e.Row.Cells.GetCellByName(
"KH"
);
cell.StyleValue =
"perTotalHeaderStyle"
;
cell = e.Row.Cells.GetCellByName(
"Nahrungsfasern, total"
);
cell.StyleValue =
"perTotalHeaderStyle"
;
cell = e.Row.Cells.GetCellByName(
"Energie1"
);
cell.StyleValue =
"per100HeaderStyle"
;
cell = e.Row.Cells.GetCellByName(
"Eiweiss1"
);
cell.StyleValue =
"per100HeaderStyle"
;
cell = e.Row.Cells.GetCellByName(
"Fett1"
);
cell.StyleValue =
"per100HeaderStyle"
;
cell = e.Row.Cells.GetCellByName(
"KH1"
);
cell.StyleValue =
"per100HeaderStyle"
;
cell = e.Row.Cells.GetCellByName(
"Nahrungsfasern, total1"
);
cell.StyleValue =
"per100HeaderStyle"
;
cell = e.Row.Cells.GetCellByName(
"Energie CAL."
);
cell.StyleValue =
"perTotalHeaderStyle"
;
}
if
(e.RowType == GridExportExcelMLRowType.DataRow)
{
//Add custom styles to the desired cells
CellElement cell = e.Row.Cells.GetCellByName(
"Number"
);
cell.StyleValue = cell.StyleValue ==
"itemStyle"
?
"itemNormalStyle"
:
"itemNormalStyle"
;
cell = e.Row.Cells.GetCellByName(
"Name"
);
cell.StyleValue = cell.StyleValue ==
"itemStyle"
?
"itemNormalStyle"
:
"itemNormalStyle"
;
cell = e.Row.Cells.GetCellByName(
"Weight in Grams"
);
cell.StyleValue = cell.StyleValue ==
"itemStyle"
?
"itemNormalStyle"
:
"itemNormalStyle"
;
cell = e.Row.Cells.GetCellByName(
"Energie"
);
cell.StyleValue = cell.StyleValue ==
"itemStyle"
?
"itemNutrientStyle"
:
"itemNutrientStyle"
;
cell = e.Row.Cells.GetCellByName(
"Eiweiss"
);
cell.StyleValue = cell.StyleValue ==
"itemStyle"
?
"itemNutrientStyle"
:
"itemNutrientStyle"
;
cell = e.Row.Cells.GetCellByName(
"Fett"
);
cell.StyleValue = cell.StyleValue ==
"itemStyle"
?
"itemNutrientStyle"
:
"itemNutrientStyle"
;
cell = e.Row.Cells.GetCellByName(
"KH"
);
cell.StyleValue = cell.StyleValue ==
"itemStyle"
?
"itemNutrientStyle"
:
"itemNutrientStyle"
;
cell = e.Row.Cells.GetCellByName(
"Nahrungsfasern, total"
);
cell.StyleValue = cell.StyleValue ==
"itemStyle"
?
"itemNutrientStyle"
:
"itemNutrientStyle"
;
cell = e.Row.Cells.GetCellByName(
"Energie1"
);
cell.StyleValue = cell.StyleValue ==
"itemStyle"
?
"itemNutrientStyle"
:
"itemNutrientStyle"
;
cell = e.Row.Cells.GetCellByName(
"Eiweiss1"
);
cell.StyleValue = cell.StyleValue ==
"itemStyle"
?
"itemNutrientStyle"
:
"itemNutrientStyle"
;
cell = e.Row.Cells.GetCellByName(
"Fett1"
);
cell.StyleValue = cell.StyleValue ==
"itemStyle"
?
"itemNutrientStyle"
:
"itemNutrientStyle"
;
cell = e.Row.Cells.GetCellByName(
"KH1"
);
cell.StyleValue = cell.StyleValue ==
"itemStyle"
?
"itemNutrientStyle"
:
"itemNutrientStyle"
;
cell = e.Row.Cells.GetCellByName(
"Nahrungsfasern, total1"
);
cell.StyleValue = cell.StyleValue ==
"itemStyle"
?
"itemNutrientStyle"
:
"itemNutrientStyle"
;
cell = e.Row.Cells.GetCellByName(
"Energie CAL."
);
cell.StyleValue = cell.StyleValue ==
"itemStyle"
?
"itemNutrientStyle"
:
"itemNutrientStyle"
;
if
(!isConfigured)
{
//Set Worksheet name
e.Worksheet.Name =
"Nährwerte"
;
//Set Column widths
foreach
(ColumnElement column
in
e.Worksheet.Table.Columns)
{
if
(e.Worksheet.Table.Columns.IndexOf(column) == 1)
column.Width = Unit.Point(180);
//set width 180 to ProductName column
else
column.Width = Unit.Point(80);
//set width 80 to the rest of the columns
}
//Set Page options
PageSetupElement pageSetup = e.Worksheet.WorksheetOptions.PageSetup;
pageSetup.PageLayoutElement.IsCenteredVertical =
true
;
pageSetup.PageLayoutElement.IsCenteredHorizontal =
true
;
pageSetup.PageMarginsElement.Left = 0.5;
pageSetup.PageMarginsElement.Top = 0.5;
pageSetup.PageMarginsElement.Right = 0.5;
pageSetup.PageMarginsElement.Bottom = 0.5;
pageSetup.PageLayoutElement.PageOrientation = PageOrientationType.Landscape;
//Freeze panes
//e.Worksheet.WorksheetOptions.AllowFreezePanes = true;
//e.Worksheet.WorksheetOptions.LeftColumnRightPaneNumber = 3;
//e.Worksheet.WorksheetOptions.TopRowBottomPaneNumber = 1;
//e.Worksheet.WorksheetOptions.SplitHorizontalOffset = 1;
//e.Worksheet.WorksheetOptions.SplitVerticalOffest = 1;
//e.Worksheet.WorksheetOptions.ActivePane = 4;
isConfigured =
true
;
}
}
}
protected
void
RadGrid1_ExcelMLExportStylesCreated(
object
source, GridExportExcelMLStyleCreatedArgs e)
{
//Add currency and percent styles
StyleElement pertotalHeaderStyle =
new
StyleElement(
"perTotalHeaderStyle"
);
pertotalHeaderStyle.FontStyle.Color = System.Drawing.Color.Black;
pertotalHeaderStyle.FontStyle.Bold =
true
;
pertotalHeaderStyle.FontStyle.FontName =
"Calibri"
;
pertotalHeaderStyle.FontStyle.Size = 10.0;
e.Styles.Add(pertotalHeaderStyle);
StyleElement per100HeaderStyle =
new
StyleElement(
"per100HeaderStyle"
);
per100HeaderStyle.FontStyle.Color = System.Drawing.Color.Black;
per100HeaderStyle.FontStyle.Bold =
true
;
per100HeaderStyle.FontStyle.FontName =
"Calibri"
;
per100HeaderStyle.FontStyle.Size = 10.0;
e.Styles.Add(per100HeaderStyle);
StyleElement normalHeaderStyle =
new
StyleElement(
"normalHeaderStyle"
);
normalHeaderStyle.FontStyle.Color = System.Drawing.Color.Black;
normalHeaderStyle.FontStyle.Bold =
true
;
normalHeaderStyle.FontStyle.FontName =
"Calibri"
;
normalHeaderStyle.FontStyle.Size = 10.0;
e.Styles.Add(normalHeaderStyle);
StyleElement itemStyle =
new
StyleElement(
"itemNormalStyle"
);
itemStyle.FontStyle.Color = System.Drawing.Color.Black;
itemStyle.FontStyle.Bold =
false
;
itemStyle.FontStyle.FontName =
"Calibri"
;
itemStyle.FontStyle.Size = 10.0;
e.Styles.Add(itemStyle);
StyleElement itemNutrientStyle =
new
StyleElement(
"itemNutrientStyle"
);
itemNutrientStyle.FontStyle.Color = System.Drawing.Color.Black;
itemNutrientStyle.NumberFormat.FormatType = NumberFormatType.Standard;
itemNutrientStyle.FontStyle.Bold =
false
;
itemNutrientStyle.FontStyle.FontName =
"Calibri"
;
itemNutrientStyle.FontStyle.Size = 10.0;
e.Styles.Add(itemNutrientStyle);
//Apply background colors
foreach
(StyleElement style
in
e.Styles)
{
if
(style.Id ==
"perTotalHeaderStyle"
)
{
style.InteriorStyle.Pattern = InteriorPatternType.Solid;
style.InteriorStyle.Color = System.Drawing.Color.Yellow;
}
if
(style.Id ==
"per100HeaderStyle"
)
{
style.InteriorStyle.Pattern = InteriorPatternType.Solid;
style.InteriorStyle.Color = System.Drawing.Color.YellowGreen;
}
if
(style.Id ==
"normalHeaderStyle"
)
{
style.InteriorStyle.Pattern = InteriorPatternType.Solid;
style.InteriorStyle.Color = System.Drawing.Color.Gray;
}
if
(style.Id ==
"itemNormalStyle"
)
{
style.InteriorStyle.Pattern = InteriorPatternType.None;
}
if
(style.Id ==
"itemNutrientStyle"
)
{
style.InteriorStyle.Pattern = InteriorPatternType.None;
}
}
}
<
telerik:RadAjaxPanel
ID
=
"RadAjaxPanel1"
runat
=
"server"
LoadingPanelID
=
"RadAjaxLoadingPanel1"
ClientEvents-OnRequestStart
=
"requestStart"
>
<
telerik:RadGrid
ID
=
"RadGrid1"
Width
=
"97%"
AllowSorting
=
"False"
AllowPaging
=
"True"
PageSize
=
"30"
AllowMultiRowSelection
=
"True"
AllowFilteringByColumn
=
"False"
runat
=
"server"
Gridlines
=
"Horizontal"
AutoGenerateColumns
=
"false"
DataSourceID
=
"SqlDataSource1"
Skin
=
"Vista"
>
<
MasterTableView
DataKeyNames
=
"Number,Name"
CommandItemDisplay
=
"Top"
AllowFilteringByColumn
=
"false"
>
<
Columns
>
<
telerik:GridBoundColumn
UniqueName
=
"Number"
SortExpression
=
"Number"
HeaderText
=
"Number"
DataField
=
"Number"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
UniqueName
=
"Name"
SortExpression
=
"Name"
HeaderText
=
"Name"
DataField
=
"Name"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
FooterText
=
"Weight in Grams footer"
UniqueName
=
"Weight in Grams"
SortExpression
=
"Weight in Grams"
HeaderText
=
"Weight in Grams"
DataField
=
"Weight in Grams"
>
</
telerik:GridBoundColumn
>
<%--Per Serving--%>
<
telerik:GridBoundColumn
UniqueName
=
"Energie"
SortExpression
=
"Energie"
HeaderText
=
"Energie"
DataField
=
"Energie"
DataFormatString
=
"{0:N2}"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
UniqueName
=
"Eiweiss"
SortExpression
=
"Eiweiss"
HeaderText
=
"Eiweiss"
DataField
=
"Eiweiss"
DataFormatString
=
"{0:N2}"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
UniqueName
=
"Fett"
SortExpression
=
"Fett"
HeaderText
=
"Fett"
DataField
=
"Fett"
DataFormatString
=
"{0:N2}"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
UniqueName
=
"KH"
SortExpression
=
"KH"
HeaderText
=
"KH"
DataField
=
"KH"
DataFormatString
=
"{0:N2}"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
UniqueName
=
"Nahrungsfasern, total"
SortExpression
=
"Nahrungsfasern, total"
HeaderText
=
"Nahrungsfasern, total"
DataField
=
"Nahrungsfasern, total"
DataFormatString
=
"{0:N2}"
>
</
telerik:GridBoundColumn
>
<%--Per 100--%>
<
telerik:GridBoundColumn
UniqueName
=
"Energie1"
SortExpression
=
"Energie1"
HeaderText
=
"Energie"
DataField
=
"Energie1"
DataFormatString
=
"{0:N2}"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
UniqueName
=
"Eiweiss1"
SortExpression
=
"Eiweiss1"
HeaderText
=
"Eiweiss"
DataField
=
"Eiweiss1"
DataFormatString
=
"{0:N2}"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
UniqueName
=
"Fett1"
SortExpression
=
"Fet1"
HeaderText
=
"Fett"
DataField
=
"Fett1"
DataFormatString
=
"{0:N2}"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
UniqueName
=
"KH1"
SortExpression
=
"KH1"
HeaderText
=
"KH"
DataField
=
"KH1"
DataFormatString
=
"{0:N2}"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
UniqueName
=
"Nahrungsfasern, total1"
SortExpression
=
"Nahrungsfasern, total1"
HeaderText
=
"Nahrungsfasern, total"
DataField
=
"Nahrungsfasern, total1"
DataFormatString
=
"{0:N2}"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
UniqueName
=
"Energie CAL."
SortExpression
=
"Energie CAL."
HeaderText
=
"Energie CAL."
DataField
=
"Energie CAL."
DataFormatString
=
"{0:N2}"
>
</
telerik:GridBoundColumn
>
</
Columns
>
<
CommandItemSettings
ShowExportToExcelButton
=
"true"
ShowAddNewRecordButton
=
"false"
/>
</
MasterTableView
>
<
ExportSettings
Excel-Format
=
"ExcelML"
HideStructureColumns
=
"true"
ExportOnlyData
=
"true"
IgnorePaging
=
"true"
OpenInNewWindow
=
"true"
>
</
ExportSettings
>
<
PagerStyle
Mode
=
"NextPrevAndNumeric"
Position
=
"TopAndBottom"
/>
</
telerik:RadGrid
>
</
telerik:RadAjaxPanel
>
<
telerik:RadGrid
ID
=
"RadGrid1"
AllowFilteringByColumn
=
"true"
runat
=
"server"
AutoGenerateColumns
=
"False"
AllowSorting
=
"True"
AllowPaging
=
"True"
GridLines
=
"None"
ShowGroupPanel
=
"True"
CellSpacing
=
"0"
>
<
MasterTableView
ShowFooter
=
"true"
>
<
CommandItemSettings
ExportToPdfText
=
"Export to PDF"
></
CommandItemSettings
>
<
RowIndicatorColumn
Visible
=
"True"
FilterControlAltText
=
"Filter RowIndicator column"
>
</
RowIndicatorColumn
>
<
ExpandCollapseColumn
Visible
=
"True"
FilterControlAltText
=
"Filter ExpandColumn column"
>
</
ExpandCollapseColumn
>
<
Columns
>
<
telerik:GridTemplateColumn
Aggregate
=
"Count"
FooterAggregateFormatString
=
"Total : {0:N0}"
SortExpression
=
"TaskNo"
FooterText
=
"Total :"
UniqueName
=
"TaskNo"
HeaderText
=
"Task Id"
DataField
=
"TaskNo"
DataType
=
"System.string"
HeaderTooltip
=
"TaskNo"
>
<
ItemStyle
Width
=
"70px"
Wrap
=
"false"
/>
<
HeaderStyle
Width
=
"70px"
Wrap
=
"false"
/>
<
ItemTemplate
>
<
asp:HyperLink
ID
=
"HyperLink2"
runat
=
"server"
Text='<%#DataBinder.Eval(Container.DataItem, "TaskNo")%>'
NavigateUrl='<%#"~/MyTasksHierarchyMain.aspx?TaskNo=" + DataBinder.Eval(Container.DataItem, "TaskNo").ToString()%>'
Target="_blank"></
asp:HyperLink
>
</
ItemTemplate
>
</
telerik:GridTemplateColumn
>
<
telerik:GridBoundColumn
DataField
=
"FileName"
FilterControlAltText
=
"Filter FileName column"
HeaderText
=
"File Name"
UniqueName
=
"FileName"
SortExpression
=
"FileName"
ReadOnly
=
"True"
>
</
telerik:GridBoundColumn
>