or
protected void grdAuthorization_PageIndexChanged(object sender, Telerik.Web.UI.GridPageChangedEventArgs e) { List<Entity.TimeSheetAuthorizationView1> list = (List<Entity.TimeSheetAuthorizationView1>)Session[ConstantStrings.AuthorizationList]; if (grdAuthorization.DataSource == null) { grdAuthorization.DataSource = list; grdAuthorization.DataBind(); } grdAuthorization.CurrentPageIndex = e.NewPageIndex; grdAuthorization.DataBind(); ViewState[ConstantStrings.SelectedAuthorizationId] = null; grdAuthorization.SelectedIndexes.Clear(); if (list != null && list.Count > default(int)) { grdAuthorization.SelectedIndexes.Add(default(int)); int id = (int)grdAuthorization.SelectedItems[0].OwnerTableView.DataKeyValues[grdAuthorization.SelectedItems[0].ItemIndex]["Id"]; ViewState[ConstantStrings.SelectedAuthorizationId] = id; } }
<telerik:RadComboBox runat="server" ID="ComboBox" CausesValidation="true" AppendDataBoundItems="False" OnSelectedIndexChanged="OnSelectedIndexChanged" AutoPostBack="True" Filter="Contains" CssClass="combo" EnableTextSelection="True" Width="75%" HighlightTemplatedItems="True" Height="200px" DropDownCssClass="select" OnDataBound="OnDataBound" OnItemDataBound="OnItemDataBound" OnClientBlur="OnclientBlurComboBoxHandler" OnItemCreated="OnItemCreated" OnClientLoad="ThrottleComboBoxAutoComplete" OnItemsRequested="OnItemsRequested" OnClientItemsRequesting="comboboxOnItemsRequesting" OnClientDropDownOpening="comboboxOnDropDownOpening" OnClientKeyPressing="comboBoxOnClientKeyPressing" Style="z-index: 10000001"> <ItemTemplate> <div style="width: 100%"> <asp:Label ID="Label1" runat="server" Font-Size="10" Text='<%# DataBinder.Eval(Container, DataValueProperty).ToString() == "0" ? DataBinder.Eval(Container, "Text") : string.Empty %>' /> <table width="100%" style='display: <%# DataBinder.Eval(Container, "Value").ToString() != "0" ? "table" : "none" %>'> <tr> <td id="ComboSearchTableCellID" runat="server" style="width: 10%"> <asp:Label ID="Label2" runat="server" Text='<%# Eval(DataIDProperty) %>' /> </td> <td> <asp:Label ID="Label3" runat="server" Text='<%# Container.DataItem == null ? DataBinder.Eval(Container, "Text") : DataBinder.Eval(Container.DataItem, DataTextProperty) %>' /> </td> </tr> </table> </div> </ItemTemplate> </telerik:RadComboBox>
function comboboxOnItemsRequesting(combo, eventArgs)
{
if (combo.watingforClientInput == 1) {
combo._filterText = "";
eventArgs.get_context()["Text"] = "";
} else {
combo._filterText = combo.get_text();
eventArgs.get_context()["Text"] = combo.get_text();
}
}
function comboboxOnDropDownOpening(combo, eventArgs) {
if (combo.get_enableLoadOnDemand()) {
combo.watingforClientInput = 1;
if (combo.get_items().get_count() > 0)
combo.requestItems(combo.get_text(), false);
}
}
function comboBoxOnClientKeyPressing(combo, eventArgs) {
if (combo.get_enableLoadOnDemand())
if (combo.watingforClientInput == 1) {
combo.watingforClientInput = 0;
}
}
function RadComboBoxOnClientBlurHandler(sender, eventArgs) {
var checkedItems = sender.get_checkedItems();
switch (checkedItems.length) {
case 0:
sender.set_text("");
break;
case 1:
sender.set_text(sender.get_text());
break;
default:
sender.set_text(checkedItems.length + " items checked");
break;
}
}
<div id="ParentDivElement" runat="server"> <telerik:RadSplitter ID="MainSplitter" runat="server" Width="100%" Orientation="Horizontal" Skin="WebBlue"> <telerik:RadPane ID="MainPane" runat="server" Scrolling="none" MinWidth="500"> <telerik:RadSplitter ID="NestedSplitter" runat="server" LiveResize="True" Skin="WebBlue"> <telerik:RadPane ID="LeftPane" runat="server" MaxWidth="250" MinWidth="250" Scrolling="None" Width="250"> <center> </center> <telerik:RadPanelBar ID="RadPanelBar1" runat="server" Skin="WebBlue" Width="100%"> <Items> <telerik:RadPanelItem runat="server" Enabled="True" Expanded="True" PostBack="False"> <HeaderTemplate> <table cellpadding="0" cellspacing="0" width="100%"> <tr> <td align="left" valign="top"> <asp:Label ID="lblGreeting" runat="server" Font-Names="Trebuchet MS" SkinID="labelSkin1" Text="Hi User!"></asp:Label> </td> <td align="right" valign="top"> </td> </tr> </table> </HeaderTemplate> </telerik:RadPanelItem> </Items> </telerik:RadPanelBar> </telerik:RadPane> <telerik:RadSplitBar ID="VerticalSplitBar" runat="server" CollapseMode="Forward" LiveResize="true" /> <telerik:RadPane ID="ContentPane" runat="server" BackColor="#cbd5df" Scrolling="None"> <asp:Panel ID="Panel2" runat="server"> <telerik:RadGrid ID="RadGrid1" runat="server" AllowFilteringByColumn="True" AllowPaging="true" AllowRowResize="False" AllowSorting="True" BorderStyle="None" GridLines="None" ShowFooter="True" ShowGroupPanel="false" Skin="WebBlue" Visible="False" > <ClientSettings AllowDragToGroup="true" EnablePostBackOnRowClick="true" EnableRowHoverStyle="true" > <Selecting AllowRowSelect="True" /> <ClientEvents OnRowSelected="RowSelected2" /> </ClientSettings> <MasterTableView AutoGenerateColumns="False" ClientDataKeyNames="Code" CommandItemDisplay="Top" EnableHeaderContextMenu="True"> <CommandItemTemplate> <div align="left" style="padding-left: 5px; padding-top: 2px"> <asp:ImageButton ID="ImageButton1" CommandName="SaveSettings" ToolTip="Save Gridview Settings" runat="server" ImageUrl="~/Images/save-gridview-settings_24x24.png" /> <asp:ImageButton ID="ImageButton2" CommandName="DefaultSettings" ToolTip="Reset Gridview Settings" runat="server" ImageUrl="~/Images/restore-default-settings_24x24.png" /></div> </CommandItemTemplate> <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column" Visible="True"> </RowIndicatorColumn> <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column" Visible="True"> </ExpandCollapseColumn> <Columns> <telerik:GridTemplateColumn AllowFiltering="False" CurrentFilterFunction="Custom" DataField="" DefaultInsertValue="" Groupable="true" Reorderable="False" HeaderText="" ReadOnly="True" SortExpression="" UniqueName=""> <ItemTemplate> <asp:Image ID="Image1" runat="server" ImageUrl='<%# "~\Images\DocTypes\" + Eval("Doc").ToString + ".png" %> ' /></ItemTemplate> </telerik:GridTemplateColumn> <telerik:GridBoundColumn DataField="Decision" DefaultInsertValue="" HeaderText="Decision" SortExpression="Decision" UniqueName="Decision" FilterListOptions="VaryByDataType" DataType="System.String"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="Subj" DefaultInsertValue="" HeaderText="Subj" SortExpression="Subj" UniqueName="Subj" DataType="System.String" FilterListOptions="VaryByDataType"> </telerik:GridBoundColumn> <telerik:GridDateTimeColumn DefaultInsertValue="" DataField="Date" HeaderText="Date" SortExpression="Date" PickerType="DatePicker" EnableRangeFiltering="true" DataFormatString="{0:MMMM d, yyyy}" HeaderStyle-HorizontalAlign="Left" ItemStyle-HorizontalAlign="right" FooterStyle-HorizontalAlign="Left"> </telerik:GridDateTimeColumn> </Columns> <EditFormSettings> <EditColumn FilterControlAltText="Filter EditCommandColumn column"> </EditColumn> </EditFormSettings> </MasterTableView><ClientSettings AllowColumnsReorder="True" AllowDragToGroup="True"> <Resizing AllowColumnResize="true" /> </ClientSettings> <PagerStyle Mode="NextPrevNumericAndAdvanced" /> <FilterMenu EnableImageSprites="False"> </FilterMenu> </telerik:RadGrid> <telerik:RadGrid ID="RadGrid2" runat="server" AllowFilteringByColumn="True" AllowPaging="true" AllowRowResize="False" AllowSorting="True" BorderStyle="None" GridLines="None" PageSize="10" ShowFooter="False" ShowGroupPanel="False" Skin="WebBlue" Visible="False"> <ClientSettings AllowDragToGroup="true" EnablePostBackOnRowClick="true" EnableRowHoverStyle="true"> <Selecting AllowRowSelect="True" /> <ClientEvents OnRowSelected="RowSelected2" /> </ClientSettings> <MasterTableView AutoGenerateColumns="False" ClientDataKeyNames="Code" CommandItemDisplay="Top" EnableHeaderContextMenu="True"> <CommandItemTemplate> <div align="left" style="padding-left: 5px; padding-top: 2px"> <asp:ImageButton ID="ImageButton1" runat="server" CommandName="SaveSettings" ImageUrl="~/Images/save-gridview-settings_24x24.png" ToolTip="Save Gridview Settings" /> <asp:ImageButton ID="ImageButton2" runat="server" CommandName="DefaultSettings" ImageUrl="~/Images/restore-default-settings_24x24.png" ToolTip="Reset Gridview Settings" /></div> </CommandItemTemplate> <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column" Visible="True"> </RowIndicatorColumn> <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column" Visible="True"> </ExpandCollapseColumn> <Columns> <telerik:GridTemplateColumn AllowFiltering="False" CurrentFilterFunction="Custom" DataField="" DefaultInsertValue="" Groupable="true" HeaderText="" ReadOnly="True" SortExpression="" UniqueName=""> <ItemTemplate> </ItemTemplate> </telerik:GridTemplateColumn> <telerik:GridBoundColumn DataField="Map" DataType="System.String" DefaultInsertValue="" FilterListOptions="VaryByDataType" HeaderText="Map" SortExpression="Map" UniqueName="Map"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="Location" DataType="System.String" DefaultInsertValue="" FilterListOptions="VaryByDataType" HeaderText="Location" SortExpression="Location" UniqueName="Location"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="Longitude" DataType="System.Double" DefaultInsertValue="" FilterListOptions="VaryByDataType" HeaderText="Longitude" SortExpression="Longitude" UniqueName="Longitude"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="Latitude" DataType="System.Double" DefaultInsertValue="" FilterListOptions="VaryByDataType" HeaderText="Latitude" SortExpression="Latitude" UniqueName="Latitude"> </telerik:GridBoundColumn> </Columns> <EditFormSettings> <EditColumn FilterControlAltText="Filter EditCommandColumn column"> </EditColumn> </EditFormSettings> </MasterTableView><ClientSettings AllowColumnsReorder="True" AllowDragToGroup="True"> <Resizing AllowColumnResize="true"></Resizing> </ClientSettings> <PagerStyle Mode="NextPrevNumericAndAdvanced" /> <FilterMenu EnableImageSprites="False"> </FilterMenu> </telerik:RadGrid> </asp:Panel> </telerik:RadGrid> </telerik:RadPane> <telerik:RadSplitBar ID="RadSplitBar1" runat="server" CollapseMode="Backward" LiveResize="true" /> <telerik:RadPane ID="RightPane" runat="server" MinWidth="300" Width="850px" Scrolling="None"> </telerik:RadPane> </telerik:RadSplitter></telerik:RadPane> </telerik:RadSplitter> </div><telerik:RadImageEditor ID="RadImageEditor1" runat="server" Width="680" Height="450" OnImageLoading="RadImageEditor1_ImageLoading" OnImageSaving="RadImageEditor1_ImageSaving" OnClientSaved="OnClientSaved" OnClientCommandExecuting="OnClientCommandExecuting" ExternalDialogsPath="~/ImageEditorDialogs"> <Tools> <telerik:ImageEditorToolGroup> <telerik:ImageEditorToolStrip CommandName="Undo" /> <telerik:ImageEditorToolStrip CommandName="Redo" /> <telerik:ImageEditorTool CommandName="Reset" /> <telerik:ImageEditorTool CommandName="Save" ToolTip="Save Image" /> <telerik:ImageEditorTool CommandName="Crop" IsToggleButton="true" /> <telerik:ImageEditorTool CommandName="Resize" IsToggleButton="true" /> <telerik:ImageEditorTool CommandName="Zoom" /> <telerik:ImageEditorTool CommandName="ZoomIn" /> <telerik:ImageEditorTool CommandName="ZoomOut" /> <telerik:ImageEditorTool CommandName="Opacity" IsToggleButton="true" /> <telerik:ImageEditorTool CommandName="Rotate" IsToggleButton="true" /> <telerik:ImageEditorTool CommandName="RotateRight" /> <telerik:ImageEditorTool CommandName="RotateLeft" /> <telerik:ImageEditorTool CommandName="Flip" IsToggleButton="true" /> <telerik:ImageEditorTool CommandName="FlipVertical" /> <telerik:ImageEditorTool CommandName="FlipHorizontal" /> <telerik:ImageEditorTool CommandName="AddText" IsToggleButton="true" /> <telerik:ImageEditorTool CommandName="InsertImage" IsToggleButton="true" /> <telerik:ImageEditorTool CommandName="Print" /> </telerik:ImageEditorToolGroup> </Tools> </telerik:RadImageEditor> <telerik:RadCodeBlock ID="codeblock1" runat="server"> <script type="text/javascript"> function OnClientCommandExecuting(imEditor, eventArgs) { if (eventArgs.get_commandName() == 'Save') { imEditor.saveImageOnServer('', true); //Prevent the buil-in Save dialog to pop up imEditor.setToggleState('Save', false); eventArgs.set_cancel(true); } } </script> </telerik:RadCodeBlock>protected void RadImageEditor1_ImageSaving(object sender, Telerik.Web.UI.ImageEditorSavingEventArgs args){ /...}

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"> <AjaxSettings> <telerik:AjaxSetting AjaxControlID="RadAjaxManager1"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="pnlContent" /> </UpdatedControls> </telerik:AjaxSetting> <telerik:AjaxSetting AjaxControlID="btnVerifyUser"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="pnlContent" LoadingPanelID="RadAjaxLoading" /> </UpdatedControls> </telerik:AjaxSetting> <telerik:AjaxSetting AjaxControlID="btnAssignUserToGroup"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="pnlContent" /> </UpdatedControls> </telerik:AjaxSetting> <telerik:AjaxSetting AjaxControlID="btnProcessExcel"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="pnlExcelProcess" LoadingPanelID="RadAjaxLoading" /> </UpdatedControls> </telerik:AjaxSetting> <telerik:AjaxSetting AjaxControlID="btnVerifyExcelRecords"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="pnlExcelProcess" LoadingPanelID="RadAjaxLoading" /> </UpdatedControls> </telerik:AjaxSetting> </AjaxSettings></telerik:RadAjaxManager>RadGrid1.Columns[0].HeaderText = "Rank";protected void RadToolTipManager1_AjaxUpdate(object sender, ToolTipUpdateEventArgs e) { // THIS WORKS SUCCESSFULLY Appointment appointment = null; foreach (var apt in EventScheduler.Appointments.Where(apt => apt.ID.ToString().Equals(e.Value))) { appointment = apt; break; } // CODE COMMENTED BELOW NOT WORKS. WHY? //int aptId; //var appointment = int.TryParse(e.Value, out aptId) ? EventScheduler.Appointments.FindByID(aptId) : EventScheduler.Appointments.FindByID(e.Value); if (appointment == null) return; var toolTip = (AppointmentToolTip)LoadControl("UserControl/AppointmentToolTip.ascx"); toolTip.TargetAppointment = appointment; e.UpdatePanel.ContentTemplateContainer.Controls.Add(toolTip); }<telerik:RadGrid ID="HomeRadGrid" runat="server" OnNeedDataSource="HomeRadGrid_NeedDataSource" EnableEmbeddedSkins="False" AllowPaging="True" AllowAutomaticUpdates="false" AllowAutomaticInserts="false" AllowAutomaticDeletes="false" AllowSorting="True" AllowFilteringByColumn="True" CellSpacing="0" Culture="it-IT" GridLines="None" OnItemCommand = "HomeRadGrid_ItemCommand" OnGroupsChanging="HomeRadGrid_GroupsChanging" OnItemDataBound = "HomeRadGrid_ItemDataBound" Skin="MySkin" ShowGroupPanel="True"> <PagerStyle Mode="NextPrevAndNumeric" /> <MasterTableView AutoGenerateColumns="False" CommandItemDisplay="Top" DataKeyNames="Id"> <ColumnGroups> <telerik:GridColumnGroup Name="GeneralInformation" HeaderText="General Information" HeaderStyle-HorizontalAlign="Center" /> <telerik:GridColumnGroup Name="WarningsIcon" HeaderText="Warnings" HeaderStyle-HorizontalAlign="Center" /> </ColumnGroups> <CommandItemSettings RefreshText="" ShowAddNewRecordButton="false" /> <GroupByExpressions> <telerik:GridGroupByExpression> <SelectFields> <telerik:GridGroupByField FieldAlias="Company" FieldName="Cdc.CompanyCode"></telerik:GridGroupByField> </SelectFields> <GroupByFields> <telerik:GridGroupByField FieldName="Cdc.CompanyCode" SortOrder="Descending"></telerik:GridGroupByField> </GroupByFields> </telerik:GridGroupByExpression> <telerik:GridGroupByExpression> <SelectFields> <telerik:GridGroupByField FieldAlias="Project" FieldName="Cdc.Code" ></telerik:GridGroupByField> </SelectFields> <GroupByFields> <telerik:GridGroupByField FieldName="Cdc.Code"></telerik:GridGroupByField> </GroupByFields> </telerik:GridGroupByExpression> </GroupByExpressions> <Columns> <telerik:GridBoundColumn DataField="Cdc.CompanyCode" HeaderText="Company Code" SortExpression="Cdc.CompanyCode" UniqueName="Cdc.CompanyCode" Visible="false" ColumnGroupName="GeneralInformation" > </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="Cdc.Code" HeaderText="Project" SortExpression="Cdc.Code" UniqueName="Cdc.Code" Visible="false" ColumnGroupName="GeneralInformation" > </telerik:GridBoundColumn> ... </Columns> <NestedViewTemplate> ... </NestedViewTemplate> </MasterTableView> <ClientSettings ReorderColumnsOnClient="True" AllowDragToGroup="True" AllowColumnsReorder="True"> <ClientEvents OnRowDblClick="RowDblClick"></ClientEvents> <Selecting AllowRowSelect="False"></Selecting> <Resizing AllowRowResize="True" AllowColumnResize="True" EnableRealTimeResize="True" ResizeGridOnColumnResize="False"></Resizing> </ClientSettings> <GroupingSettings ShowUnGroupButton="true"></GroupingSettings> </telerik:RadGrid>/// <summary> /// Eventi sul grid /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void HomeRadGrid_ItemCommand(object sender, GridCommandEventArgs e) { switch (e.CommandName) { case "RebindGrid": //tolgo i filtri foreach (GridColumn column in HomeRadGrid.MasterTableView.OwnerGrid.Columns) { column.CurrentFilterFunction = GridKnownFunction.NoFilter; column.CurrentFilterValue = string.Empty; } HomeRadGrid.MasterTableView.FilterExpression = string.Empty; //tolgo i gruppi HomeRadGrid.MasterTableView.GroupByExpressions.Clear(); //Refresh datagrid HomeRadGrid.Rebind(); break; }