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.
try
016.
{
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.
else
031.
{
032.
Col1.HeaderText =
"Region"
;
033.
}
034.
grid.Columns.Add(Col1);
035.
036.
//Col3 - Query
037.
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 - 90D
043.
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 3
049.
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 2
055.
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 1
061.
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 - MTD
081.
GridTemplateColumn Col13 =
new
GridTemplateColumn();
082.
Col13.ItemTemplate =
new
MyTemplate(
"MTD"
, 13,
"lnk"
);
083.
Col13.HeaderText =
"MTD"
;
084.
grid.Columns.Add(Col13);
085.
086.
//Col14 - YTD
087.
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/S
093.
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 OV
099.
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.
catch
107.
{
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.
else
25.
{
26.
//decided whether the field should be a link button or a label
27.
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.
else
41.
{
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!
is possible to re size RadDockZone to either 320 x 270px or 640 x 270px?
Then, allow the user to add new RadDockZones dynamically when an "add zone" button is clicked?
Hi all,
Is there a way to export the HtmlChart as an image (stream) on the server-side? I'm trying to generate graphics to add to PDF's completely server-side. All I have seen is client-side exportImage.
Regards,
Evan
in the sample code at response.end call I get a script error in my .ascx
Line: 885
Error: Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed.
private
void
WriteCalendar(
string
data)
{
HttpResponse response = Page.Response;
response.Clear();
response.Buffer =
true
;
response.ContentType =
"text/calendar"
;
response.ContentEncoding = Encoding.UTF8;
response.Charset =
"utf-8"
;
response.AddHeader(
"Content-Disposition"
,
"attachment;filename=\"RadSchedulerExport.ics\""
);
response.Write(data);
response.End();
}