or
Protected
Sub
grid1_UpdateCommand(
ByVal
sender
As
Object
,
ByVal
e
As
Telerik.Web.UI.GridCommandEventArgs)
Handles
grid1.UpdateCommand
Dim
grd2
As
RadGrid = TryCast(TryCast(e.Item, GridDataItem).ChildItem.FindControl(
"grid2"
), RadGrid)
lblMsg.Text = grd2.Items(0).Cells(2).Text
End
Sub
<%@ Page Title="" Language="VB" MasterPageFile="~/main.master" AutoEventWireup="true" CodeFile="default.aspx.vb" Inherits="_default3" EnableEventValidation="false" ViewStateEncryptionMode="Never" validaterequest="false" enableviewstatemac="false" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<%@ Register Src="~/ProductDetails.ascx" TagName="ProductDetails" TagPrefix="uc1" %>
<
asp:content
ID
=
"Content1"
ContentPlaceHolderID
=
"
Head
Content
"
Runat
=
"Server"
>
<
meta
name
=
"keywords"
content
=
"keys"
id
=
"keywords"
runat
=
"server"
/>
<
meta
name
=
"description"
content
=
"description"
id
=
"description"
runat
=
"server"
/>
<
link
rel
=
"stylesheet"
type
=
"text/css"
href
=
"/skins/MyCustomSkin/ToolTip.MyCustomSkin.css"
/>
</
asp:content
>
<
asp:content
ID
=
"Content2"
ContentPlaceHolderID
=
"MainContent"
Runat
=
"Server"
>
<
script
type
=
"text/javascript"
>
var combo = null;
function CloseActiveToolTip() {
var tooltip = Telerik.Web.UI.RadToolTip.getCurrent();
if (tooltip) tooltip.hide();
}
function OnClientHide(sender, args) {
if (combo) {
$find(combo.id).hideDropDown();
}
}
</
script
>
<
telerik:radscriptmanager
ID
=
"RadScriptManager1"
runat
=
"server"
>
</
telerik:radscriptmanager
>
<
telerik:radtooltipmanager
runat
=
"server"
ID
=
"RadToolTipManager1"
Position
=
"Center"
RelativeTo
=
"Element"
Width
=
"545px"
Height
=
"320px"
Animation
=
"Fade"
HideEvent
=
"LeaveTargetAndToolTip"
OnAjaxUpdate
=
"OnAjaxUpdate"
OnClientHide
=
"OnClientHide"
EnableShadow
=
"true"
EnableEmbeddedSkins
=
"false"
Skin
=
"Transparent"
RenderInPageRoot
=
"true"
AnimationDuration
=
"300"
enableajaxskinrendering
=
"True"
autoclosedelay
=
"60000"
>
</
telerik:radtooltipmanager
>
<
asp:datalist
id
=
"dlProducts"
runat
=
"server"
repeatcolumns
=
"3"
repeatdirection
=
"Horizontal"
repeatlayout
=
"Table"
cssclass
=
"productlist"
cellpadding
=
"0"
cellspacing
=
"0"
gridlines
=
"None"
borderstyle
=
"None"
datakeyfield
=
"ProductID"
>
<
itemtemplate
><
div
id
=
"smallImage"
class
=
"productlistitems"
runat
=
"server"
><%# BoxDetails(Container.DataItem)%></
div
></
itemtemplate
>
</
asp:datalist
>
<
asp:label
id
=
"lblText"
runat
=
"server"
/>
</
asp:content
>
Imports System
Imports System.Collections
Imports System.ComponentModel
Imports System.Data
Imports System.Data.SqlClient
Imports System.Drawing
Imports System.IO
Imports System.Web
Imports System.Web.SessionState
Imports System.Web.UI
Imports System.Web.UI.HtmlControls
Imports System.Web.UI.WebControls
Imports Telerik.Web.UI
Partial Class _default3
Inherits System.Web.UI.Page
Public Function BoxDetails(ByVal DataItem As Object) As String
Dim MyConnection As SqlConnection
MyConnection = New SqlConnection()
MyConnection.ConnectionString = ConfigurationManager.ConnectionStrings("ConnectionString").ConnectionString
Dim myTxt As String = ""
If DataItem("TypeID").Equals(1) Then
If Not DataItem("title").Trim().Equals("") Then
myTxt = "<
a
class
=
""
basic""
href
=
""
" & DataItem("url").Trim() & """><
img
src
=
""
/images/home/tn/" & DataItem("filename").Trim() & """
alt
=
""
" & DataItem("title").Trim() & """
title
=
""
" & DataItem("title").Trim() & """ /></
a
><
div
class
=
""
productlisttitles""><
a
href
=
""
" & DataItem("url").Trim() & """>" & DataItem("title").Trim() & "</
a
></
div
>"
Else
myTxt = "<
a
class
=
""
basic""
href
=
""
" & DataItem("url").Trim() & """><
img
src
=
""
/images/home/tn/" & DataItem("filename").Trim() & """
alt
=
""
" & DataItem("title").Trim() & """
title
=
""
" & DataItem("title").Trim() & """ /></
a
>"
End If
End If
If DataItem("TypeID").Equals(2) Then
Dim strID As Integer = DataItem("ProductID")
Dim sql As String = "SELECT ProductID, ProductName, price, url, " _
& "(SELECT ImageFileName FROM ProductImages WHERE ProductID = Products.ProductID AND tn = 1) As Img1 " _
& "FROM Products WHERE ProductID = @id"
Dim objDR As SqlDataReader
Dim CmdR As New SqlCommand(sql, MyConnection)
With CmdR.Parameters
.Add(New SqlParameter("@id", strID))
End With
MyConnection.Open()
objDR = CmdR.ExecuteReader(System.Data.CommandBehavior.CloseConnection)
While objDR.Read()
myTxt = "<
a
class
=
""
basic""
href
=
""
/product/" & objDR("url").Trim() & """><
img
src
=
""
/images/products/mid/" & objDR("img1").Trim() & """
alt
=
""
" & objDR("ProductName").Trim() & """
class
=
""
noborder"" /></
a
><
div
class
=
""
productlisttitles""><
a
class
=
""
basic""
href
=
""
/product/" & objDR("url").Trim() & """>" & objDR("ProductName").Trim() & "</
a
><
br
/>£" & Decimal.Round(CDec(objDR("Price")), 2) & "</
div
>"
End While
MyConnection.Close()
End If
If DataItem("TypeID").Equals(3) Then
myTxt = "<
div
class
=
""
text255items"">" & DataItem("text").Trim() & "</
div
>"
'myTxt = DataItem("text").Trim()
End If
Return myTxt
End Function
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
RadToolTipManager1.TargetControls.Clear()
'RadToolTipManager1.UpdatePanel.ClientIDMode = System.Web.UI.ClientIDMode.AutoID
If Not Page.IsPostBack Then
BindData()
End If
End Sub
Private Sub BindData()
Dim body As HtmlGenericControl = DirectCast(Page.Master.FindControl("bodyTag"), HtmlGenericControl)
body.Attributes.Add("class", "Home")
Dim MyConnection As SqlConnection
MyConnection = New SqlConnection()
MyConnection.ConnectionString = ConfigurationManager.ConnectionStrings("ConnectionString").ConnectionString
Dim sql As String = "SELECT * FROM CONTENT_PAGES WHERE PageID = 1"
Dim objDR As SqlDataReader
Dim CmdR As New SqlCommand(sql, MyConnection)
MyConnection.Open()
objDR = CmdR.ExecuteReader(System.Data.CommandBehavior.CloseConnection)
While objDR.Read()
Page.Title = Replace(objDR("PageTitleTag").Trim(), "&", "and")
keywords.Attributes("content") = Replace(objDR("PageKeywords").Trim(), "&", "and")
description.Attributes("content") = Replace(objDR("PageDesc").Trim(), "&", "and")
'lblTitle.Text = Replace(objDR("PageTitle").Trim(), "&", "and")
Dim strText As String = objDR("PageText").Trim()
If strText.StartsWith("<
p
>") Then
lblText.Text = "</
span
>" & objDR("PageText").Trim() & "<
span
>"
Else
lblText.Text = "</
span
><
p
>" & objDR("PageText").Trim() & "</
p
><
span
>"
End If
End While
MyConnection.Close()
Dim sql3 As String = "SELECT * FROM HOME_SELECTIONS"
Dim resultsDataSet3 As New DataSet()
Dim myDataAdapter3 As SqlDataAdapter = New SqlDataAdapter(sql3, MyConnection)
myDataAdapter3.Fill(resultsDataSet3, "title_meta")
dlProducts.DataSource = resultsDataSet3
dlProducts.DataBind()
End Sub
Protected Sub OnAjaxUpdate(ByVal sender As Object, ByVal args As ToolTipUpdateEventArgs)
Me.UpdateToolTip(args.Value, args.UpdatePanel)
End Sub
Private Sub UpdateToolTip(ByVal elementID As String, ByVal panel As UpdatePanel)
Dim ctrl As Control = Page.LoadControl("~/ProductDetails.ascx")
panel.ContentTemplateContainer.Controls.Add(ctrl)
Dim details As ProductDetails = DirectCast(ctrl, ProductDetails)
details.ProductID = elementID
End Sub
Protected Sub ListBox_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs)
dlProducts.DataBind()
End Sub
Protected Sub dlProducts_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataListItemEventArgs) Handles dlProducts.ItemDataBound
Dim image As Control = e.Item.FindControl("smallImage")
Dim currentRow As DataRowView = DirectCast(e.Item.DataItem, DataRowView)
'Add the image id to the tooltip manager
If Not currentRow.Row("ProductID").ToString() = 0 Then
Me.RadToolTipManager1.TargetControls.Add(image.ClientID, currentRow.Row("ProductID").ToString(), True)
End If
End Sub
End Class
//This will only trigger when the browser window resizes.
//Fix the display of the dashboard, if theres an open window, re-center it.
function
OnMainSplitterResizing() {
displayOverBaseID = baseSplitterID;
if
(oWindow && oWindow.isVisible) oWindow.center();
}
<
param
name
=
"URL"
value
=
""
/>
in the Windows Media Player control and not have the file explorer default to
popping up a window and using the user's default media player.
<
asp:Content
ID
=
"Content2"
ContentPlaceHolderID
=
"ContentPlaceHolder1"
Runat
=
"Server"
>
<
telerik:RadScriptManager
ID
=
"RadScriptManager1"
Runat
=
"server"
>
</
telerik:RadScriptManager
>
<
br
/>
<
table
cellspacing
=
"4"
>
<
tr
>
<
td
rowspan
=
"2"
style
=
"vertical-align: top;"
>
Browse to an image and click to preview.
<
telerik:RadFileExplorer
ID
=
"RadFileExplorer1"
Runat
=
"server"
Configuration-MaxUploadFileSize
=
"104857600"
Width
=
"500px"
>
<
Configuration
SearchPatterns
=
"*.*"
></
Configuration
>
</
telerik:RadFileExplorer
>
</
td
>
<
td
style
=
"vertical-align: top"
>
<
br
/>
<
fieldset
style
=
"width: 270px; height: 85px"
>
<
legend
> Play Call </
legend
>
<
script
type
=
"text/javascript"
>
function OnClientFileOpen(oExplorer, args) {
var item = args.get_item();
//check if the opened item is a file
//if the item does not have extension it is a directory
//you can add additional check if the file has specific extension
if (item.get_extension()) {
args.set_cancel(true); //cancel the default execution
var name = item.get_name(); //you can use get_path() method to get full path to the item
alert(name);
//execute the custom function changing the video in the MediaPlayer control
}
}
</
script
>
<
object
id
=
"MediaPlayer1"
height
=
"65"
classid
=
"CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6"
type
=
"application/x-oleobject"
>
<
param
name
=
"URL"
value
=
""
/>
<
param
name
=
"FileName"
value
=
""
/>
<
param
name
=
"enabled"
value
=
"true"
/>
<
param
name
=
"ShowStatusBar"
value
=
"-1"
/>
<
param
name
=
"AutoStart"
value
=
"-1"
/>
<
param
name
=
"BufferingTime"
value
=
"5"
/>
<
param
name
=
"ShowCaptioning"
value
=
"0"
/>
<
param
name
=
"WindowlessVideo"
value
=
"0"
/>
<
param
name
=
"Balance"
value
=
"-1"
/>
<
param
name
=
"PreviewMode"
value
=
"1"
/>
<
param
name
=
"Volume"
value
=
"100"
/>
<
param
name
=
"AudioStream"
value
=
"-1"
/>
<
param
name
=
"AutoSize"
value
=
"-1"
/>
<
param
name
=
"AnimationAtStart"
value
=
"0"
/>
<
param
name
=
"AllowScan"
value
=
"0"
/>
<
param
name
=
"AllowChangeDisplaySize"
value
=
"0"
/>
<
param
name
=
"AutoRewind"
value
=
"0"
/>
<
param
name
=
"ClickToPlay"
value
=
"-1"
/>
<
param
name
=
"CursorType"
value
=
"0"
/>
<
param
name
=
"CurrentPosition"
value
=
"-1"
/>
<
param
name
=
"CurrentMarker"
value
=
"0"
/>
<
param
name
=
"DisplayBackColor"
value
=
"0"
/>
<
param
name
=
"DisplayForeColor"
value
=
"16777215"
/>
<
param
name
=
"DisplayMode"
value
=
"0"
/>
<
param
name
=
"DisplaySize"
value
=
"0"
/>
<
param
name
=
"EnableContextMenu"
value
=
"-1"
/>
<
param
name
=
"EnablePositionControls"
value
=
"-1"
/>
<
param
name
=
"EnableFullScreenControls"
value
=
"-1"
/>
<
param
name
=
"EnableTracker"
value
=
"-1"
/>
<
param
name
=
"InvokeURLs"
value
=
"-1"
/>
<
param
name
=
"Language"
value
=
"-1"
/>
<
param
name
=
"Mute"
value
=
"0"
/>
<
param
name
=
"PlayCount"
value
=
"1"
/>
<
param
name
=
"Rate"
value
=
"1"
/>
<
param
name
=
"SelectionStart"
value
=
"0"
/>
<
param
name
=
"SelectionEnd"
value
=
"-1"
/>
<
param
name
=
"SendOpenStateChangeEvents"
value
=
"0"
/>
<
param
name
=
"SendWarningEvents"
value
=
"0"
/>
<
param
name
=
"SendErrorEvents"
value
=
"0"
/>
<
param
name
=
"SendKeyboardEvents"
value
=
"0"
/>
<
param
name
=
"SendMouseClickEvents"
value
=
"0"
/>
<
param
name
=
"SendMouseMoveEvents"
value
=
"0"
/>
<
param
name
=
"SendPlayStateChangeEvents"
value
=
"0"
/>
<
param
name
=
"ShowControls"
value
=
"-1"
/>
<
param
name
=
"ShowAudioControls"
value
=
"-1"
/>
<
param
name
=
"ShowDisplay"
value
=
"0"
/>
<
param
name
=
"ShowGotoBar"
value
=
"0"
/>
<
param
name
=
"ShowPositionControls"
value
=
"-1"
/>
<
param
name
=
"ShowTracker"
value
=
"-1"
/>
<
param
name
=
"TransparentAtStart"
value
=
"-1"
/>
<
param
name
=
"VideoBorderWidth"
value
=
"2"
/>
<
param
name
=
"VideoBorderColor"
value
=
"0"
/>
<
param
name
=
"VideoBorder3D"
value
=
"-1"
/>
</
object
>
<
br
/>
</
div
>
</
fieldset
>
</
td
>
</
tr
>
</
table
>
</
asp:Content
>
<telerik:RadGrid runat="server" ID="radTableColumns" AutoGenerateColumns="false" AllowMultiRowSelection="true" > |
<ClientSettings> |
<Selecting AllowRowSelect="true" /> |
</ClientSettings> |
<MasterTableView> |
<Columns> |
<telerik:GridClientSelectColumn HeaderStyle-Width="40px" /> |
<telerik:GridBoundColumn DataField="column_name" HeaderText="Column Name" /> |
<telerik:GridBoundColumn DataField="column_type" HeaderText="Column Type" /> |
</Columns> |
</MasterTableView> |
</telerik:RadGrid> |
the below code resizes radchart when you resize dock. but when page first loads, radchart is bigger than dock itself and some of chart is not visible. can anybody help me with a code sample ? I searched forums and tried every single chart resize example but could no succeed..
the below code resizes radchart when you resize dock. but when page first loads, radchart is bigger than dock itself and some of chart is not visible. can anybody help me with a code sample ? I searched forums and tried every single chart resize example but could no succeed..
<
head
runat
=
"server"
>
<
title
>Untitled Page</
title
>
<
style
type
=
"text/css"
>
.rdContent
{
overflow: hidden !important;
}
</
style
>
</
head
>
<
body
>
<
form
id
=
"form1"
runat
=
"server"
>
<
asp:ScriptManager
ID
=
"ScriptManager1"
runat
=
"server"
/>
<
telerik:RadScriptBlock
ID
=
"RadScriptBlock1"
runat
=
"server"
>
<
script
type
=
"text/javascript"
>
function ResizeChart(sender, args) {
var chart = $get("<%= RadChart1.ClientID %>");
var chartimg = chart.getElementsByTagName("img")[0];
chartimg.style.setAttribute("width", sender.get_width() - 50 + "px");
chartimg.style.setAttribute("height", sender.get_height() - 50 + "px");
}
</
script
>
</
telerik:RadScriptBlock
>
<
br
/>
<
div
>
<
telerik:RadDockLayout
runat
=
"server"
ID
=
"RadDockLayout1"
StoreLayoutInViewState
=
"false"
>
<
telerik:RadDockZone
runat
=
"server"
ID
=
"RadDockZone4"
Width
=
"372px"
Style="float: left;
margin-right: 5px"
BorderColor
=
"#E1E1E1"
BorderStyle
=
"Solid"
>
<
telerik:RadDock
ID
=
"RadDock4"
runat
=
"server"
Resizable
=
"true"
Width
=
"350px"
EnableRoundedCorners
=
"true"
OnClientResizeEnd
=
"ResizeChart"
>
<
ContentTemplate
>
<
div
>
<
telerik:RadChart
ID
=
"RadChart1"
runat
=
"server"
>
<
Series
>
<
telerik:ChartSeries
>
<
Items
>
<
telerik:ChartSeriesItem
YValue
=
"3"
>
</
telerik:ChartSeriesItem
>
<
telerik:ChartSeriesItem
YValue
=
"6"
>
</
telerik:ChartSeriesItem
>
<
telerik:ChartSeriesItem
YValue
=
"2"
>
</
telerik:ChartSeriesItem
>
<
telerik:ChartSeriesItem
YValue
=
"1"
>
</
telerik:ChartSeriesItem
>
<
telerik:ChartSeriesItem
YValue
=
"5"
>
</
telerik:ChartSeriesItem
>
<
telerik:ChartSeriesItem
YValue
=
"4"
>
</
telerik:ChartSeriesItem
>
</
Items
>
</
telerik:ChartSeries
>
</
Series
>
</
telerik:RadChart
>
</
div
>
</
ContentTemplate
>
</
telerik:RadDock
>
</
telerik:RadDockZone
>
<
telerik:RadDockZone
runat
=
"server"
ID
=
"RadDockZone5"
Width
=
"372px"
Style="float: left;
margin-right: 5px;"
BorderColor
=
"#E1E1E1"
BorderStyle
=
"Solid"
>
<
telerik:RadDock
ID
=
"RadDock5"
runat
=
"server"
Resizable
=
"true"
Width
=
"327px"
EnableRoundedCorners
=
"true"
>
<
ContentTemplate
>
asdfads
</
ContentTemplate
>
</
telerik:RadDock
>
</
telerik:RadDockZone
>
<
telerik:RadDockZone
runat
=
"server"
ID
=
"RadDockZone6"
Width
=
"372px"
Style
=
"float: left;"
BorderColor
=
"#E1E1E1"
BorderStyle
=
"Solid"
>
<
telerik:RadDock
ID
=
"RadDock6"
runat
=
"server"
Resizable
=
"true"
Width
=
"327px"
EnableRoundedCorners
=
"true"
>
<
ContentTemplate
>
asdf
</
ContentTemplate
>
</
telerik:RadDock
>
</
telerik:RadDockZone
>
</
telerik:RadDockLayout
>
</
div
>
</
form
>
</body>
</html>
<telerik:GridTemplateColumn UniqueName="awardCol" DataField="Amount" HeaderText="Amount">
<ItemTemplate>
<telerik:RadNumericTextBox ID="amountEntryField" DataType="System.Double" MinValue="1.0" Value='<%# Eval("Amount") %>' runat="server">
<ClientEvents OnBlur="amtBlur" OnFocus="amtFocus" OnKeyPress="updateAmount" />
</telerik:RadNumericTextBox>
</ItemTemplate>