or
<
telerik:GridEditCommandColumn
UniqueName
=
"EditCommandColumn"
EditImageUrl
=
"~/Images/Edit.gif"
ButtonType
=
"ImageButton"
>
</
telerik:GridEditCommandColumn
>
if (e.Item is GridDataItem)
{
GridDataItem item = (GridDataItem)e.Item;
ImageButton edit = (ImageButton)item["EditCommandColumn"].Controls[0];
//edit.Attributes.Add("OnClick", " onContactRowSelected('" + sender + "','" + e + "');");
edit.Attributes["onClick"] = "alert('test');return false;";
}
<
ClientEvents
OnCommand
=
"radContactGrid_Command"
OnRowCreated
=
"onContactGridRowCreated"
OnRowCreating
=
"onContactGridRowCreating"
OnRowSelected
=
"onContactRowSelected"
/>
function showWindow() {
var varMealOrderID = document.getElementById('ctl00_CphMaster_hidMealOrderId').value;
var oWnd = radopen('FKMS_CTRL_Local_Item_Request.aspx?MealOrderId=' + varMealOrderID + '&popup=true' + '&Mode=NEW', 'RadWindowPopup');
oWnd.setSize(1100, 750);
oWnd.moveTo(75, 50);
}
'on parent page which has tooltip with it
Private Sub UpdateToolTip(ByVal elementID As String, ByVal panel As UpdatePanel)
Dim ctrl As Control = Page.LoadControl("WidgetControls/WidgetSupportDocument.ascx")
panel.ContentTemplateContainer.Controls.Add(ctrl)
Dim details As WidgetSupportDocument = DirectCast(ctrl, WidgetSupportDocument)
details.SupportDocumentID = elementID
details.DisplayData()
End Sub
Public Sub DisplayData()
Dim dsData As DataSet
Dim strFileName As String
Dim byteData() As Byte
Dim strDocumentType As String
Dim arrSplit() As String
'load data from database
dsData = LoadData(Me.SupportDocumentID)
byteData = CType(dsData.Tables(0).Rows(0).Item("FileContent"), Byte())
arrSplit = Split(dsData.Tables(0).Rows(0).Item("Filename").ToString, ".")
intLastValue = arrSplit.Length
strDocumentType = arrSplit(intLastValue - 1)
SetControlData(strDocumentType, byteData)
End Sub
Private Sub SetControlData(ByVal strDocumentType As String, ByVal byteView() As Byte, Optional ByVal strFileName As String = "")
Dim strContentType As String = String.Empty
Select Case UCase(strDocumentType)
Case "HTML", "HTM"
strContentType = "text/HTML"
Case "BMP"
strContentType = "image/BMP"
Case "JPG"
strContentType = "image/JPEG"
Case "GIF"
strContentType = "image/GIF"
Case "PDF"
strContentType = "application/pdf"
Case "XLS"
strContentType = "application/vnd.ms-excel"
Case "DOC"
strContentType = "application/msword"
Case "TXT", "LOG"
' .txt file (such as a report tab delimited export) should open inline rather then directly in the browser
If strFileName = "" Then
strFileName = "ViewDocument.txt"
End If
With Response
.ClearContent()
.ClearHeaders()
strContentType = "text/unknown"
.AddHeader("Content-Length", CType(byteView.Length, String))
.AddHeader("Content-Disposition", "inline; filename=" & strFileName)
End With
Case Else
End Select
If strContentType.Length > 0 Then
With Response
.Clear()
.ContentType = strContentType
.BinaryWrite(byteView)
.Flush()
End With
Else
Response.Write("<
font
color
=
'red'
>The selected attachement cannot be displayed. </
font
>")
End If
End Sub
var grid = $find("radgrid1");
var mtv = grid.get_masterTableView();
mtv.set_dataSource(DATA); //data is coming from a JSON object
mtv.dataBind();