Hi There,
I have a RadGrid with CheckBox column turned on. When click on the white space beside the check box, all other selected columns change to unselected. Is there a way to turn off this feature? Is it possible that it only select the column without affecting other selected columns? Please help. Thank you.
Here is the telerik demo link:
http://demos.telerik.com/aspnet-ajax/grid/examples/columns-rows/columns/column-types/defaultcs.aspx
Best regards,
Meng
Hello,
I have a problem when I use the LocalizationPath, because these not taken the content that I define in my file resource. I´ve defined the gantt chart from code.
Here my code C#
private void agregarColumna(string DataField, string Header, int tamano, RadGantt ctrlGantt){ GanttBoundColumn gbc = new GanttBoundColumn(); gbc.DataField = DataField; gbc.HeaderText = Header; gbc.Width = Unit.Pixel(tamano); ctrlGantt.Columns.Add(gbc);}private void CargarGraficoGantt(DataTable dtGantt){ RadGantt rgGantt = new RadGantt(); rgGantt.ID = "GraficoGantt"; rgGantt.SnapToGrid = false; rgGantt.ReadOnly = true; rgGantt.AllowSorting = false; rgGantt.SelectedView = GanttViewType.MonthView; rgGantt.AutoGenerateColumns = false; rgGantt.EnableViewState = true; rgGantt.EnablePdfExport = true; rgGantt.Culture = System.Globalization.CultureInfo.CreateSpecificCulture("es-ES");
//rgGantt.LocalizationPath = "App_LocalResources/"; //rgGantt.Width = Unit.Percentage(100.0); //rgGantt.Height = Unit.Percentage(100.0); //Columnas agregarColumna("ID", "Id", 50, rgGantt); agregarColumna("Title", "Tareas a Desarrollar", 350, rgGantt); agregarColumna("PercentComplete", "Porcentaje", 80, rgGantt); rgGantt.DataBindings.TasksDataBindings.IdField = "ID"; rgGantt.DataBindings.TasksDataBindings.TitleField = "Subject"; rgGantt.DataBindings.TasksDataBindings.StartField = "Start"; rgGantt.DataBindings.TasksDataBindings.EndField = "End"; rgGantt.DataBindings.TasksDataBindings.ParentIdField = "ParentID"; rgGantt.DataBindings.TasksDataBindings.SummaryField = "summary"; rgGantt.DataBindings.TasksDataBindings.PercentCompleteField = "PercentComplete"; rgGantt.DataSource = dtGantt; rgGantt.Skin = "Bootstrap"; rgGantt.DataBind(); divGantt.Controls.Add(rgGantt);}protected void Page_Load(object sender, EventArgs e){ if (!IsPostBack) { DataTable tasks = new DataTable(); tasks.Columns.Add(new DataColumn("ID", typeof(int))); tasks.Columns.Add(new DataColumn("ParentID", typeof(int))); tasks.Columns.Add(new DataColumn("Subject", typeof(string))); tasks.Columns.Add(new DataColumn("Summary", typeof(bool))); tasks.Columns.Add(new DataColumn("PercentComplete", typeof(decimal))); tasks.Columns.Add(new DataColumn("Start", typeof(DateTime))); tasks.Columns.Add(new DataColumn("End", typeof(DateTime))); tasks.Rows.Add(1, null, "Defining selection", false, 0.1, new DateTime(2015, 8, 2), new DateTime(2015, 9, 4)); tasks.Rows.Add(2, null, "Researching the market for candidates", true, 0, new DateTime(2015, 8, 3), new DateTime(2015, 8, 15)); tasks.Rows.Add(3, 2, "Advertising the position", false, 0.3, new DateTime(2015, 8, 10), new DateTime(2015, 8, 15)); tasks.Rows.Add(4, 2, "Collecting job applications", false, 0.5, new DateTime(2015, 8, 10), new DateTime(2015, 8, 15)); tasks.Rows.Add(5, null, "Categorizing applications", false, 0.5, new DateTime(2015, 8, 17), new DateTime(2015, 8, 22)); tasks.Rows.Add(6, null, "Assessing applicants", true, 0, new DateTime(2015, 8, 19), new DateTime(2015, 8, 31)); tasks.Rows.Add(7, 6, "Interview with Human Resources representatives", false, 0.2, new DateTime(2015, 8, 24), new DateTime(2015, 8, 26)); tasks.Rows.Add(8, 6, "Asigning and reviewing a sample test task", false, 0.2, new DateTime(2015, 8, 24), new DateTime(2015, 8, 27)); tasks.Rows.Add(9, 6, "Interview with Development representatives", false, 0.6, new DateTime(2015, 8, 26), new DateTime(2015, 8, 28)); tasks.Rows.Add(10, null, "Creating and proposing the job offer", false, 0.7, new DateTime(2015, 8, 27), new DateTime(2015, 8, 29)); tasks.Rows.Add(11, null, "Hiring applicant", false, 0.4, new DateTime(2015, 8, 25), new DateTime(2015, 8, 31)); rgDemo.DataSource = tasks; rgDemo.AutoGenerateColumns = true; rgDemo.Skin = "Bootstrap"; rgDemo.MasterTableView.DataKeyNames = new string[] {"ID"}; //Gant this.CargarGraficoGantt(tasks); }}
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="wfDemo.aspx.cs" Inherits="testTelerik.wfDemo" %><%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI.Gantt" tagprefix="cc1" %><!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <!--Grid--> <link href="css/Glow/Grid.Glow.css" rel="stylesheet" /> <link href="css/Bootstrap/Grid.Bootstrap.css" rel="stylesheet" /> <!--Gantt--> <link href="css/Glow/Ajax.Glow.css" rel="stylesheet" /> <link href="css/Glow/Gantt.Glow.css" rel="stylesheet" /> <link href="css/Glow/Input.Glow.css" rel="stylesheet" /> <link href="css/Bootstrap/TabStrip.Bootstrap.css" rel="stylesheet" /> <link href="css/Bootstrap/Input.Bootstrap.css" rel="stylesheet" /> <link href="css/Bootstrap/Gantt.Bootstrap.css" rel="stylesheet" /> <!--Scheduler--> <link href="css/Bootstrap/Calendar.Bootstrap.css" rel="stylesheet" /> <link href="css/Bootstrap/Scheduler.Bootstrap.css" rel="stylesheet" /> <link href="css/Bootstrap/SchedulerRecurrenceEditor.Bootstrap.css" rel="stylesheet" /> <link href="css/Bootstrap/SchedulerReminderDialog.Bootstrap.css" rel="stylesheet" /> <link href="css/Bootstrap/Window.Bootstrap.css" rel="stylesheet" /> <link href="css/Bootstrap/Menu.Bootstrap.css" rel="stylesheet" /> <title></title> <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script></head><body> <form id="form1" runat="server"> <telerik:radscriptmanager runat="server"></telerik:radscriptmanager> <telerik:RadAjaxLoadingPanel ID="ralpGantt" runat="server" Skin="Glow"></telerik:RadAjaxLoadingPanel> <div class="container" id="divContenedor" runat="server"> <ul class="nav nav-pills"> <li class="active"><a data-toggle="tab" href="#divGrid">Grid</a></li> <li><a data-toggle="tab" href="#divGantt">Gantt</a></li> </ul> <div class="tab-content"> <div id="divGrid" class="tab-pane fade" runat="server"> <telerik:radgrid ID="rgDemo" runat="server"></telerik:radgrid> </div> <div id="divGantt" runat="server" class="tab-pane fade in active"> </div> </div> </div> <telerik:radcodeblock runat="server"> <script src="jquery.loadmask.js"></script> <script src="bootstrap-remote-tabs.js"></script> </telerik:radcodeblock> </form></body></html>But if I enabled this line
rgGantt.LocalizationPath = "App_LocalResources/";The content gantt chart does not shows.
What is wrong in my code?
I am having a problem getting a Live Tile to access a OData Web Service that return the following when called from a web browser when called with the following URL http://XXX.com/TService1/TileService.svc/GetLiveTileListData?tnMasterID=32
<?xml version="1.0" encoding="UTF-8"?>
-<GetLiveTileListData xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices">
-<element m:type="OrderPageModel.GetLiveTileListData_Result1">
<nOrder m:type="Edm.Int32">3</nOrder>
<nUniverse m:type="Edm.Int32">666</nUniverse>
</element>
</GetLiveTileListData>
GetLiveTileListData is a imported stored procedure.
When I use the RadODataSource Configuration wizard nothing appears in the select Model list. If I change the service URL to http://XXX.com/tService1/TileService.svc/ only the Entity's appear, not the stored procedures.
I have been searching the internet for a way to map the stored procedure to an entity, but have had no success as I am new to the entity Framework and OData.
If you can help or point me in the right direction it would be greatly appreciated.

Hi,
Here's my scenario.
I have a diagram (3rd party control) and when a user selects a shape I want to highlight its properties in a toolbar (Telerik), which is also used to set the properties. So it needs to serve a dual purpose.
In particular, I need the appropriate RadToolBarButton item to be selected/highlighted in the RadToolBarSplitButton dropdowns. The value and image associated with the split button itself must not change.
For example, we have a splitbutton that allows the user to select the line style.
If the user selects a line, they would then open the dropdown to see what style had been applied to that line. The "button" would continue to show the last style that was selected and would apply that style should the user click it.
I hope that's clear.
Here's my declaration of the splitbutton:
<telerik:RadToolBarSplitButton runat="server" Value="#style#1#5 0" ToolTip="Connector Style" EnableDefaultButton="False" ImageUrl="Images/Navvia/line-1px.png"> <Buttons> <telerik:RadToolBarButton runat="server" Text="Thin Solid" Value="#style#1#5 0" ImageUrl="Images/Navvia/line-1px.png" Width="130px"> </telerik:RadToolBarButton> <telerik:RadToolBarButton runat="server" Text="Thin Dotted" Value="#style#1#3 3" ImageUrl="Images/Navvia/dotted-1px.png"> </telerik:RadToolBarButton> <telerik:RadToolBarButton runat="server" Text="Thin Dashed" Value="#style#1#7 7" ImageUrl="Images/Navvia/dashed-1px.png"> </telerik:RadToolBarButton> <telerik:RadToolBarButton runat="server" Text="Medium Solid" Value="#style#3#5 0" ImageUrl="Images/Navvia/line-3px.png"> </telerik:RadToolBarButton> <telerik:RadToolBarButton runat="server" Text="Medium Dotted" Value="#style#3#3 3" ImageUrl="Images/Navvia/dotted-3px.png"> </telerik:RadToolBarButton> <telerik:RadToolBarButton runat="server" Text="Medium Dashed" Value="#style#3#7 7" ImageUrl="Images/Navvia/dashed-3px.png"> </telerik:RadToolBarButton> <telerik:RadToolBarButton runat="server" Text="Thick Solid" Value="#style#5#5 0" ImageUrl="Images/Navvia/line-5px.png"> </telerik:RadToolBarButton> <telerik:RadToolBarButton runat="server" Text="Thick Dotted" Value="#style#5#3 3" ImageUrl="Images/Navvia/dotted-5px.png"> </telerik:RadToolBarButton> <telerik:RadToolBarButton runat="server" Text="Thick Dashed" Value="#style#5#7 7" ImageUrl="Images/Navvia/dashed-5px.png"> </telerik:RadToolBarButton> </Buttons></telerik:RadToolBarSplitButton>
I've tried locating the button to highlight using the following (without success):
function SetSelectedConnectorStyle() { var toolbar1 = $find("<%=RadToolBar1.ClientID%>") var connStyleButton = toolbar1.findItemByValue("#style#5#3 3"); connStyleButton.check();}The above finds the button, but checking it does not show any visual indication that it is selected when the dropdown is expanded.
Any suggestions?
Thanks in advance for any assistance.
Jim
I am trying to use the RadLiveTiles to display data from an oDataDataSource. If I create a different data source for each tile and set the OnClientDataLoading to a different function that sets the filter with the correct parameters for each tile everything works fine.
Since I will have many tiles I found this in your documentation
"Another option is to change the filter in the OnClientDataLoading event, because the event arguments expose the data source arguments. Essentially, the logic is the same, but you can apply filters per LiveTile (e.g., by using different OnClientDataLoading event handlers, see Example 8) and use the same ODataDataSource control."
However when I try this it is not working. The first tile works fine, but when the 2nd fires, it first calls the first over again, then the second, and the data returned is from the first. When the 3rd tile fires it again calls the 1st, then the 2nd then the 3rd and the data is the first when first initialized. When the first update interval occurs all tiles refresh at the same time, again with the data all being from the first tile
This is the code I am using
<script type="text/javascript">
function OnClientDataLoading(sender, args) {
alert("1")
args.get_value().filter.filters.push({
field: "MasterID",
operator: "eq",
value: 32
});
}
function OnClientDataLoading1(sender, args) {
alert("2")
args.get_value().filter.filters.push({
field: "MasterID",
operator: "eq",
value: 64
});
}
function OnClientDataLoading2(sender, args) {
alert("3")
args.get_value().filter.filters.push({
field: "MasterID",
operator: "eq",
value: 44
});
}
</script>
<form id="form1" runat="server">
<div>
<telerik:RadScriptManager ID="RadScriptManager1" runat="server" EnableTheming="True" />
</div>
<div>
<telerik:RadODataDataSource runat="server" ID="RadODataDataSource1">
<Transport Read-DataType="JSONP">
<Read Url="http://xxxxxx.com/tService1/TileService.svc/" />
</Transport>
<Schema>
<telerik:DataModel ModelID="opItemLiveTileData" Set="opItemLiveTileDatas">
<telerik:DataModelField FieldName="MasterID" />
<telerik:DataModelField FieldName="nOrders" />
</telerik:DataModel>
</Schema>
</telerik:RadODataDataSource>
<telerik:RadTileList runat="server" ID="RadTileList2" TileRows="4" Width="1300px" SelectionMode="Single" EnableDragAndDrop="false" BackColor="teal" AutoPostBack="false" >
<Groups>
<telerik:TileGroup>
<telerik:RadLiveTile ID="RadLiveTile3" runat="server" ODataDataSourceID="RadODataDataSource1" DataModelID="opItemLiveTileData" UpdateInterval="6000" OnClientDataLoading="OnClientDataLoading" AutoPostBack="false">
<ClientTemplate>
<strong>Loaded from ODataDataSource: </strong><br />
#= MasterID # <br></br> #= nOrders # <br></br>
</ClientTemplate>
</telerik:RadLiveTile>
<telerik:RadLiveTile ID="RadLiveTile1" runat="server" ODataDataSourceID="RadODataDataSource1" DataModelID="opItemLiveTileData" UpdateInterval="9000" OnClientDataLoading="OnClientDataLoading1" AutoPostBack="false">
<ClientTemplate>
<strong>Loaded from ODataDataSource: </strong><br />
#= MasterID # <br></br> #= nOrders # <br></br>
</ClientTemplate>
</telerik:RadLiveTile>
<telerik:RadLiveTile ID="RadLiveTile2" runat="server" ODataDataSourceID="RadODataDataSource1" DataModelID="opItemLiveTileData" UpdateInterval="11000" OnClientDataLoading="OnClientDataLoading2" AutoPostBack="false">
<ClientTemplate>
<strong>Loaded from ODataDataSource: </strong><br />
#= MasterID # <br></br> #= nOrders # <br></br>
</ClientTemplate>
</telerik:RadLiveTile>
</telerik:TileGroup>
</Groups>
</telerik:RadTileList>
<script type="text/javascript">
</script>
</div>
</form>
Any help would be greatly appreciated as my only alternative is to create a datasource for each tile.

<telerik:RadGrid ID="grdtest" ShowStatusBar="true" runat="server" AllowPaging="True" ShowFooter="true" AllowMultiRowEdit="true" GridLines="Both" AutoGenerateColumns="false" PageSize="100" Width="500px" HorizontalAlign="NotSet" OnNeedDataSource="GridDataSource"> <MasterTableView AutoGenerateColumns="False" DataKeyNames="RowID" EditMode="InPlace"> <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column"> </RowIndicatorColumn> <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column"> </ExpandCollapseColumn> <Columns> <telerik:GridTemplateColumn DataField="DateOfService" HeaderText="DOS" UniqueName="ServiceDate"> <ItemTemplate> <telerik:RadDatePicker ID="dtPicker" runat="server" Width="100px" DatePopupButton-Visible="false" ShowPopupOnFocus="true" DbSelectedDate='<%# Bind("DateOfService") %>'> <DateInput runat="server" DateFormat="MM/dd/yyyy" EmptyMessage="MM/dd/yyyy" Width="80px"> <%--<ClientEvents OnValueChanged="ValueChanged" OnBlur="ValueChanged" />--%> </DateInput> </telerik:RadDatePicker> </ItemTemplate> </telerik:GridTemplateColumn>
</columns>
....
....
....
This grid always remain in inline edit mode. When user types in value directly in date picker control instead of selecting and tabls out it does not hide popup. Can you help me providing proper solution for this problem?

Hi,
I am using version 2015.1.401.40 of your asp.net for ajax controls.
I've never used the PivotGrid, but I am experimenting with it now and I don't see any data after binding it.
Here is the markup of the grid:
<telerik:RadPivotGrid ID="AlertsRadPivotGrid" runat="server">
<Fields>
<telerik:PivotGridColumnField DataField="AlertLevel" UniqueName="AlertLevel" />
<telerik:PivotGridRowField DataField="SupplierCompanyName" UniqueName="SupplierCompanyName" />
<telerik:PivotGridAggregateField DataField="AlertID" UniqueName="AlertID" Aggregate="Count" />
</Fields>
</telerik:RadPivotGrid>
Here is my code:
Private Sub AlertsRadPivotGrid_NeedDataSource(sender As Object, e As Telerik.Web.UI.PivotGridNeedDataSourceEventArgs) Handles AlertsRadPivotGrid.NeedDataSource
Dim scAlerts As List(Of SupplierAlert)
Dim scAlertList As SupplierAlertList = New SupplierAlertList
scAlerts = scAlertList.GetHarmonyAlertDetailsData("129052", 8939, New Date(2015, 3, 1), New Date(2015, 10, 1), SessUserCultureCode)
AlertsRadPivotGrid.DataSource = scAlerts
End Sub
So, I'm binding to a Generic List of a strongly typed object (class) that I've created. When the code runs, the NeedDataSource method runs and the scAlerts object above has 240 SupplierAlert items in it.
I see bind to strongly typed lists, so I assume it is possible.
When I run it I see a PivotGrid with my column and row, but there is no data / detail displayed.
Am I doing something wrong?
AlertLevel is an integer
SupplierCompanyID is a string
AlertID is an integer
There are no nulls in any of my data.
Thanks,
Brent

Hi, I have a page (SiteScheduler.aspx) with a RadGrid and a RadScheduler on it and I followed the online examples of how to drag and drop rows from the RadGrid to the RadScheduler - and it works perfectly. I wired up a RadWindow to open from a ContextMenu - and the RadWindow, which is modal and appears over SiteScheduler.aspx, allows the user to change the assigned staff person to the appointment in the scheduler. Here again, that functionality works great. My staff person reassignment correction is made. When the RadWindow closes, it executes document.location.reload() to refresh SiteScheduler.aspx.
My problem I ran into yesterday and still today is that if I had dragged a row from the RadGrid to the Scheduler prior to right clicking and open the RadWindow to reassign the staff person, the RadGrid1_RowDrop event is executed again on the document.location.reload() (or F5 for that matter). This causes an incorrectly scheduled staff person. It's like the RowDrop is still 'remembering' the prior drop action and even the same row that was dragged before to the RadWindow opening.
If I do not drag a row from the grid to the scheduler before right clicking to open the RadWindow to reassign the staff person, the RadGrid1_RowDrop event is not executed and it works as required.
Here are a couple of things I tried:
1. Thought it might be cache related so I turned off client side caching by placing this in Page_load
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.Cache.SetExpires(DateTime.Now);
Response.Cache.SetNoServerCaching();
Response.Cache.SetNoStore();
2. Because of the way the page works , I had to set EnableAJAX="False" in the RadAjaxManager. I would love to be able refresh just the scheduler but don't know how to do this with EnableAJAX="False" being set.
3. I tried to simulate the click event of a button that refreshes and rebinds the scheduler however the button does not exist in the RadWindow close event (as the form's controls are not present yet) so it does not work.
Is there something I am missing or do you have any suggestions? Is there a way to 'Cancel' or dispose of the prior RadGrid RowDrop event once it is complete so it is not executed again?
Here is my RadGrid definition if it helps:
<telerik:RadGrid runat="server" ID="RadGrid1" Skin="Metro" Style="border: none; outline: 0;"
AllowAutomaticInserts="True" AllowAutomaticUpdates="True" Height="800px"
AllowAutomaticDeletes="True" MasterTableView-DataKeyNames="StaffId" OnItemCommand="RadGrid1_ItemCommand"
OnItemCreated="RadGrid1_ItemCreated" OnRowDrop="RadGrid1_RowDrop" OnRowDropped="RadGrid1_RowDropped" AutoGenerateColumns="False" PageSize="30" RenderMode="Lightweight" Width="100%"
RetainExpandStateOnRebind="True" ClientSettings-AllowAutoScrollOnDragDrop="False">
<ClientSettings AllowRowsDragDrop="True">
<Selecting AllowRowSelect="True"></Selecting>
<ClientEvents OnRowDropping="rowDropping" OnRowDblClick="onRowDoubleClick"></ClientEvents>
<Scrolling AllowScroll="True" ScrollHeight="800px" UseStaticHeaders="True" />
</ClientSettings>
<MasterTableView DataKeyNames="StaffId" RetainExpandStateOnRebind="True">
<RowIndicatorColumn Visible="False">
</RowIndicatorColumn>
<Columns>
<telerik:GridBoundColumn DataField="StaffFullName" FilterControlAltText="Filter colStaffname column" Groupable="False" HeaderText="Staff Name" ReadOnly="True" Reorderable="False" UniqueName="colStaffname" HeaderTooltip="skdj">
</telerik:GridBoundColumn>
</Columns>
</MasterTableView>
<FilterMenu RenderMode="Lightweight"></FilterMenu>
<HeaderContextMenu RenderMode="Lightweight"></HeaderContextMenu>
</telerik:RadGrid>
Thanks for any help you can provide.
Shawn
Hi
Please bear with me I'm quite new to Teleik. My scenario is I have a RadGrid which is built completely in C# code because the columns can vary. Each data bound field is either a link button or a label. For the link button I want to be able to open a child window which contains a RadGrid displaying the drill down data of the selected link button.
This is the code which builds the main RadGrid:
001.private Control DefineGridStructure(DataTable InGrid)002. {003. RadGrid grid = new RadGrid();004. grid.ID = "RadGridDetail";005. grid.DataSource = InGrid;006. grid.Skin = "Outlook";007. grid.Width = Unit.Percentage(100);008. grid.AllowPaging = false;009. grid.AutoGenerateColumns = false;010. grid.MasterTableView.Width = Unit.Percentage(100);011. grid.HeaderStyle.Font.Size = 10;012. grid.HeaderStyle.Font.Bold = true;013. grid.HeaderStyle.HorizontalAlign = HorizontalAlign.Center;014. 015. try016. {017. grid.MasterTableView.DataKeyNames = new string[] { InGrid.Columns[1].ColumnName };018. 019. 020. GridBoundColumn Col1 = new GridBoundColumn();021. Col1.DataField = InGrid.Columns[0].ColumnName;022. //GridBoundColumn Col2 = new GridBoundColumn();023. //Col2.DataField = InGrid.Columns[1].ColumnName;024. 025. if (InGrid.Columns[0].ColumnName == "PDESC")026. {027. Col1.HeaderText = "Problem Description";028. //Col2.HeaderText = "Problem Code";029. }030. else031. {032. Col1.HeaderText = "Region";033. }034. grid.Columns.Add(Col1);035. 036. //Col3 - Query037. GridTemplateColumn Col3 = new GridTemplateColumn();038. Col3.ItemTemplate = new MyTemplate("Query", "£'s Val", "In Qry");039. Col3.HeaderText = "Query";040. grid.Columns.Add(Col3);041. 042. //Col4 - 90D043. GridTemplateColumn Col4 = new GridTemplateColumn();044. Col4.ItemTemplate = new MyTemplate("D90", 4, "lnk");045. Col4.HeaderText = "90+ Days";046. grid.Columns.Add(Col4);047. 048. //Col5 - Month 3049. GridTemplateColumn Col5 = new GridTemplateColumn();050. Col5.ItemTemplate = new MyTemplate("M3", 5, "lnk");051. Col5.HeaderText = Utils.GetMonth(3) + "-" + Utils.GetYear(3);052. grid.Columns.Add(Col5);053. 054. //Col6 - Month 2055. GridTemplateColumn Col6 = new GridTemplateColumn();056. Col6.ItemTemplate = new MyTemplate("M2", 6, "lnk");057. Col6.HeaderText = Utils.GetMonth(2) + "-" + Utils.GetYear(2);058. grid.Columns.Add(Col6);059. 060. //Col7 - Month 1061. GridTemplateColumn Col7 = new GridTemplateColumn();062. Col7.ItemTemplate = new MyTemplate("M1", 7, "lnk");063. Col7.HeaderText = Utils.GetMonth(1) + "-" + Utils.GetYear(1);064. grid.Columns.Add(Col7);065. 066. //*****Building dynamic number of weeks column******067. DataTable NumWeeks = Utils.GetDataTable("SELECT * FROM [dbo].[fn_GetNumWeeks]() ORDER BY intWEEK ASC");068. int numOfWeeks = NumWeeks.Rows.Count;069. 070. for (int i = 1; i < (numOfWeeks + 1); i++)071. {072. int columnNo = 7 + i;073. GridTemplateColumn Cols = new GridTemplateColumn();074. Cols.ItemTemplate = new MyTemplate("Wk" + i, columnNo, "lnk");075. Cols.HeaderText = Utils.GetMonth(0) + "<br/> " + "Week " + i;076. grid.Columns.Add(Cols);077. }078. //*************************************************079. 080. //Col13 - MTD081. GridTemplateColumn Col13 = new GridTemplateColumn();082. Col13.ItemTemplate = new MyTemplate("MTD", 13, "lnk");083. Col13.HeaderText = "MTD";084. grid.Columns.Add(Col13);085. 086. //Col14 - YTD087. GridTemplateColumn Col14 = new GridTemplateColumn();088. Col14.ItemTemplate = new MyTemplate("YTD", 14, "lbl");089. Col14.HeaderText = "YTD";090. grid.Columns.Add(Col14);091. 092. //Col15 - OO/S093. GridTemplateColumn Col15 = new GridTemplateColumn();094. Col15.ItemTemplate = new MyTemplate("OOS", 15, "lbl");095. Col15.HeaderText = "Overall <br/> Outstanding";096. grid.Columns.Add(Col15);097. 098. //Col16 - % OS Vs OV099. GridTemplateColumn Col16 = new GridTemplateColumn();100. Col16.ItemTemplate = new MyTemplate("Pct", 16, "lbl");101. Col16.HeaderText = "% Of Outstanding <br/> Vs Overall";102. grid.Columns.Add(Col16);103. 104. ShowResult.Controls.Add(grid);105. }106. catch107. {108. //No records found.109. }110. return grid;111. 112. }The columns are generated using Templates:
01.Label[] lblVal = new Label[17];02. Label[] lblQty = new Label[17];03. 04. LinkButton[] lnkVal = new LinkButton[17];05. LinkButton[] lnkQty = new LinkButton[17];06. 07. public MyTemplate(string cName, int typeID, string clinkOrLabel)08. {09. ID = typeID;10. templateType = cName;11. colname = cName;12. linkOrLabel = clinkOrLabel;13. Params = 3;14. }And finally, this is the InstantiateIn code which creates the grid and prints it to the screen:
01.public void InstantiateIn(Control container)02. {03. Literal lc = new Literal();04. lc.Text = "<hr style='border: 1px;border-style: dotted;'/>"; 05. 06. if(templateType == "Query")07. {08. Label lblValQ = new Label();09. lblValQ.ID = colname + "Val";10. Label lblQtyQ = new Label();11. lblQtyQ.ID = colname + "Qty";12. lblValQ.Font.Size = 9;13. lblQtyQ.Font.Size = 9;14. 15. if (Params == 3)16. {17. lblValQ.Text = ValCnt;18. lblQtyQ.Text = QtyCnt;19. }20. container.Controls.Add(lblValQ);21. container.Controls.Add(lc);22. container.Controls.Add(lblQtyQ);23. }24. else25. {26. //decided whether the field should be a link button or a label27. if (linkOrLabel == "lnk")28. {29. lnkVal[ID] = new LinkButton();30. lnkVal[ID].DataBinding += lnkVal_DataBinding;31. lnkVal[ID].Attributes.Add("OpenWindow", "openChildWindow(4,31,99);");32. lnkQty[ID] = new LinkButton();33. lnkQty[ID].DataBinding += lnkQty_DataBinding;34. lnkQty[ID].Attributes.Add("OpenWindow", "openChildWindow(4, 31,99);");35. 36. container.Controls.Add(lnkVal[ID]);37. container.Controls.Add(lc);38. container.Controls.Add(lnkQty[ID]);39. }40. else41. {42. lblVal[ID] = new Label();43. lblVal[ID].DataBinding += lblVal_DataBinding;44. lblQty[ID] = new Label();45. lblQty[ID].DataBinding += lblQty_DataBinding; 46. 47. container.Controls.Add(lblVal[ID]);48. container.Controls.Add(lc);49. container.Controls.Add(lblQty[ID]);50. }51. }52. }I am attempting to add Attributes to all the linkbuttons which will send to the javascript displayed below to get the data for the new window.
1.<script type="text/javascript" language="javascript">2. function openChildWindow(Period, SalesMn, intWeek, ReasCode) {3. window.open('RadGridExportWebForm.aspx?Period=' + Period + '&SalesMn=' + escape(SalesMn) + '&intWeek=' + intWeek + '&ReasCode=' + ReasCode, 'childWindow', 'width=800,height=600,scrollbars=1,menubar=0,status=0,toolbar=0,resizable=1,titlebar=0', false);4. };5. </script>However what is actually happening is the current page is simply reloading, it's not creating or opening a new window as I want it to.
I hope this makes sense
Any help would be greatly appreciated.
Many thanks!