<telerik:RadChart ID="RadChart1"
runat="server" ChartImageFormat="Bmp"
ClientSettings-EnableZoom="false" AutoLayout="True"
DefaultType="Line" Skin="ExcelClassic" Width="1014px" Height="500px"
OnItemDataBound="RadChart1_ItemDataBound" OnDataBound="RadChart1_DataBound" >
<Series>
<telerik:ChartSeries Type="Line">
<
Appearance ShowLabels="false">
<
FillStyle MainColor="156, 154, 255" SecondColor="156, 154, 255">
</FillStyle>
<
Border Color="Black"></Border>
</
Appearance>
</
telerik:ChartSeries>
</
Series>
<
PlotArea>
<
XAxis >
<
Appearance >
<LabelAppearance RotationAngle="30" >
</LabelAppearance>
<
MajorGridLines Width="0" Color="DimGray"></MajorGridLines>
</
Appearance>
<
AxisLabel >
<
TextBlock Text="Date/Time">
<
Appearance TextProperties-Font="Verdana, 9.75pt, style=Bold"></Appearance>
</
TextBlock>
</
AxisLabel>
</
XAxis>
<
YAxis>
<
Appearance MinorTick-Width="0">
<
MajorGridLines Color="Black"></MajorGridLines>
<MinorGridLines Width="0" />
</
Appearance>
<
AxisLabel>
<
TextBlock>
<
Appearance TextProperties-Font="Verdana, 9.75pt, style=Bold"></Appearance>
</
TextBlock>
</
AxisLabel>
</
YAxis>
<YAxis2>
<AxisLabel>
<TextBlock>
<Appearance TextProperties-Font="Verdana, 9.75pt, style=Bold">
</Appearance>
</TextBlock>
</AxisLabel>
</YAxis2>
<
Appearance Corners="Round, Round, Round, Round, 6">
<
FillStyle MainColor="Silver" FillType="Solid"></FillStyle>
<Border Color="Gray" />
</
Appearance>
</
PlotArea>
<
ChartTitle>
<
Appearance
Dimensions-Margins="4%, 10px, 14px, 0%" Position-AlignedPosition="Top">
</
Appearance>
<
TextBlock>
<
Appearance TextProperties-Font="Verdana, 12pt" TextProperties-Color="Black"></Appearance>
</
TextBlock>
</
ChartTitle>
<Legend>
<Appearance Dimensions-AutoSize="true" >
<ItemTextAppearance TextProperties-Font="Verdana, 9pt">
</ItemTextAppearance>
<Border Color="Black" />
</Appearance>
</Legend>
</telerik:RadChart>
<
telerik:RadTreeView ID="RadTreeViewFolders" runat="server" AutoPostBack="False"
BorderWidth="0px" CausesValidation="False" DragAndDrop="False" EnableViewState="true"
LoadingMessagePosition="BeforeNodeText" MultipleSelect="false" OnClientNodeClicking="onNodeClicking"
RetainScrollPosition="true" SingleExpandPath="true"
Skin="Office2007">
</telerik:RadTreeView>
1) The treeview does not repond to the session timeout from asp.net
2) The same happens with the RADGRID
I need help on the above 2 issues
Thanks
| <PagerStyle Mode="Slider" NextPageToolTip="test123" /> |
| <PagerStyle NextPageToolTip="test123" /> |
| function loadToolBar() { |
| var toolBar = $find("<%=reportToolBar.ClientID %>"); |
| var tdTool = toolBar._findItemByText("timeVsDepth"); |
| var chkBoxTimeDepth = $telerik.findElement(tdTool.get_element(), ("chkBoxOptionsTvsD")); |
| var wsTool = toolBar._findItemByText("wellSchematic"); |
| var chkBoxWellSchematic = $telerik.findElement(wsTool.get_element(), ("chkBoxOptionsWS")); |
| var gantTool = toolBar._findItemByText("gant"); |
| var chkBoxGant = $telerik.findElement(gantTool.get_element(), ("chkBoxOptionsGant")); |
| var gantChecked = (getCookie("currentGant")); |
| var timeDChcked = getCookie("currentTimeDepth"); |
| var wellSChck = getCookie("currentWellSch"); |
| if (gantChecked != null && gantChecked == "true") { |
| chkBoxGant.checked = true; |
| document.getElementById("chkboxTest").checked = true; |
| gantTool.check(); |
| } |
| if (timeDChcked != null && timeDChcked == "true") { |
| chkBoxTimeDepth.checked = true; |
| tdTool.check(); |
| } |
| if (wellSChck != null && wellSChck == "true") { |
| chkBoxWellSchematic.checked = true; |
| wsTool.check(); |
| } |
| } |
| <telerik:RadToolBar ID="reportToolBar" Runat="server" Width="100%" OnClientButtonClicked="selectViewOptions" Skin="DBR" EnableEmbeddedSkins="false" OnClientLoad="loadToolBar" > |
| <Items> |
| <telerik:RadToolBarDropDown runat="server" Text="Report Options" Width="50"> |
| <Buttons> |
| <telerik:RadToolBarButton runat="server" Text="timeVsDepth" Value="timeDepth"> |
| <ItemTemplate> |
| <div onclick="StopPropagation(event)"> |
| <asp:CheckBox ID="chkBoxOptionsTvsD" runat="server" Text="Include time vs depth" Font-Size="12px" /> |
| </div> |
| </ItemTemplate> |
| </telerik:RadToolBarButton> |
| <telerik:RadToolBarButton runat="server" Text="wellSchematic" Value="wellSchematic"> |
| <ItemTemplate> |
| <div onclick="StopPropagation(event)"> |
| <asp:CheckBox ID="chkBoxOptionsWS" runat="server" Text="Include well schematic" Font-Size="12px" /> |
| </div> |
| </ItemTemplate> |
| </telerik:RadToolBarButton> |
| <telerik:RadToolBarButton runat="server" Text="gant" Value="gant"> |
| <ItemTemplate> |
| <div onclick="StopPropagation(event)"> |
| <asp:CheckBox ID="chkBoxOptionsGant" runat="server" Text="Include 1 week plan" Font-Size="12px" /> |
| </div> |
| </ItemTemplate> |
| </telerik:RadToolBarButton> |
| </Buttons> |
| </telerik:RadToolBarDropDown> |
| </Items> |
| </telerik:RadToolBar> |
This has to be pretty common and simple and that must be why I havent' been able to find an answer :-)
The RadGrid seemed fine for us until we tried to replace a vanilla grid on a page that uses buttons to dynamically change the datasource AND that also Sorts.
For example,
Say one button on the webform connects to a source of the result of Membership.GetAllUsers() which of course returns a collection of Membership Users objects and then another button fills the grid with a results of some SQL.
Okay... you start with adding the two buttons and in their click events you put standard grid.Datasource=XXX / grid.DataBind() lines.
Everything is good.
BUT it seems to us that when you do this "simple data binding" you lose the ability to SORT the grid. When you sort, the RadGrid disappears (because it is just a rendered table and it is empty.. even though there was ViewState there is no data and so there is no more grid).
So instead we tried going the Telerik way and not using DataBind()... instead using the NeedDataSource event. But this has the problem of it only apparently allowing us to use the grid for one single dedicated purpose - such as GetAllUsers() instead of dynamically changing the data source via buttons.
We thought that somehow we could put some information in the GridNeedDataSourceEventArgs and read it in the NeedDataSource event and do a switch/case but it is readonly and the docs even imply that we only have one data soruce option:
"
In the code of this event you should prepare the data source (list of objects) for Telerik RadGrid and assign it to the grid's DataSource property.
"
How can we both change the grid data source on-demand AND have sorting? It's a more or less built-in feature for other grids including the C1/MS freebies in VS so we took it for granted that it would be here too. Do we have to go back to old style manual code for sorting or Are we just missing something in front of us?
| <script runat="server"> |
| protected void RadScheduler1_ResourcesPopulating(object sender, ResourcesPopulatingEventArgs e) |
| { |
| // Clear any previous resources in the scheduler |
| RadScheduler1.Resources.Clear(); |
| var consultants = new List<RssSchedulerConsultant> |
| { |
| new RssSchedulerConsultant |
| {Name = "test1", Id = 1} |
| }; |
| // Create our new sub-classes schedulerInfo class |
| var info = new RssSchedulerInfo |
| { |
| ViewStart = e.SchedulerInfo.ViewStart, |
| ViewEnd = e.SchedulerInfo.ViewEnd, |
| ViewableConsultants = consultants, |
| Consultant = null |
| }; |
| // Assign it to the eventArgs |
| e.SchedulerInfo = info; |
| } |
| </script> |
| <telerik:RadScheduler ID="RadScheduler1" runat="server" Height="100%" |
| WeekView-GroupBy="Consultant" SelectedView="WeekView" |
| OnResourcesPopulating="RadScheduler1_ResourcesPopulating" |
| ShowResourceHeaders="false"> |
| <WebServiceSettings Path="~/WebServices/ConsultantDayViewScheduler.asmx" ResourcePopulationMode="ServerSide" /> |
| </telerik:RadScheduler> |
| using System.Collections.Generic; |
| using Telerik.Web.UI; |
| using System; |
| namespace Sonic.Rrs.MvcWeb.WebServices.Models |
| { |
| public class RssSchedulerInfo : SchedulerInfo |
| { |
| public IList<RssSchedulerConsultant> ViewableConsultants { get; set; } |
| public RssSchedulerConsultant Consultant { get; set; } |
| } |
| public class RssClinic |
| { |
| public int Id { get; set; } |
| public string Name { get; set; } |
| public DayOfWeek StartDay { get; set; } |
| public DayOfWeek EndDay { get; set; } |
| } |
| public class RssSchedulerConsultant |
| { |
| public string Name { get; set; } |
| public long Id { get; set; } |
| public RssClinic Clinic { get; set; } |
| } |
| } |
| [WebMethod(EnableSession = true)] |
| public IEnumerable<ResourceData> GetResources(RssSchedulerInfo schedulerInfo) |
| { |
| var resources = new List<ResourceData>(); |
| foreach (RssSchedulerConsultant consultant in schedulerInfo.ViewableConsultants) |
| { |
| var resourceItem = new ResourceData |
| { |
| Available = true, |
| Key = consultant.Id.ToString(), |
| Text = consultant.Name, |
| Type = "Consultant" |
| }; |
| resources.Add(resourceItem); |
| } |
| return resources; |
| } |
| function OpenWindow(url, id, iconUrl) |
| { |
| var wnd = $find(id); |
| if (!wnd) |
| { |
| wnd = window.radopen(url, id); |
| if (iconUrl) |
| { |
| wnd.set_iconUrl(iconUrl); |
| } |
| } |
| else |
| { |
| wnd.show(); |
| } |
| return false; |
| } |
| <telerik:RadGrid ID="AllFilesRadGrid" runat="server" DataSourceID="AllFilesSqlDataSource" |
| GridLines="None" AllowFilteringByColumn="True" Skin="Vista"> |
| <MasterTableView AutoGenerateColumns="False" DataKeyNames="File_Id" AllowFilteringByColumn="True" DataSourceID="AllFilesSqlDataSource"> |
| <RowIndicatorColumn> |
| <HeaderStyle Width="20px"></HeaderStyle> |
| </RowIndicatorColumn> |
| <ExpandCollapseColumn> |
| <HeaderStyle Width="20px"></HeaderStyle> |
| </ExpandCollapseColumn> |
| <Columns> |
| <telerik:GridBoundColumn DataField="File_Name" HeaderText="File Name" SortExpression="File_Name" |
| UniqueName="File_Name" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="true"> |
| <ItemStyle Width="50px" CssClass="GridCSS" /> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn DataField="File_Path" HeaderText="File Path" SortExpression="File_Path" |
| UniqueName="File_Path" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="true"> |
| <ItemStyle Width="50px" CssClass="GridCSS" /> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn DataField="File_Type" HeaderText="File Type" SortExpression="File_Type" |
| UniqueName="File_Type" ReadOnly="True" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="true"> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn DataField="StatusOfFile" HeaderText="File Status" SortExpression="StatusOfFile" |
| UniqueName="StatusOfFile" ReadOnly="True" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="true"> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn DataField="File_UploadedDate" DataType="System.DateTime" |
| HeaderText="Uploaded Date" SortExpression="File_UploadedDate" UniqueName="File_UploadedDate" DataFormatString="{0:MM/dd/yy}" HtmlEncode="false"> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn DataField="File_UploadedByName" DataType="System.Int32" HeaderText="Uploaded By" |
| SortExpression="File_UploadedByName" UniqueName="File_UploadedByName" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="true"> |
| </telerik:GridBoundColumn> |
| <telerik:GridTemplateColumn HeaderText="Action" UniqueName="TemplateColumn" AllowFiltering="false" AutoPostBackOnFilter="false" ShowFilterIcon="false"> |
| <ItemTemplate> |
| <asp:ImageButton ID="DownloadImageButton" AlternateText="Download" runat="server" ImageUrl="~/Images/download_manager2.png" Width="16px" Height="16px" CommandArgument='<%# Eval("File_FullPath") %>' onclick="DownloadImageButton_Click" /> |
| |
| |
| <asp:ImageButton ID="ArchiveImageButton" AlternateText="Archive" runat="server" ImageUrl="~/Images/archiver.png" Width="16px" Height="16px" CommandArgument='<%# Eval("File_FullPath") %>' onclick="ArchiveImageButton_Click" /> |
| <cc1:ConfirmButtonExtender ID="ArchiveConfirmButtonExtender" runat="server" ConfirmText="Are you sure you want to archive ?" TargetControlID="ArchiveImageButton" > |
| </cc1:ConfirmButtonExtender> |
| |
| <asp:ImageButton ID="DeleteImageButton" AlternateText="Delete" runat="server" ImageUrl="~/Images/editdelete.png" Width="16px" Height="16px" CommandArgument='<%# Eval("File_FullPath") %>' onclick="DeleteImageButton_Click" /> |
| <cc1:ConfirmButtonExtender ID="DeleteConfirmButtonExtender" runat="server" ConfirmText="Are you sure you want to delete ?" TargetControlID="DeleteImageButton" > |
| </cc1:ConfirmButtonExtender> |
| </ItemTemplate> |
| <ItemStyle Width="330px" /> |
| <HeaderStyle VerticalAlign="Middle" HorizontalAlign="Center" /> |
| </telerik:GridTemplateColumn> |
| </Columns> |
| </MasterTableView> |
| <ClientSettings EnableRowHoverStyle="true"> |
| <Selecting AllowRowSelect="True" /> |
| </ClientSettings> |
| </telerik:RadGrid> |