Hi,
I have RadGrid with both Master data & details data.My requirement is what are the rows that i selected either in Master and/or Details grid,it should be printed with header row(s).
Here is my java script function for printing grid with Master data & details data with Header Row's :
<
telerik:RadCodeBlock
ID
=
"RadCodeBlock1"
runat
=
"server"
>
<
script
type
=
"text/javascript"
>
function PrintRadGrid() {
var sh = '<%= Page.ClientScript.GetWebResourceUrl(gvIndents.GetType(),String.Format("Telerik.Web.UI.Skins.{0}.Grid.{0}.css",gvIndents.Skin)) %>';
var styleStr = "<
html
><
head
><
link
href
=
'" + sh + "'
rel
=
'stylesheet'
type
=
'text/css'
></
link
></
head
>";
var MasterTable = $find('<%= gvIndents.ClientID %>').get_masterTableView();
var selectedRows = MasterTable.get_selectedItems();
var htmlcontent = "<
table
>";
var headerRow = $telerik.$(grid.get_masterTableView().get_element()).find("th.rgHeader").parent("tr")[0];
htmlcontent = htmlcontent + "<
tr
>" + headerRow.get_element().innerHTML + "</
tr
>";
for (var i = 0; i <
selectedRows.length
; i++) {
var
row
=
selectedRows
[i];
htmlcontent
= htmlcontent + "<tr>" + row.get_element().innerHTML + "</
tr
>";
if (row.get_nestedViews().length > 0) {
var detailTableView = row.get_nestedViews()[0];
headerRow = $telerik.$(detailTableView.get_element()).find("th.rgHeader").parent("tr")[0];
htmlcontent = htmlcontent + "<
tr
>" + headerRow.get_element().innerHTML + "</
tr
>";
var nestedSelectedRows = row.get_nestedViews()[0].get_selectedItems();
for (var j = 0; j <
nestedSelectedRows.length
; j++) {
var
nestedRow
=
nestedSelectedRows
[j];
htmlcontent
= htmlcontent + "<tr>" + nestedRow.get_element().innerHTML + "</
tr
>";
}
}
}
htmlcontent = styleStr + "<
body
><
div
class
=
'RadGrid RadGrid_Simple'
>" + htmlcontent + "</
table
></
div
></
body
></
html
>";
var previewWnd = window.open('about:blank', '', '', false);
previewWnd.document.open();
previewWnd.document.write(htmlcontent);
previewWnd.document.close();
previewWnd.print();
</
script
>
</
telerik:RadCodeBlock
>
<
telerik:RadGrid
ID
=
"gvIndents"
runat
=
"server"
.......
...........................................>
<
CommandItemTemplate
>
<
div
style
=
"padding: 5px 5px;"
>
<
asp:LinkButton
ID
=
"LinkButton1"
runat
=
"server"
Text
=
"Print Selected"
OnClientClick
=
"PrintRadGrid(); return false;"
/>
</
div
>
</
CommandItemTemplate
>
..........................................
</
telerik:RadGrid
>
After selecting some rows & if i click on "Print Selected" linkbutton which is placed on CommandItemTemplete it will display any output.
So please solve my problem...
Thanks in advance...
I would like Image Manager to display a list of images from a database so that they can be inserted into the editor.
I am using asp.net 3.5, Visual Web Developer 2008 Express and VB.
I understand that to do this I need to build a Custom FileBrowserContent Provider as described in:
http://www.telerik.com/help/aspnet-ajax/customfilebrowsercontentprovider.html
I have created MyContentProvider class in MyCustomProvider namespace as per the above help page and added:
<%@ Register Namespace = "MyCustomProvider" TagPrefix = "MyCp" Assembly="App_Code" %>
But when I add:
RadEditor1.ImageManager.ContentProviderTypeName = "ContentProviders.RadEditor.MyContentProvider, App_Code" to my code behind, the Image Manager page has the following error:
Value cannot be null.
Parameter name: type
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.ArgumentNullException: Value cannot be null.
Parameter name: type
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[ArgumentNullException: Value cannot be null.
Parameter name: type]
System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) +7679178
Telerik.Web.UI.RadFileExplorer.InitContentProvider(String selectedUrl) +226
Telerik.Web.UI.RadFileExplorer.InitContentProvider() +138
Telerik.Web.UI.RadFileExplorer.BindExplorer() +48
Telerik.Web.UI.RadFileExplorer.OnLoad(EventArgs e) +139
System.Web.UI.Control.LoadRecursive() +50
System.Web.UI.Control.LoadRecursive() +141
System.Web.UI.Control.LoadRecursive() +141
System.Web.UI.Control.LoadRecursive() +141
System.Web.UI.Control.LoadRecursive() +141
System.Web.UI.Control.LoadRecursive() +141
System.Web.UI.Control.LoadRecursive() +141
System.Web.UI.Control.LoadRecursive() +141
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627
I've also tried setting it with the example (from the Help page above):
RadEditor1.FileBrowserContentProviderTypeName = typeof(DatabaseContentProvider).AssemblyQualifiedName
but I don't know the VB syntax for this.
Your help would be much appreciated.
Thanking you in anticipation.
Roger
<
telerik:RadEditor
ID
=
"BodyEditor"
Runat
=
"server"
Width
=
"600px"
Height
=
"255px"
EditModes
=
"Design, Preview"
EnableResize
=
"false"
StripFormattingOnPaste
=
"All"
SkinID
=
"DefaultSetOfTools"
MaxTextLength
=
"4000"
OnClientCommandExecuting
=
"OnClientCommandExecuting"
>
<
Tools
>
<
telerik:EditorToolGroup
Tag
=
"toolBar"
>
<
telerik:EditorDropDown
Name
=
"FormatBlock"
Text
=
"Normal"
/>
<
telerik:EditorDropDown
Name
=
"FontName"
Text
=
"Font"
Width
=
"125"
/>
<
telerik:EditorDropDown
Name
=
"RealFontSize"
Text
=
"Size"
/>
<
telerik:EditorSeparator
Visible
=
"true"
/>
<
telerik:EditorDropDown
Name
=
"ddnFieldSelect_WO"
Text
=
"Add Work Order Field"
Width
=
"125"
/>
<
telerik:EditorDropDown
Name
=
"ddnFieldSelect_EV"
Text
=
"Add Event Field"
Width
=
"125"
/>
</
telerik:EditorToolGroup
>
<
telerik:EditorToolGroup
>
<
telerik:EditorTool
Name
=
"Bold"
Text
=
"Bold"
/>
<
telerik:EditorTool
Name
=
"Italic"
Text
=
"Italic"
/>
<
telerik:EditorTool
Name
=
"Underline"
Text
=
"Underline"
/>
<
telerik:EditorSeparator
Visible
=
"true"
/>
<
telerik:EditorTool
Name
=
"JustifyLeft"
Text
=
"Align Left"
/>
<
telerik:EditorTool
Name
=
"JustifyCenter"
Text
=
"Center"
/>
<
telerik:EditorTool
Name
=
"JustifyRight"
Text
=
"Align Right"
/>
<
telerik:EditorTool
Name
=
"JustifyFull"
Text
=
"Justify Full"
/>
<
telerik:EditorSeparator
Visible
=
"true"
/>
<
telerik:EditorTool
Name
=
"InsertOrderedList"
Text
=
"Ordered List"
/>
<
telerik:EditorTool
Name
=
"InsertUnorderedList"
Text
=
"Unordered List"
/>
<
telerik:EditorSeparator
Visible
=
"true"
/>
<
telerik:EditorTool
Name
=
"Outdent"
Text
=
"Outdent"
/>
<
telerik:EditorTool
Name
=
"Indent"
Text
=
"Indent"
/>
<
telerik:EditorTool
Name
=
"ForeColor"
Text
=
"Text Color"
/>
<
telerik:EditorTool
Name
=
"BackColor"
Text
=
"Background Color"
/>
<
telerik:EditorSeparator
Visible
=
"true"
/>
<
telerik:EditorTool
Name
=
"InsertLink"
Text
=
"Insert Link"
/>
<
telerik:EditorSeparator
Visible
=
"true"
/>
<
telerik:EditorTool
Name
=
"Cut"
Text
=
"Cut"
/>
<
telerik:EditorTool
Name
=
"Copy"
Text
=
"Copy"
/>
<
telerik:EditorTool
Name
=
"Paste"
Text
=
"Paste"
/>
<
telerik:EditorSeparator
Visible
=
"true"
/>
<
telerik:EditorTool
Name
=
"Undo"
Text
=
"Undo"
/>
<
telerik:EditorTool
Name
=
"Redo"
Text
=
"Redo"
/>
<
telerik:EditorSeparator
Visible
=
"true"
/>
<
telerik:EditorTool
Name
=
"AjaxSpellCheck"
Text
=
"Spell Checker"
/>
</
telerik:EditorToolGroup
>
</
Tools
>
<
Modules
>
<
telerik:EditorModule
Name
=
"RadEditorStatistics"
Visible
=
"true"
/>
</
Modules
>
<
RealFontSizes
>
<
telerik:EditorRealFontSize
Value
=
"8pt"
/>
<
telerik:EditorRealFontSize
Value
=
"9pt"
/>
<
telerik:EditorRealFontSize
Value
=
"10pt"
/>
<
telerik:EditorRealFontSize
Value
=
"11pt"
/>
<
telerik:EditorRealFontSize
Value
=
"12pt"
/>
<
telerik:EditorRealFontSize
Value
=
"14pt"
/>
<
telerik:EditorRealFontSize
Value
=
"16pt"
/>
<
telerik:EditorRealFontSize
Value
=
"18pt"
/>
<
telerik:EditorRealFontSize
Value
=
"20pt"
/>
<
telerik:EditorRealFontSize
Value
=
"22pt"
/>
<
telerik:EditorRealFontSize
Value
=
"24pt"
/>
<
telerik:EditorRealFontSize
Value
=
"26pt"
/>
<
telerik:EditorRealFontSize
Value
=
"28pt"
/>
<
telerik:EditorRealFontSize
Value
=
"36pt"
/>
<
telerik:EditorRealFontSize
Value
=
"48pt"
/>
<
telerik:EditorRealFontSize
Value
=
"72pt"
/>
</
RealFontSizes
>
</
telerik:RadEditor
>
.rsTimelineView .rsAllDayRow
{
height: 25px !important;
}
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<
html
xmlns
=
"http://www.w3.org/1999/xhtml"
>
<
head
runat
=
"server"
>
<
title
>RadAsyncUpload in UpdatePanel on Windows XP Test</
title
>
</
head
>
<
body
>
<
form
runat
=
"server"
enctype
=
"multipart/form-data"
>
<
asp:ScriptManager
runat
=
"server"
/>
<
asp:UpdatePanel
ID
=
"UpdatePanel"
runat
=
"server"
><
ContentTemplate
>
<
rad:RadAsyncUpload
runat
=
"server"
MultipleFileSelection
=
"Automatic"
/>
<
asp:Button
runat
=
"server"
OnClick
=
"OnClick"
Text
=
"Run Test"
/>
</
ContentTemplate
></
asp:UpdatePanel
>
</
form
>
</
body
>
</
html
>
using
System;
using
System.Collections.Generic;
using
System.Linq;
using
System.Web;
using
System.Web.UI;
using
System.Web.UI.WebControls;
public
partial
class
_Default : System.Web.UI.Page
{
protected
void
OnClick(
object
sender, EventArgs e)
{
System.Web.UI.ScriptManager.RegisterStartupScript(UpdatePanel,
typeof
(
string
), Guid.NewGuid().ToString(),
"alert('Successful');"
,
true
);
}
}
Protected
Sub cEventTypesGrid_InsertCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles cEventTypesGrid.InsertCommand
Dim editedItem As GridEditableItem = TryCast(e.Item, GridEditableItem)
Dim vLogin As TableCell = editedItem("Name")
Dim vTxtLogin As String = (CType(vLogin.Controls(0), RadComboBox)).SelectedValue
If vTxtLogin = "" Then
Throw New Exception("Name cannot be blank.")
End If