or
<
telerik:RadGrid
ID
=
"genericGrid"
runat
=
"server"
AutoGenerateColumns
=
"false"
AllowAutomaticDeletes
=
"false"
AllowSorting
=
"true"
AllowAutomaticInserts
=
"false"
AllowAutomaticUpdates
=
"true"
OnDataBound
=
"DataBoundGenericGrid"
AllowCustomPaging
=
"true"
PageSize
=
"100"
AllowPaging
=
"True"
AutoGenerateEditColumn
=
"true"
AllowFilteringByColumn
=
"true"
AllowMultiRowSelection
=
"true"
OnUpdateCommand
=
"ItemUpdatedEvent"
OnCancelCommand
=
"ItemCanceledHandler"
OnInsertCommand
=
"ItemInsertedEvent"
OnEditCommand
=
"ItemEditHandler"
OnItemDataBound
=
"ItemDataBoundEvent"
OnNeedDataSource
=
"GridNeedDataSource"
Style="height: 600;
width: 100%">
<
ClientSettings
AllowDragToGroup
=
"true"
AllowGroupExpandCollapse
=
"true"
>
<
Selecting
AllowRowSelect
=
"true"
EnableDragToSelectRows
=
"false"
/>
<
Scrolling
AllowScroll
=
"true"
UseStaticHeaders
=
"true"
/>
<
ClientEvents
OnRowDblClick
=
"RowDblClick"
/>
</
ClientSettings
>
<
MasterTableView
AutoGenerateColumns
=
"true"
AllowAutomaticDeletes
=
"false"
AllowFilteringByColumn
=
"true"
AllowAutomaticInserts
=
"false"
AllowAutomaticUpdates
=
"true"
GridLines
=
"Vertical"
TableLayout
=
"Fixed"
GroupLoadMode
=
"Client"
EditMode
=
"InPlace"
/>
</
telerik:RadGrid
>
genericGrid.DataSource = table.DefaultView;
foreach
(var gridColumn
in
_gridColumns)
{
genericGrid.Columns.Add(gridColumn);
}
genericGrid.DataSource = table.DefaultView;
var dropDownColumn =
new
GridDateTimeColumn()
{
DataField = tableDefDto.ColumnId
};
Hello,
I have the following code which declares a radwindow in BasePage class, its works fine in aspx pages, but I can't use it in User Controls and Master Pages:
string BaseRadWindowID
{
get
{
return "UniqueBaseRadWindowID";
}
}
RadWindow window = new RadWindow();// Create a enw Window
RadWindow BaseRadWindow
{
get
{
return window;
}
}
protected override void OnInit(EventArgs e)
{
this.window = new RadWindow();// Create a enw Window
window.ID = BaseRadWindowID;// the id of the RadWindow;
this.Form.Controls.Add(window);// Add it to the page
base.OnInit(e);
}
public void ShowBaseRadWindow(bool visibleOnPageLoad, string navigationUrlQueryString)
{
BaseRadWindow.Width = Unit.Pixel(450);
BaseRadWindow.Height = Unit.Pixel(150);
BaseRadWindow.VisibleOnPageLoad = true;
BaseRadWindow.VisibleStatusbar = true;
BaseRadWindow.ReloadOnShow = true;
BaseRadWindow.Modal = true;
BaseRadWindow.Behaviors = WindowBehaviors.Close;
BaseRadWindow.Style.Add("z-index", "10000");
BaseRadWindow.NavigateUrl = "~/Pages/Messages/Default.aspx" + navigationUrlQueryString;
BaseRadWindow.VisibleOnPageLoad = visibleOnPageLoad;
}
I call the window in the aspx pages in this way:
this.ShowBaseRadWindow(true, string.Empty);
Please, I need your help in order to call the window and show it in User Controls and Master Pages.
It is very appreciated to send me the modified code.
Regards,
Bader
<
telerik:RadWindow
ID
=
"RadDeploymentWindow"
Title="<%$ Resources:Text, DeploymentWizard %>"
runat="server" VisibleOnPageLoad="false" VisibleStatusbar="false" Width="535px"
Modal="true" Height="350px" Behaviors="Close,Move,Maximize,Reload " Skin="Windows7"
IconUrl="~/Images/icons/Enterprise.png">
<
ContentTemplate
>
<
telerik:RadGrid
ID
=
"DeploymentGrid"
Skin
=
"Office2007"
runat
=
"server"
AutoGenerateColumns
=
"False"
AllowSorting
=
"True"
PageSize
=
"10"
ShowStatusBar
=
"True"
CellSpacing
=
"0"
GridLines
=
"Both"
AllowPaging
=
"True"
OnNeedDataSource
=
"RadGrid_NeedDataSource"
Height
=
"225px"
Width
=
"516px"
>
<
ClientSettings
>
<
Scrolling
AllowScroll
=
"true"
UseStaticHeaders
=
"true"
/>
</
ClientSettings
>
<
ExportSettings
IgnorePaging
=
"true"
ExportOnlyData
=
"true"
OpenInNewWindow
=
"true"
HideStructureColumns
=
"true"
Excel-Format
=
"Html"
FileName
=
"ErrorsAndWarnings"
>
</
ExportSettings
>
<
MasterTableView
DataKeyNames
=
"ObjectID"
AutoGenerateColumns
=
"false"
CommandItemDisplay
=
"Top"
CommandItemSettings-ShowAddNewRecordButton
=
"false"
CommandItemSettings-ShowRefreshButton
=
"false"
>
<
CommandItemSettings
ShowExportToWordButton
=
"true"
ShowExportToExcelButton
=
"true"
/>
<
ItemStyle
Wrap
=
"false"
/>
<
Columns
>
<
telerik:GridBoundColumn
HeaderStyle-HorizontalAlign
=
"Center"
DataField
=
"ObjectID"
HeaderText
=
"ID"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
HeaderStyle-HorizontalAlign
=
"Center"
DataField
=
"ObjectType"
HeaderText
=
"Type"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
HeaderStyle-HorizontalAlign
=
"Center"
DataField
=
"Name"
HeaderText
=
"Name"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
HeaderStyle-HorizontalAlign
=
"Center"
DataField
=
"Attribute"
HeaderText
=
"Attribute"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
HeaderStyle-HorizontalAlign
=
"Center"
DataField
=
"Error"
HeaderText
=
"Description"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
HeaderStyle-HorizontalAlign
=
"Center"
DataField
=
"ProposedSoluation"
HeaderText
=
"Proposed Solution"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
HeaderStyle-HorizontalAlign
=
"Center"
DataField
=
"Severity"
HeaderText
=
"Severity"
>
</
telerik:GridBoundColumn
>
</
Columns
>
</
MasterTableView
>
<
ClientSettings
>
<
Resizing
AllowColumnResize
=
"True"
></
Resizing
>
</
ClientSettings
>
</
telerik:RadGrid
>
var chbox = document.getElementById("checkbox1");
chbox.checked = true;
<
telerik:RadGrid
ID
=
"RadGridInfoRecharges"
OnItemCommand
=
"RadGridInfoRecharges_ItemCommand"
OnItemDataBound
=
"RadGrid1_ItemDataBound"
Skin
=
"Default"
runat
=
"server"
AutoGenerateColumns
=
"False"
AllowPaging
=
"True"
GridLines
=
"Horizontal"
CssClass
=
"groupBox"
>
<
ExportSettings
ExportOnlyData
=
"false"
FileName
=
"Recharges"
IgnorePaging
=
"true"
OpenInNewWindow
=
"True"
>
<
Csv
ColumnDelimiter
=
"Semicolon"
/>
</
ExportSettings
>
<
MasterTableView
DataSourceID
=
"ObjectDataSourceGetRecharges"
PageSize
=
"50"
DataKeyNames
=
"OwnerId"
>
<
NestedViewTemplate
>
<
asp:Panel
ID
=
"NestedViewPanel"
CssClass
=
"InfoRechargesDetails"
runat
=
"server"
>
<
telerik:RadGrid
ID
=
"RadGridInfoRechargesNested"
Skin
=
"Default"
runat
=
"server"
AutoGenerateColumns
=
"False"
AllowPaging
=
"False"
GridLines
=
"Horizontal"
>
<
MasterTableView
>
<
Columns
>
<
telerik:GridBoundColumn
HeaderText
=
"Credit"
DataFormatString
=
"{0:N0}"
DataField
=
"Credit"
UniqueName
=
"Credit"
></
telerik:GridBoundColumn
>
</
Columns
>
</
MasterTableView
>
</
telerik:RadGrid
>
<
telerik:RadChart
ID
=
"rcRechargesStatisticsRecharges"
Width
=
"900"
Height
=
"300"
runat
=
"server"
DefaultType
=
"Line"
Legend-Appearance-Visible
=
"false"
Legend-Visible
=
"false"
BorderWidth
=
"0"
>
</
telerik:RadChart
>
</
asp:Panel
>
</
NestedViewTemplate
>
<
ExpandCollapseColumn
Visible
=
"True"
></
ExpandCollapseColumn
>
<
Columns
>
<
telerik:GridBoundColumn
HeaderText
=
"OwnerId"
ItemStyle-HorizontalAlign
=
"Right"
DataField
=
"OwnerId"
UniqueName
=
"OwnerId"
></
telerik:GridBoundColumn
>
</
Columns
>
</
MasterTableView
>
</
telerik:RadGrid
>
ItemDataBound
protected
void
RadGrid1_ItemDataBound(
object
sender, GridItemEventArgs e)
{
if
(e.Item
is
GridNestedViewItem)
{
int
OwnerId = ((RechargeItemByContract)e.Item.DataItem).OwnerId;
RadChart rcRechargesStatisticsRecharges = (RadChart)e.Item.FindControl(
"rcRechargesStatisticsRecharges"
);
RadChart rcRechargesStatisticsPrices = (RadChart)e.Item.FindControl(
"rcRechargesStatisticsPrices"
);
// DATA
List<RechargeItemLite> Data = RechargesBLL.GetRechargeItemLite(OwnerId);
if
(Data.Count > 1)
{
rcRechargesStatisticsRecharges.PlotArea.XAxis.Appearance.ValueFormat = Telerik.Charting.Styles.ChartValueFormat.ShortDate;
rcRechargesStatisticsRecharges.PlotArea.XAxis.Appearance.LabelAppearance.RotationAngle = 45;
rcRechargesStatisticsRecharges.PlotArea.XAxis.AutoScale =
false
;
rcRechargesStatisticsRecharges.PlotArea.XAxis.IsZeroBased =
false
;
rcRechargesStatisticsRecharges.Legend.Visible =
false
;
rcRechargesStatisticsRecharges.ChartTitle.TextBlock.Text =
"Creditos por recarga"
;
rcRechargesStatisticsRecharges.DataSource = Data;
double
steps = (Data[0].OADate - Data[Data.Count - 1].OADate) / Data.Count;
rcRechargesStatisticsRecharges.PlotArea.XAxis.AddRange(Data[Data.Count - 1].OADate, Data[0].OADate, steps);
rcRechargesStatisticsRecharges.DataBind();
rcRechargesStatisticsRecharges.Series[0].DataXColumn =
"OADate"
;
rcRechargesStatisticsRecharges.Series[1].Visible =
false
;
rcRechargesStatisticsRecharges.Series[2].Visible =
false
;
rcRechargesStatisticsRecharges.Visible =
true
;
}
else
rcRechargesStatisticsRecharges.Visible =
false
;
ItemComman
protected
void
RadGridInfoRecharges_ItemCommand(
object
source, GridCommandEventArgs e)
{
// cazar el evento del expand/collapse
if
(e.CommandName == RadGrid.ExpandCollapseCommandName)
{
// Si el nestview no esta expandido significa que ahora es se expandera
if
(!e.Item.Expanded)
{
#region declaraciones controles
RadGrid RadGridInfoRechargesNested = (RadGrid)((GridDataItem)e.Item).ChildItem.FindControl(
"RadGridInfoRechargesNested"
);
RadChart rcRechargesStatisticsRecharges = (RadChart)((GridDataItem)e.Item).ChildItem.FindControl(
"rcRechargesStatisticsRecharges"
);
RadChart rcRechargesStatisticsPrices = (RadChart)((GridDataItem)e.Item).ChildItem.FindControl(
"rcRechargesStatisticsPrices"
);
#endregion
// Extraemos la información de DataKeyValue desde la grid principal
int
OwnerId = (
int
)((GridDataItem)e.Item).GetDataKeyValue(
"OwnerId"
);
// DATA
List<RechargeItemLite> Data = RechargesBLL.GetRechargeItemLite(OwnerId);
RadGridInfoRechargesNested.DataSource = Data;
RadGridInfoRechargesNested.DataBind();
if
(Data.Count > 1)
{
rcRechargesStatisticsRecharges.PlotArea.XAxis.Appearance.ValueFormat = Telerik.Charting.Styles.ChartValueFormat.ShortDate;
rcRechargesStatisticsRecharges.PlotArea.XAxis.Appearance.LabelAppearance.RotationAngle = 45;
rcRechargesStatisticsRecharges.PlotArea.XAxis.AutoScale =
false
;
rcRechargesStatisticsRecharges.PlotArea.XAxis.IsZeroBased =
false
;
rcRechargesStatisticsRecharges.Legend.Visible =
false
;
rcRechargesStatisticsRecharges.ChartTitle.TextBlock.Text =
"Creditos por recarga"
;
rcRechargesStatisticsRecharges.DataSource = Data;
double
steps = (Data[0].OADate - Data[Data.Count - 1].OADate) / Data.Count;
rcRechargesStatisticsRecharges.PlotArea.XAxis.AddRange(Data[Data.Count - 1].OADate, Data[0].OADate, steps);
rcRechargesStatisticsRecharges.DataBind();
rcRechargesStatisticsRecharges.Series[0].DataXColumn =
"OADate"
;
rcRechargesStatisticsRecharges.Series[1].Visible =
false
;
rcRechargesStatisticsRecharges.Series[2].Visible =
false
;
rcRechargesStatisticsRecharges.Visible =
true
;
}
else
rcRechargesStatisticsRecharges.Visible =
false
;