<
telerik:RadGrid
ID
=
"radGridOutput"
runat
=
"server"
AllowPaging
=
"True"
Width
=
"100%"
enableEmbeddedSkins
=
"false"
Skin
=
"CorpsNET"
AllowSorting
=
"true"
pagesize
=
"10"
ClientSettings-AllowKeyboardNavigation
=
"false"
ItemStyle-HorizontalAlign
=
"Center"
HeaderStyle-HorizontalAlign
=
"Center"
AlternatingItemStyle-HorizontalAlign
=
"Center"
onpageindexchanged
=
"radGridOutput_PageIndexChanged"
onsortcommand
=
"radGridOutput_SortCommand"
onitemdatabound
=
"radGridOutput_ItemDataBound"
>
<
PagerStyle
Mode
=
"NextPrevAndNumeric"
/>
<
MasterTableView
AutoGenerateColumns
=
"false"
Width
=
"100%"
CommandItemDisplay
=
"None"
PageSize
=
"10"
>
<
Columns
>
</
Columns
>
<
EditFormSettings
>
<
PopUpSettings
ScrollBars
=
"None"
/>
</
EditFormSettings
>
<
NoRecordsTemplate
>
<
div
align
=
"center"
style
=
"color:darkorange"
>---------- No Records to Display -----------</
div
>
</
NoRecordsTemplate
>
</
MasterTableView
>
<
ClientSettings
>
</
ClientSettings
>
</
telerik:RadGrid
>
protected void btnCreateReport_Click(object sender, EventArgs e)
{
LoadReport(true);
RadTabStrip1.SelectedIndex = 1;
RadMultiPage1.SelectedIndex = 1;
}
protected void LoadReport(bool firstLoad)
{
//if we are paging or sorting don't erase the columns
if (firstLoad == true)
{
radGridOutput.DataSource = null;
radGridOutput.MasterTableView.DataKeyNames = null;
radGridOutput.MasterTableView.Columns.Clear();
radGridOutput.Columns.Clear();
}
if (firstLoad == true)
{
radGridOutput.MasterTableView.AutoGenerateColumns = false;
radGridOutput.AutoGenerateColumns = false;
//string[] _keys3 = { "ID" };
//radGridOutput.MasterTableView.DataKeyNames = _keys3;
radGridOutput.Columns.Add(new GridBoundColumn() { UniqueName = "RosterDate", DataField = "RosterDateString", HeaderText = "Date", SortExpression = "RosterDate" });
radGridOutput.Columns.Add(new GridBoundColumn() { UniqueName = "RosterDay", DataField = "RosterDay", HeaderText = "Day" });
radGridOutput.Columns.Add(new GridBoundColumn() { UniqueName = "SponsorNumberAndName", DataField = "SponsorNumberAndName", HeaderText = "Sponsor", SortExpression = "SponsorNumberAndName" });
radGridOutput.Columns.Add(new GridBoundColumn() { UniqueName = "LocationNumberAndName", DataField = "LocationNumberAndName", HeaderText = "Location", SortExpression = "LocationNumberAndName" });
radGridOutput.Columns.Add(new GridBoundColumn() { UniqueName = "CrewName", DataField = "CrewName", HeaderText = "Crew", SortExpression = "CrewName" });
radGridOutput.Columns.Add(new GridBoundColumn() { UniqueName = "SupervisorName", DataField = "SupervisorName", HeaderText = "Supervisor", SortExpression = "SupervisorName" });
radGridOutput.Columns.Add(new GridBoundColumn() { UniqueName = "NumberOfCrewmembers", DataField = "NumberOfCrewmembers", HeaderText = "# Crew Members", SortExpression = "NumberOfCrewmembers" });
radGridOutput.Columns.Add(new GridBoundColumn() { UniqueName = "TotalHours", DataField = "totalhours", HeaderText = "Total Hours", SortExpression = "totalHours" });
}
if (rdoPayPeriod.Checked == true)
{
PayPeriod _payPeriod = PayPeriodService.GetByID(Int32.Parse(ddlPayPeriod.SelectedValue.ToString()));
radGridOutput.DataSource = RptProjectHoursDetailService.GetReport(_payPeriod.StartDate, _payPeriod.EndDate, ddlSponsor.SelectedIndex>0?Int32.Parse(ddlSponsor.SelectedValue.ToString()):0);
}
else if (rdoSchoolMonth.Checked == true)
{
SchoolMonth _schoolMonth = SchoolMonthService.GetByID(Int32.Parse(ddlSchoolMonth.SelectedValue.ToString()));
radGridOutput.DataSource = RptProjectHoursDetailService.GetReport(_schoolMonth.StartDate, _schoolMonth.EndDate, ddlSponsor.SelectedIndex > 0 ? Int32.Parse(ddlSponsor.SelectedValue.ToString()) : 0);
}
else if (rdoSpecifiedTimePeriod.Checked == true)
{
radGridOutput.DataSource = RptProjectHoursDetailService.GetReport(DateTime.Parse(rdpStartDate.DbSelectedDate.ToString()), DateTime.Parse(rdpEndDate.DbSelectedDate.ToString()), ddlSponsor.SelectedIndex > 0 ? Int32.Parse(ddlSponsor.SelectedValue.ToString()) : 0);
}
radGridOutput.DataBind();
}
protected void radGridOutput_SortCommand(object source, GridSortCommandEventArgs e)
{
LoadReport(false);
}
Hi,
I have a radgrid with the following settings
<ExportSettings IgnorePaging="true" OpenInNewWindow="true" HideStructureColumns="true">
<Excel Format="Xlsx" DefaultCellAlignment="Left" />
</ExportSettings>
<CommandItemTemplate>
<asp:Button ID="btnShowAll" runat="server" Text="Clear Filter" CssClass="fa fa-refresh"
AlternateText="Show All" ToolTip="Clear filters" CommandName="InitShowAll" />
<asp:Button ID="btnExport" runat="server" Text="Export" CssClass="fa fa-refresh"
AlternateText="Export" ToolTip="Export" CommandName="InitExport" />
</CommandItemTemplate>
The issue is, I couldn't remove the filter row from the exported xlsx file. Even with ExportOnlyData = true the filter row data is visible.
I also tried filterItem.Visible = false. Sill no luck.
Is it possible to toggle Full Screen mode on the sever-side for the RadImageGallery control?
I have a RadImageGallery (inside a RadAjaxPanel), based on a users permissions and other variables (defined on the server-side), I want to be able to toggle whether or not the Gallery is displayed in Full Screen initially or not.
Thanks in advance!
I am plotting WeekNumber of the year on X-axis, and Number of Requests of a particular school on to Y-axis of a Line Series.
Results of a Stored Procedure are assigned to a List of section-requests, by passing School ID, and a date range.
The output of Stored procedure gives: Number of Requests per week, Created Date, Week Number (of the Year), School Name.
Code calls stored procedure 5 times, and stores the results in 5 individual Lists. Code loops through an array of 5 Lists (section-requests) .
By using the LineSeries, AxisItem, and CategorySeriesItem , I have created a Multi-Line chart.
My issues are:
(1) Once the first List plots on the first LineChart, because of the looping as individual Lists, the Week Number of the second List is starting from where the Week Number of the first List ended. Is there a way that I can group all the Lists with the LineSeries, and plot only one set of Week Numbers (X axis) and related LineSeries (Y axis) for each individual school? Please take a look at the Line chart in the attached file
(2) If there is no section-request in a particular week, I need logic to treat “Number of Requests per week” as zero.
For Loop Code:
for (int i = 0; i < arrMasterList.Length; i++)
{
int intCount = arrMasterList[i].Count;
foreach (var sectionRequest in arrMasterList[i])
{
intSecReqs =
sectionRequest.NumberOfRequestsPerWeek;
if (intSecReqs >= 0)
{
AxisItem item = new AxisItem();
item.LabelText = "Wk: " +
sectionRequest.WeekNumber;
LineChart.PlotArea.XAxis.Items.Add(item);
CategorySeriesItem categorySeriesItem = new CategorySeriesItem();
categorySeriesItem.Y = intSecReqs;
arrLineSeries[i].SeriesItems.Add(categorySeriesItem);
lstSecReqs.Add(intSecReqs);
}
LineChart.PlotArea.Series.Add(arrLineSeries[i]);
}
}
intMaxValueReqs = lstSecReqs.Max();
LineChart.PlotArea.YAxis.MinValue = 0;
LineChart.PlotArea.YAxis.MaxValue =
intMaxValueReqs + 10;
LineChart.PlotArea.YAxis.MinorGridLines.Color = Color.White;
LineChart.PlotArea.XAxis.MajorGridLines.Color = Color.White;
LineChart.PlotArea.XAxis.TitleAppearance.Text = "Week number";
Hello Telerik team!
I use the example for load on demand my orgchart, but, not sure how work, because in the example, data is load one time, but i need get data from database and create new nodes from the node selected.
I tried to create nodes but did not succeed.
Annex example.
Thank you vey much.
Atte.:Charly.
I am using the built-in Export to Excel and Refresh buttons. Strangely when deployed to local and remote environment the layout differs - DIV at local and Table TR for remote, out of the same code base. The left aligned layout, one shown in the first screen capture, is the desired outcome. Can confirm this absurd behaviour is only present on IE (Same browser configuration on different terminals used to test both environments and had consistent results) - Chrome and Firefox have been tested to be rendering the desired layout on both environment.
Here is my RadGrid markup:
<
asp:Panel
ID
=
"pnlMainReport"
runat
=
"server"
>
<
telerik:RadGrid
ID
=
"rgRecReport"
runat
=
"server"
DataSourceID
=
"dsRec"
AllowAutomaticUpdates
=
"False"
RenderMode
=
"Lightweight"
AllowMultiRowSelection
=
"false"
Skin
=
"Metro"
AllowPaging
=
"true"
OnItemDataBound
=
"rgRecReport_ItemDataBound"
CssClass
=
"RemoveBorders"
>
<
ClientSettings
EnableAlternatingItems
=
"false"
EnableRowHoverStyle
=
"true"
>
<
Selecting
AllowRowSelect
=
"true"
/>
<
ClientEvents
OnRowClick
=
"ReportContextMenu"
OnRowContextMenu
=
"ReportContextMenu"
/>
</
ClientSettings
>
<
MasterTableView
AutoGenerateColumns
=
"False"
DataSourceID
=
"dsRec"
DataKeyNames
=
"ResultTableName"
PageSize
=
"100"
CommandItemDisplay
=
"Top"
CommandItemSettings-ShowExportToExcelButton
=
"true"
CommandItemSettings-ExportToExcelImageUrl
=
"~/images/excel.png"
CommandItemSettings-ShowAddNewRecordButton
=
"false"
>
HTML of the incorrect layout on IE:
<
tr
>
<
td
align
=
"left"
> </
td
><
td
align
=
"right"
><
input
name
=
"rgRecReport$ctl00$ctl02$ctl00$RefreshButton"
title
=
"Refresh"
class
=
"rgRefresh"
id
=
"rgRecReport_ctl00_ctl02_ctl00_RefreshButton"
onclick
=
"javascript:__doPostBack('rgRecReport$ctl00$ctl02$ctl00$RefreshButton','')"
type
=
"button"
value
=
" "
><
a
id
=
"rgRecReport_ctl00_ctl02_ctl00_RebindGridButton"
href
=
"javascript:__doPostBack('rgRecReport$ctl00$ctl02$ctl00$RebindGridButton','')"
>Refresh</
a
> | <
a
id
=
"rgRecReport_ctl00_ctl02_ctl00_ExportToExcelButton"
href
=
"javascript:__doPostBack('rgRecReport$ctl00$ctl02$ctl00$ExportToExcelButton','')"
><
img
style
=
"border: 0px currentColor; border-image: none;"
alt
=
""
src
=
"/images/excel.png"
> Export to Excel</
a
> </
td
>
</
tr
>
<
telerik:RadGrid
ID
=
"grdTest"
runat
=
"server"
AutoGenerateColumns
=
"false"
PageSize
=
"20"
AllowSorting
=
"true"
AllowPaging
=
"true"
ShowGroupPanel
=
"true"
ShowFooter
=
"true"
MasterTableView-HierarchyDefaultExpanded
=
"true"
OnNeedDataSource
=
"grdTest_NeedDataSource"
OnItemCreated
=
"grdTest_ItemCreated"
OnPreRender
=
"grdTest_PreRender"
>
<
MasterTableView
AllowSorting
=
"true"
DataKeyNames
=
"TicketID, TopTicketID"
Width
=
"100%"
HierarchyLoadMode
=
"ServerBind"
>
<
SelfHierarchySettings
ParentKeyName
=
"TopTicketID"
KeyName
=
"TicketID"
/>
<
Columns
>
<
telerik:GridBoundColumn
SortExpression
=
"TicketID"
HeaderText
=
"Ticket"
HeaderButtonType
=
"TextButton"
DataField
=
"TicketID"
UniqueName
=
"TicketID"
></
telerik:GridBoundColumn
>
</
Columns
>
</
MasterTableView
>
<
ClientSettings
AllowExpandCollapse
=
"true"
></
ClientSettings
>
</
telerik:RadGrid
>
protected void grdTest_NeedDataSource(object sender, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
{
grdTest.DataSource = BLogic.ITTickets.GetStructure(null, null, 0);
}
protected void grdTest_PreRender(object sender, EventArgs e)
{
HideExpandColumnRecursive(grdTest.MasterTableView);
}
public void HideExpandColumnRecursive(GridTableView tableView)
{
GridItem[] nestedViewItems = tableView.GetItems(GridItemType.NestedView);
foreach (GridNestedViewItem nestedViewItem in nestedViewItems)
{
foreach (GridTableView nestedView in nestedViewItem.NestedTableViews)
{
if (nestedView.Items.Count == 0)
{
TableCell cell = nestedView.ParentItem["ExpandColumn"];
cell.Controls[0].Visible = false;
cell.Text = " ";
nestedViewItem.Visible = false;
}
if (nestedView.HasDetailTables)
{
HideExpandColumnRecursive(nestedView);
}
}
}
}