Hello!
I'm having an issue with the RadComboBox control. I have noticed that when there are 2 items that have the same name, let's call them "Combo1", the event SelectedIndexChanged doesn't fire if the user is selecting the second "Combo1" while the current selection is the first "Combo1", or viceversa.
Here's a sample with which I've reproduced the issue:
<%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<asp:scriptmanager runat="server"></asp:scriptmanager>
<telerik:RadComboBox id="ComboBox1" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ComboBox1_SelectedIndexChanged">
<Items>
<telerik:RadComboBoxItem Text="Combo1" />
<telerik:RadComboBoxItem Text="Combo2" />
<telerik:RadComboBoxItem Text="Combo1" />
</Items>
</telerik:RadComboBox>
</form>
</body>
</html>
using System;
using System.Web.UI;
namespace WebApplication2
{
public partial class WebForm1 : Page
{
protected void ComboBox1_SelectedIndexChanged(object sender, Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs e)
{
}
}
}
Am I doing something wrong or is this a bug? Is there a workaround that I could use in order to get it to work properly?
Best Regards,
Andrei
Hi,
I am using the DetailTemplateItemDataCell to put detailed information in per grid item.
However it is not used in all cases. When we want just the row itself I would like to be able to hide the detail template item but have not found this trivial.
I have tried .visible = false which doesn't render the detail cell but the row is still rendered and takes up the same amount of space.
I have also tried using DetailTemplateItemDataCell.parent.visible but this doesn't work either as it doesn't map to the row element.
Using css to set display none doesn't help either.
I am thinking that I am going to have to write some jquery to select the detail item data cells that I want to hide (based upon their content) then hide their parents. I was however hoping that there was an easier way to set this on the server side.
Any suggestions?
Thanks,
Matt
Hello.
Reading the documentation, it looks like there is no way to have a Tooltip added to Diagram Shapes.
I don't see either a shape server-side click event so I could add a tooltip manually.
Can you confirm that?
Thank you.
Hello Telerik support
I have ImageUrl="../Images/loadingArrow.gif" set to RadTab in a RadTabstrip. After page load, ajax asynchronous request is executed and once it is successful, I want to remove the Image from the Tab.
<telerik:RadTab Text="Tab2" Value="Tab2" runat="server" PostBack="true" PageViewID="rpvTab2" CssClass="tab" SelectedCssClass="tabSelected" ImageUrl="Images/loadingArrow.gif"/>
I used following code in javascript which did a trick, but after the postback the original image is displayed on the Tab.
var listChildNodes = tab.get_element().getElementsByClassName("rtsIn")["0"].childNodes;
tab.get_element().getElementsByClassName("rtsIn")["0"].removeChild(listChildNodes[0]);
Can you please suggest a way to remove the Image from the Tab and also it should not be visible after postback.
Thanks.
Manisha
I have a requirement where
1. user clicks on radgrid row and a new rad window opens
2. if the user minimizes that window (not close) and selects another row in the radgrid, another new window opens
3 i only need minimize, maximize, and close buttons in the title bar.
I have looked into the following demo: http://demos.telerik.com/aspnet-ajax/controls/examples/integration/gridandwindow/defaultcs.aspx?product=window
I would like to have it working like shown in the demo, instead i would open individual windows for each rad grid selection.
Also, how would i add all the <div><table></div> contents in the rad window dynamically?
Thanks
Hi Everyone,
I am new to Telerik world and I am very much impressed with telerik controls. My requirement is to bind web API json data to radgrid in client side(wanted to implement paging and sorting also in client side).And also when I click on my first column link button, popup window should show the selected row data
Below is my code.
Somehow data is binding to radgrid, but when I click on next page in paging nothing is showing(radgrid not displaying). And I am stuck in pass the selected row data to popup(rad window)
Please help me on this.
================================
jsonRadgridBind.aspx
================================
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="jsonRadgridBind.aspx.vb" Inherits="defaultvb.jsonRadgridBind" %>
<!DOCTYPE html>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script src="//code.jquery.com/jquery-1.11.1.min.js" type="text/javascript"></script>
<telerik:RadCodeBlock ID="AnnualProcessAdmin_RadCodeBlock" runat="server">
<style type="text/css">
.rgRow, .rgAltRow {
height: 40px;
}
</style>
<script type="text/javascript">
$(document).ready(function () {
jQuery.support.cors = true;
$.ajax({
type: 'GET',
contentType: 'application/json; charset=utf-8',
dataType: 'JSON',
url: 'http://localhost:5000/api/spaclasslegend',
success: function (result) {
GridData = result;
if (GridData.length > 0) {
var tableView = $find("<%=ClassGrid.ClientID %>").get_masterTableView();
tableView.set_dataSource(GridData);
tableView.dataBind();
}
},
error: function () {
alert('Error on binding the data');
}
});
});
</script>
</telerik:RadCodeBlock>
</head>
<body>
<form id="form1" runat="server">
<telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
<div class="demo-container no-bg">
<div id="grid">
<telerik:RadAjaxPanel ID="ClassSearchRadAjaxPanel" runat="server">
<telerik:RadWindowManager ID="ClassDetailRadWindowManager" runat="server" SkinID="radWindowManager"></telerik:RadWindowManager>
<telerik:RadWindow ID="ClassDetailModal" SkinID="radWindowModal" runat="server" Width="990" Height="700" />
<telerik:RadGrid ID="ClassGrid" runat="server" SkinID="basicRadGrid"
EnableLinqExpressions="false" ShowFooter="false" PageSize="3" AllowPaging="true" PagerStyle-AlwaysVisible="true"
AllowFilteringByColumn="true" FilterItemStyle-HorizontalAlign="Left"
Visible="true">
<ClientSettings EnablePostBackOnRowClick="true">
<ClientEvents OnCommand="function(){}" />
<Scrolling FrozenColumnsCount="0" />
</ClientSettings>
<FilterMenu />
<MasterTableView
ClientDataKeyNames="atrSpaCityDistrictId,CityDistrict,legend,classCode,isActive" DataKeyNames="atrSpaCityDistrictId,CityDistrict,legend,classCode,isActive">
<CommandItemSettings ShowAddNewRecordButton="false" ShowCancelChangesButton="false" ShowRefreshButton="false" ShowExportToExcelButton="true" />
<Columns>
<telerik:GridTemplateColumn DataField="CityDistrict" HeaderText="City/District" UniqueName="CityDistrict">
<ItemTemplate>
<asp:LinkButton ID="lnkCityDistrict" runat="server"></asp:LinkButton>
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridBoundColumn DataField="legend" HeaderText="legend" ColumnEditorID="GridTextBoxEditor">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="classCode" HeaderText="classCode" ReadOnly="true">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="isActive" HeaderText="isActive" ColumnEditorID="GridTextBoxEditor">
</telerik:GridBoundColumn>
<telerik:GridTemplateColumn DataField="atrSpaCityDistrictId" HeaderText="atrSpaCityDistrictId" UniqueName="atrSpaCityDistrictId" Display="false">
<ItemTemplate>
<asp:Label runat="server" ID="lblId"></asp:Label>
</ItemTemplate>
</telerik:GridTemplateColumn>
</Columns>
</MasterTableView>
</telerik:RadGrid>
</telerik:RadAjaxPanel>
</div>
</div>
</form>
</body>
</html>
===========================
Json data
===========================
[{"classDesc":"SIDEWALK, DRIVEWAY, CURB","classCode":"EH","legend":"017","isActive":"Y","atrSpaCityDistrictId":"00D17209F8F25F6D4A00011302","atrSpaCitieDistrict":{"cityDistrict":"","isActive":"1","atrSpaClassLegends":null,"id":"00D17209F8F25F6D4A00011302"},"id":"00D1748B8DA0AB0A7400011202"},
{"classDesc":"SIDEWALK, DRIVEWAY, CURB ","classCode":"EH","legend":"017","isActive":"Y","atrSpaCityDistrictId":"00D17209F8F25F6D4A00011302","atrSpaCitieDistrict":{"cityDistrict":"","isActive":"1","atrSpaClassLegends":null,"id":"00D17209F8F25F6D4A00011302"},"id":"00D1748B8DA0AD8BCA00011202"},
{"classDesc":"REFUSE SERVICE ","classCode":"EG","legend":"186","isActive":"Y","atrSpaCityDistrictId":"00D17209F8F25F6D4A00011302","atrSpaCitieDistrict":{"cityDistrict":"","isActive":"1","atrSpaClassLegends":null,"id":"00D17209F8F25F6D4A00011302"},"id":"00D1748B8DA0A0B35200011202"}]
Hi,
I have a master page and content page in my application.
There is a ragdrid in content page, when i expand radgrid detail table page is refresing i cant handled it.
But, i try same code in page without site.master page and works well.
There is code sample:
MASTER PAGE:
..
<body>
<form id="Form1" runat="server">
<telerik:RadScriptManager runat="server" ID="RadScriptManager1">
</telerik:RadScriptManager>
<asp:ContentPlaceHolder ID="MainContent" runat="server" />
<uc1:LeftMenu ID="cntLeftMenu" runat="server" />
<asp:Literal ID="mySiteLiteral" runat="server"></asp:Literal>
</form>
</body>
CONTENT PAGE:
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
CodeBehind="TaskMonitor.aspx.cs" Inherits="F8.ReportServer.Pages.TaskMonitor" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
<style>
body > div.RadGrid {
border: 0 none;
background: transparent;
}
body > div table.rgMasterTable {
border-collapse: separate !important;
}
body > div table.rgMasterTable th {
border: 1px solid #4e75b3 !important;
}
</style>
<div class="main-menu-top-bar">
<table border="0" cellpadding="3" cellspacing="0" width="100%">
<tbody>
<tr>
<td style="width: 75%; padding-left: 30px; height: 30px;" align="left" valign="middle">
<span style="color: rgb(136, 136, 136); font-size: 21px; font-weight: bold">Task Monitor</span>
</td>
</tr>
</tbody>
</table>
</div>
<div class="content-div">
<asp:HiddenField ID="hidden_ReportId" runat="server" />
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td style="width: 100%;" valign="top">
<div class="project-header">
<div class="project-inner-noimage" style="margin: 0px 10px 35px 15px !important">
<telerik:RadFormDecorator RenderMode="Lightweight" runat="server" DecorationZoneID="rdGrid" DecoratedControls="All" EnableRoundedCorners="false" />
<telerik:RadSkinManager ID="RadSkinManager1" runat="server" ShowChooser="false" Skin="Silk" />
<%-- Grid wrapper--%>
<div id="rdGrid">
<telerik:RadAjaxPanel ID="radajaxpanel1" runat="server">
<telerik:RadGrid
Font-Size="Small"
RenderMode="Lightweight"
ID="RadGrid1"
Culture="tr-TR"
AllowFilteringByColumn="True"
runat="server"
EnableHeaderContextMenu="True"
EnableHeaderContextFilterMenu="True"
ClientSettings-Resizing-AllowResizeToFit="true"
AllowPaging="True"
PagerStyle-AlwaysVisible="true"
AllowSorting="True"
ShowStatusBar="True"
AutoGenerateColumns="False"
AllowMultiRowSelection="True"
EnableLinqExpressions="False"
FooterStyle-Font-Size="Smaller"
OnItemDataBound="RadGrid1_ItemDataBound"
OnNeedDataSource="RadGrid1_NeedDataSource"
ShowFooter="True"
OnDeleteCommand="RadGrid1_DeleteCommand"
ShowGroupPanel="True"
OnDetailTableDataBind="RadGrid1_DetailTableDataBind">
<GroupingSettings CollapseAllTooltip="Collapse all groups" />
<ExportSettings>
<Pdf PageWidth="">
</Pdf>
</ExportSettings>
<ClientSettings AllowDragToGroup="True" EnableRowHoverStyle="true">
<Selecting AllowRowSelect="True" />
<Resizing AllowResizeToFit="True" />
</ClientSettings>
<MasterTableView Font-Size="Smaller" AutoGenerateColumns="false" CommandItemDisplay="Top" DataKeyNames="TASK_ID,ROWSTATE,HAVE_SUB_TASK_ERROR" Name="MasterTable" PageSize="20">
<HeaderStyle Width="70px" />
<%-- <GroupByExpressions>
<telerik:GridGroupByExpression>
<SelectFields>
<telerik:GridGroupByField FieldAlias="CATEGORY" FieldName="CATEGORY"></telerik:GridGroupByField>
</SelectFields>
<GroupByFields>
<telerik:GridGroupByField FieldName="CATEGORY" SortOrder="Descending"></telerik:GridGroupByField>
</GroupByFields>
</telerik:GridGroupByExpression>
</GroupByExpressions>--%>
<CommandItemTemplate>
<script type="text/javascript">
function AddNewClicking(button, args) {
window.location = button.get_navigateUrl();
args.set_cancel(true);
}
function ConfirmBox(button, args) {
return confirm("Are you sure to delete ?");
}
</script>
<table width="100%">
<tr>
<td width="30%">
<telerik:RadButton ID="rdAddNew" runat="server" NavigateUrl="AddNewSchedule.aspx" OnClientClicking="AddNewClicking" RenderMode="Lightweight" Text="Add New">
<Icon PrimaryIconCssClass="rbAdd" />
</telerik:RadButton>
<telerik:RadButton ID="rdDeleteSelectedTask" runat="server" OnClick="rdDeleteSelectedTask_Click" OnClientClicking="ConfirmBox" RenderMode="Lightweight" Text="Delete Selected">
<Icon PrimaryIconCssClass="rbRemove" />
</telerik:RadButton>
<telerik:RadButton ID="rdShowAllList" runat="server" Visible='<%# QueryWhereStr == null ? false:true %>'
OnClick="rdShowAllRecords_Click" RenderMode="Lightweight" Text="Show All Records">
<Icon PrimaryIconCssClass="rbRefresh" />
</telerik:RadButton>
</td>
<td width="40%"></td>
<td width="30%" align="right">
<telerik:RadButton ID="rdRefresh" runat="server" OnClick="rdShowAllRecords_Click" RenderMode="Lightweight" Text="Refresh">
<Icon PrimaryIconCssClass="rbRefresh" />
</telerik:RadButton>
</td>
</tr>
</table>
</CommandItemTemplate>
<DetailTables>
<telerik:GridTableView runat="server" AllowFilteringByColumn="false" AllowMultiRowSelection="True" AllowPaging="true" AutoGenerateColumns="false" DataKeyNames="PARENT_TASK_ID,TASK_ID,ROWSTATE" EnableHierarchyExpandAll="true" Font-Size="Smaller" Name="Detail" ShowFooter="false" Width="100%">
<ParentTableRelation>
<telerik:GridRelationFields DetailKeyField="PARENT_TASK_ID" MasterKeyField="TASK_ID" />
</ParentTableRelation>
<Columns>
<telerik:GridClientSelectColumn FooterStyle-Width="2px" HeaderStyle-Width="2px" ItemStyle-Width="2px" UniqueName="ClientDetailSelectColumn">
<FooterStyle Width="2px" />
<HeaderStyle Width="2px" />
<ItemStyle Width="2px" />
</telerik:GridClientSelectColumn>
<telerik:GridTemplateColumn HeaderText="ID" HeaderStyle-Width="10px" ItemStyle-Width="10px"
FooterStyle-Width="10px" AllowFiltering="false">
<ItemTemplate>
<a href='<%# String.Format("TaskDetail.aspx?TaskId={0}&KullaniciId={1}", Eval("TASK_ID"),Session["KULLANICI_KODU"]) %>'><%#Eval("TASK_ID") %></a>
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn HeaderText="Schedule Name" HeaderStyle-Width="200px" ItemStyle-Width="200px"
FooterStyle-Width="200px" AllowFiltering="true">
<ItemTemplate>
<a href='<%# String.Format("TaskDetail.aspx?TaskId={0}&KullaniciId={1}", Eval("TASK_ID"),Session["KULLANICI_KODU"]) %>'><%#Eval("SCHEDULE_NAME") %></a>
</ItemTemplate>
</telerik:GridTemplateColumn>
<%--<telerik:GridDateTimeColumn AllowFiltering="false" AllowSorting="true" AutoPostBackOnFilter="true" CurrentFilterFunction="StartsWith" DataField="REF1" DataFormatString="{0:dd.MM.yyyy hh:mm}" Display="true" FilterCheckListEnableLoadOnDemand="true" FilterControlAltText="" FilterControlWidth="20px" HeaderStyle-Height="5px" HeaderStyle-Width="20px" HeaderText="Ref 1" SortExpression="REF1" UniqueName="REF1">
<HeaderStyle Height="5px" Width="20px" />
</telerik:GridDateTimeColumn>
<telerik:GridDateTimeColumn AllowFiltering="false" AllowSorting="true" AutoPostBackOnFilter="true" CurrentFilterFunction="StartsWith" DataField="REF2" DataFormatString="{0:dd.MM.yyyy hh:mm}" Display="true" FilterCheckListEnableLoadOnDemand="true" FilterControlAltText="" FilterControlWidth="20px" HeaderStyle-Height="5px" HeaderStyle-Width="20px" HeaderText="Ref 2" SortExpression="REF2" UniqueName="REF2">
<HeaderStyle Height="5px" Width="20px" />
</telerik:GridDateTimeColumn>
<telerik:GridDateTimeColumn AllowFiltering="false" AllowSorting="true" AutoPostBackOnFilter="true" CurrentFilterFunction="StartsWith" DataField="REF3" DataFormatString="{0:dd.MM.yyyy hh:mm}" Display="true" FilterCheckListEnableLoadOnDemand="true" FilterControlAltText="" FilterControlWidth="20px" HeaderStyle-Height="5px" HeaderStyle-Width="20px" HeaderText="Ref 3" SortExpression="REF3" UniqueName="REF3">
<HeaderStyle Height="5px" Width="20px" />
</telerik:GridDateTimeColumn>
<telerik:GridDateTimeColumn AllowFiltering="false" AllowSorting="true" AutoPostBackOnFilter="true" CurrentFilterFunction="StartsWith" DataField="REF4" DataFormatString="{0:dd.MM.yyyy hh:mm}" Display="true" FilterCheckListEnableLoadOnDemand="true" FilterControlAltText="" FilterControlWidth="20px" HeaderStyle-Height="5px" HeaderStyle-Width="20px" HeaderText="Ref 4" SortExpression="REF4" UniqueName="REF4">
<HeaderStyle Height="5px" Width="20px" />
</telerik:GridDateTimeColumn>--%>
<telerik:GridDateTimeColumn AllowFiltering="false" AllowSorting="true" AutoPostBackOnFilter="true" CurrentFilterFunction="StartsWith"
DataField="ROWVERSION" DataFormatString="{0:dd.MM.yyyy hh:mm}" Display="true" FilterCheckListEnableLoadOnDemand="true"
FilterControlAltText="" FilterControlWidth="160px" HeaderStyle-Height="5px" HeaderStyle-Width="160px" HeaderText="Last Modified" SortExpression="ROWVERSION" UniqueName="ROWVERSION">
<HeaderStyle Height="5px" Width="160px" />
</telerik:GridDateTimeColumn>
<telerik:GridBoundColumn AllowSorting="true" AutoPostBackOnFilter="true" CurrentFilterFunction="StartsWith"
DataField="LAST_ERROR" Display="true" FilterCheckListEnableLoadOnDemand="true" FilterControlAltText=""
FilterControlWidth="300px" HeaderStyle-Width="300px" HeaderText="Last Error" ItemStyle-Width="300px" SortExpression="LAST_ERROR"
UniqueName="LAST_ERROR">
<HeaderStyle Width="200px" />
<ItemStyle Width="200px" />
</telerik:GridBoundColumn>
<telerik:GridTemplateColumn HeaderStyle-Width="80px" ItemStyle-Width="80px" AllowFiltering="false"
AllowSorting="false" HeaderText="State" UniqueName="OrderDate">
<HeaderStyle Height="5px" Width="80px" />
<ItemTemplate>
<asp:Image ID="Image1" runat="server" Visible="false" Width="10" />
<asp:Label ID="Label1" runat="server" Text='<%# Eval("ROWSTATE")%>'></asp:Label>
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridButtonColumn ButtonType="ImageButton" CommandName="Delete" ConfirmText="Are you sure to delete this task ?" FilterControlAltText="Filter DeleteColumn column" HeaderStyle-Width="5px" HeaderText="Delete" ItemStyle-Width="5px" Resizable="false" Text="Delete" UniqueName="DeleteDetail">
<HeaderStyle CssClass="rgHeader ButtonColumnHeader" />
<ItemStyle CssClass="ButtonColumn" />
</telerik:GridButtonColumn>
</Columns>
<SortExpressions>
<telerik:GridSortExpression FieldName="PARENT_TASK_ID" />
</SortExpressions>
<PagerStyle AlwaysVisible="True" />
</telerik:GridTableView>
</DetailTables>
<Columns>
<telerik:GridClientSelectColumn FooterStyle-Width="2px" HeaderStyle-Width="2px" ItemStyle-Width="2px" UniqueName="ClientSelectColumn">
<FooterStyle Width="2px" />
<HeaderStyle Width="2px" />
<ItemStyle Width="2px" />
</telerik:GridClientSelectColumn>
<telerik:GridBoundColumn DataField="TASK_ID" HeaderText="TASK_ID" UniqueName="TASK_ID" Visible="false">
</telerik:GridBoundColumn>
<%-- <telerik:GridBoundColumn AllowSorting="true" AutoPostBackOnFilter="true" CurrentFilterFunction="StartsWith" DataField="SCHEDULE_NAME" Display="true" FilterCheckListEnableLoadOnDemand="true" FilterControlAltText="" FilterControlWidth="300px" HeaderStyle-Width="300px" HeaderText="Schedule Name" ItemStyle-Width="300px" SortExpression="SCHEDULE_NAME" UniqueName="SCHEDULE_NAME">
<HeaderStyle Width="300px" />
<ItemStyle Width="300px" />
</telerik:GridBoundColumn>--%>
<telerik:GridTemplateColumn HeaderText="Schedule Name" HeaderStyle-Width="200px" ItemStyle-Width="200px"
FooterStyle-Width="200px" AllowFiltering="true">
<ItemTemplate>
<a href='<%# String.Format("TaskDetail.aspx?TaskId={0}&KullaniciId={1}", Eval("TASK_ID"),Session["KULLANICI_KODU"]) %>'><%#Eval("SCHEDULE_NAME") %></a>
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridBoundColumn AllowFiltering="true" AllowSorting="true" AutoPostBackOnFilter="true" CurrentFilterFunction="StartsWith"
DataField="NAME" Display="true" FilterCheckListEnableLoadOnDemand="true" FilterControlAltText="" HeaderStyle-Width="150px"
HeaderText="Name" SortExpression="NAME" UniqueName="NAME">
<HeaderStyle Width="150px" />
</telerik:GridBoundColumn>
<telerik:GridBoundColumn AllowFiltering="false" AllowSorting="true" AutoPostBackOnFilter="true" CurrentFilterFunction="StartsWith" DataField="CHILD_TASK_COUNT" Display="true" FilterCheckListEnableLoadOnDemand="true" FilterControlAltText="" HeaderStyle-Width="30px" HeaderText="Task Count" SortExpression="CHILD_TASK_COUNT" UniqueName="CHILD_TASK_COUNT">
<HeaderStyle Width="30px" />
</telerik:GridBoundColumn>
<telerik:GridBoundColumn AllowFiltering="true" AllowSorting="true" AutoPostBackOnFilter="true" CurrentFilterFunction="StartsWith" DataField="CATEGORY" Display="true" FilterCheckListEnableLoadOnDemand="true" FilterControlAltText="" HeaderStyle-Width="90px" HeaderText="Category" SortExpression="CATEGORY" UniqueName="CATEGORY">
<HeaderStyle Width="90px" />
<FilterTemplate>
<telerik:RadComboBox Width="90px" runat="server"
DropDownAutoWidth="Enabled" AppendDataBoundItems="true"
DataSourceID="SqlCategoryList"
DataTextField="CATEGORY"
DataValueField="CATEGORY" DropDownWidth="90px" OnClientSelectedIndexChanged="categoryChanged"
RenderMode="Lightweight"
SelectedValue='<%# ((GridItem)Container).OwnerTableView.GetColumn("CATEGORY").CurrentFilterValue %>'>
<Items>
<telerik:RadComboBoxItem Text="All" />
</Items>
</telerik:RadComboBox>
<telerik:RadScriptBlock ID="RadScriptBlock3" runat="server">
<script type="text/javascript">
function categoryChanged(sender, args) {
var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");
tableView.filter("CATEGORY", args.get_item().get_value(), "EqualTo");
}
</script>
</telerik:RadScriptBlock>
</FilterTemplate>
</telerik:GridBoundColumn>
<telerik:GridDateTimeColumn AllowFiltering="false" AllowSorting="true" AutoPostBackOnFilter="true" CurrentFilterFunction="StartsWith" DataField="ROWVERSION"
DataFormatString="{0:dd.MM.yyyy hh:mm}" Display="true" FilterCheckListEnableLoadOnDemand="true" FilterControlAltText="" FilterControlWidth="110px"
HeaderStyle-Width="110px" HeaderText="Last Modified" SortExpression="ROWVERSION" UniqueName="ROWVERSION">
<HeaderStyle Width="110px" />
</telerik:GridDateTimeColumn>
<telerik:GridTemplateColumn AllowFiltering="true" AllowSorting="true" HeaderText="State" UniqueName="ROWSTATE">
<HeaderStyle Width="90px" />
<ItemTemplate>
<asp:Image ID="Image1" runat="server" Visible="false" Width="10" />
<asp:Label ID="Label1" runat="server" Text='<%# Eval("ROWSTATE")%>'></asp:Label>
</ItemTemplate>
<FilterTemplate>
<telerik:RadComboBox Width="90px" runat="server"
DropDownAutoWidth="Enabled" AppendDataBoundItems="true"
DataSourceID="SqlRowStateList"
DataTextField="ROWSTATE"
DataValueField="ROWSTATE" DropDownWidth="90px" OnClientSelectedIndexChanged="rowstateChanged"
RenderMode="Lightweight"
SelectedValue='<%# ((GridItem)Container).OwnerTableView.GetColumn("ROWSTATE").CurrentFilterValue %>'>
<Items>
<telerik:RadComboBoxItem Text="All" />
</Items>
</telerik:RadComboBox>
<telerik:RadScriptBlock ID="RadScriptBlock4" runat="server">
<script type="text/javascript">
function rowstateChanged(sender, args) {
var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");
tableView.filter("ROWSTATE", args.get_item().get_value(), "EqualTo");
}
</script>
</telerik:RadScriptBlock>
</FilterTemplate>
</telerik:GridTemplateColumn>
<telerik:GridButtonColumn ButtonType="ImageButton" CommandName="Delete" ConfirmText="Are you sure to delete this schedule ?" FilterControlAltText="Filter DeleteColumn column" HeaderStyle-Width="5px" HeaderText="Delete" ItemStyle-Width="5px" Resizable="false" Text="Delete" UniqueName="DeleteColumn">
<HeaderStyle CssClass="rgHeader ButtonColumnHeader" />
<ItemStyle CssClass="ButtonColumn" />
</telerik:GridButtonColumn>
</Columns>
<PagerStyle AlwaysVisible="True" />
</MasterTableView>
<FooterStyle Font-Size="Smaller" />
<PagerStyle AlwaysVisible="True" />
<FilterMenu RenderMode="Lightweight">
</FilterMenu>
<HeaderContextMenu RenderMode="Lightweight">
</HeaderContextMenu>
</telerik:RadGrid>
</telerik:RadAjaxPanel>
<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" BackgroundPosition="Center" runat="server" Transparency="70">
</telerik:RadAjaxLoadingPanel>
</div>
<telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server">
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="RadGrid1">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManagerProxy>
<asp:SqlDataSource ID="MyDataSource" runat="server" ProviderName="System.Data.OracleClient"
SelectCommand=""></asp:SqlDataSource>
<asp:SqlDataSource ID="SqlRowStateList" runat="server" ProviderName="System.Data.OracleClient"
SelectCommand="SELECT distinct a.rowstate FROM IFSAPP.F8RS_TASK_QRY a where a.parent_task_id is null"></asp:SqlDataSource>
<asp:SqlDataSource ID="SqlCategoryList" runat="server" ProviderName="System.Data.OracleClient"
SelectCommand="SELECT distinct a.category FROM IFSAPP.F8RS_TASK_QRY a where a.category is not null"></asp:SqlDataSource>
</div>
</div>
</td>
</tr>
</table>
</div>
<script runat="server">
#region Load
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
LoadGrid();
}
}
protected void rdShowAllRecords_Click(object sender, EventArgs e)
{
RadGrid1.MasterTableView.SortExpressions.Clear();
RadGrid1.MasterTableView.GroupByExpressions.Clear();
Response.Redirect(Request.CurrentExecutionFilePath);
}
protected void rdDeleteSelectedTask_Click(object sender, EventArgs e)
{
bool hasError = false;
foreach (GridDataItem dataItem in RadGrid1.SelectedItems)//To loop through all selected rows
{
int index = dataItem.ItemIndex;// Get Row Index
try
{
string id = Convert.ToString(dataItem.GetDataKeyValue("TASK_ID"));
F8.ReportServer.DLL.DbSchema.F8BaseSchema.TaskCls.DeleteTask(Convert.ToDouble(id));
}
catch (Exception x)
{
F8.Logger.Instance.Error("Tasklist re-run error: " + x.Message);
F8.ReportServer.fn.ShowAlert(x.Message, F8.ReportServer.fn.MessageType.ERROR);
hasError = true;
break;
}
}
if (!hasError && RadGrid1.SelectedItems.Count > 0)
{
F8.ReportServer.fn.ShowAlert("All selected task(s) have been deleted!", F8.ReportServer.fn.MessageType.SUCCESS);
}
LoadGrid();
RadGrid1.MasterTableView.SortExpressions.Clear();
RadGrid1.MasterTableView.GroupByExpressions.Clear();
RadGrid1.Rebind();
}
protected void RadGrid1_DetailTableDataBind(object source, Telerik.Web.UI.GridDetailTableDataBindEventArgs e)
{
GridDataItem dataItem = (GridDataItem)e.DetailTableView.ParentItem;
switch (e.DetailTableView.Name)
{
case "Detail":
{
F8.ReportServer.DLL.DbSchema.F8BaseSchema.TaskCls List = new F8.ReportServer.DLL.DbSchema.F8BaseSchema.TaskCls();
string taskid = dataItem.GetDataKeyValue("TASK_ID").ToString();
e.DetailTableView.DataSource = List.GetListUnderMainTask(taskid);
break;
}
}
}
public void LoadGrid()
{
F8.ReportServer.DLL.DbSchema.F8BaseSchema.TaskCls List = new F8.ReportServer.DLL.DbSchema.F8BaseSchema.TaskCls();
MyDataSource.ConnectionString =
SqlRowStateList.ConnectionString =
SqlCategoryList.ConnectionString =
F8.ReportServer.DLL.DbSchema.F8BaseDb.ConnStr;
RadGrid1.DataSource = List.GetListOfMainTask(QueryWhereStr);
}
#endregion
#region Telerik
protected void RadGrid1_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
{
LoadGrid();
}
#endregion
#region Property
public string SessionID
{
get
{
if (Session["SESSIONID"] != null)
{
return Session["SESSIONID"].ToString();
}
else return null;
}
}
#endregion
protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
{
if (e.Item is GridGroupHeaderItem)
{
GridGroupHeaderItem item = (GridGroupHeaderItem)e.Item;
System.Data.DataRowView groupDataRow = (System.Data.DataRowView)e.Item.DataItem;
if (item.DataCell.Text.Contains(':'))
{
item.DataCell.Text = string.Format(" {0}: <b>{1}</b>", item.DataCell.Text.Split(':')[0], item.DataCell.Text.Split(':')[1]);
}
}
if (e.Item is GridDataItem && !e.Item.IsInEditMode)
{
GridDataItem itm = e.Item as GridDataItem;
System.Globalization.TextInfo textInfo = new System.Globalization.CultureInfo("tr-TR", false).TextInfo;
//checking for the column in MasterTableView
if (itm.OwnerTableView.Name == "MasterTable")
{
itm["NAME"].Text = textInfo.ToTitleCase(itm["NAME"].Text.ToLowerInvariant()); //War And Peace
if (itm["NAME"].Text.Length > 100)
{
itm["NAME"].ToolTip = itm["NAME"].Text;
itm["NAME"].Text = itm["NAME"].Text.Substring(0, 100);
}
}
if (itm.OwnerTableView.Name == "Detail")
{
if (itm["LAST_ERROR"].Text.Length > 150)
{
itm["LAST_ERROR"].ToolTip = itm["LAST_ERROR"].Text;
itm["LAST_ERROR"].Text = itm["LAST_ERROR"].Text.Substring(0, 150);
}
}
// change image
if (e.Item is GridDataItem)
{
GridDataItem item = e.Item as GridDataItem;
System.Web.UI.WebControls.Image img = (System.Web.UI.WebControls.Image)item.FindControl("Image1");
var val = Convert.ToString(item.GetDataKeyValue("ROWSTATE"));
var HaveError = Convert.ToBoolean(item.GetDataKeyValue("HAVE_SUB_TASK_ERROR"));
img.Visible = true;
switch (val)
{
case "Delivered":
case "JobCompleted":
img.ImageUrl = !HaveError ? "~/images/circle-green.gif" : "~/images/circle-red.gif";
break;
case "Error":
img.ImageUrl = "~/images/circle-red.gif";
break;
case "Ordered":
img.ImageUrl = "~/images/circle-ordered.gif";
break;
default:
img.ImageUrl = "~/images/circle-gray.gif";
break;
}
}
}
}
protected void RadGrid1_DeleteCommand(object sender, GridCommandEventArgs e)
{
GridDataItem item = e.Item as GridDataItem;
try
{
string id = Convert.ToString(item.GetDataKeyValue("TASK_ID"));
F8.ReportServer.DLL.DbSchema.F8BaseSchema.TaskCls.DeleteTask(Convert.ToDouble(id));
LoadGrid();
F8.ReportServer.fn.ShowAlert(F8.ReportServer.fn.MessageText.DELETED, F8.ReportServer.fn.MessageType.SUCCESS);
}
catch (Exception x)
{
F8.ReportServer.fn.ShowAlert(x.Message, F8.ReportServer.fn.MessageType.ERROR);
}
}
public string QueryWhereStr
{
get
{
if (Convert.ToString(Request.QueryString["Whr"]) != string.Empty)
{
return Convert.ToString(Request.QueryString["Whr"]);
}
return string.Empty;
}
set { ; }
}
</script>
</asp:Content>
I am using telerik asp.net version 2014.2.618.35
I am using RadMenu which shows in Classic mode in desktop browser and in Mobile mode in mobile browser.
I am adding items to RadMenu at runtime and setting the CssClass property of RadMenuItem. In Classic mode it adds the css class to anchor tag <a> whereas in Mobile mode it adds the css class to list item tag <li>.
Is it possible to set the css class of anchor tag in Mobile mode?
The reason for adding a css class ("animsition-link") is to use Animsition jquery plugin for animated page transitions.
Thanks