
| if (HasBackgroundImage) |
| { |
| string script = @" |
| <script language ='javascript'> |
| function OnClientLoad(editor) |
| { |
| var style = editor.get_contentArea().style; |
| style.backgroundImage = 'url(/UserImages/backgrounds/" + strBgImg + @")'; |
| style.backgroundRepeat = 'no-repeat'; |
| style.backgroundPosition = 'top right'; |
| } |
| function BackgroundManagerFunction(sender, args) |
| { |
| alert('OK'); |
| } |
| </script>"; |
| Page.ClientScript.RegisterClientScriptBlock(GetType(), "CommentScript", script, false); |
| RadEditor1.OnClientLoad = "OnClientLoad"; |
| } |
| if (HasBackgroundImage) |
| { |
| // Custom image manager |
| Telerik.Web.UI.Editor.DialogControls.FileManagerDialogParameters backgroundFileManagerParameters = new Telerik.Web.UI.Editor.DialogControls.FileManagerDialogParameters(); |
| backgroundFileManagerParameters.ViewPaths = new string[] { "~/UserImages/Backgrounds/" }; |
| backgroundFileManagerParameters.UploadPaths = new string[] { "" }; |
| backgroundFileManagerParameters.DeletePaths = new string[] { "" }; |
| backgroundFileManagerParameters.MaxUploadFileSize = 5000000; |
| // If you don't set the following property, the default value will be used |
| //backgroundFileManagerParameters.SearchPatterns = new string[] { "*.jpg,*.gif,*.png" }; |
| DialogDefinition backgroundImageManagerDialog = new DialogDefinition(typeof(Telerik.Web.UI.Editor.DialogControls.ImageManagerDialog), backgroundFileManagerParameters); |
| backgroundImageManagerDialog.ClientCallbackFunction = "BackgroundManagerFunction"; |
| backgroundImageManagerDialog.Width = Unit.Pixel(680); |
| backgroundImageManagerDialog.Height = Unit.Pixel(420); |
| //If you need to customize the dialog then register the external dialog files |
| //backgroundImageManagerDialog.Parameters["ExternalDialogsPath"] = "~/AdminEditorDialogs/"; |
| RadEditor1.DialogOpener.DialogDefinitions.Add("backgroundImageManager", backgroundImageManagerDialog); |
| } |
| <asp:Panel ID="pnlTitle" runat="server" DefaultButton="btnUpdateTitle" > |
| <b>Title:</b> |
| <asp:TextBox ID="txtTitle" runat="server" CssClass="textBox" Width="560px"></asp:TextBox> |
| <asp:Button id="btnUpdateTitle" runat="server" CssClass="button" Text="Update Title" CausesValidation="false" OnClientClick="UpdateTitle(); return false;" /> |
| <br /> |
| </asp:Panel> |
| <asp:Panel ID="pnlSubTitle" runat="server" DefaultButton="btnUpdateSubTitle"> |
| <b>Sub-Title:</b> |
| <asp:TextBox ID="txtSubTitle" runat="server" CssClass="textBox" Width="560px"></asp:TextBox> |
| <asp:Button id="btnUpdateSubTitle" runat="server" CssClass="button" Text="Update Sub-Title" CausesValidation="false" OnClientClick="UpdateSubTitle(); return false;" /> |
| </asp:Panel> |
| <telerik:RadEditor runat="server" ID="RadEditor1" ExternalDialogsPath="~/AdminEditorDialogs" |
| AutoResizeHeight="false" EnableResize="false"> |
| <ImageManager ViewPaths="~/UserImages" UploadPaths="~/UserImages" /> |
| <Content> |
| </Content> |
| </telerik:RadEditor> |
| <script type="text/javascript"> |
| Telerik.Web.UI.Editor.CommandList["BackgroundImage"] = function(commandName, editor, args) |
| { |
| editor.showDialog("backgroundImageManager"); |
| }; |
| </script> |
I am experiencing some inconsistent behavior with the New Paragraph feature on the Editor.
I did all my tests on your example at: http://www.telerik.com/DEMOS/ASPNET/Prometheus/Editor/Examples/Default/DefaultCS.aspx
On IE:
The ENTER key actually generates a br tag.
The button labeled New Paragraph creates a new p tag and places a space in it but places the cursor after the paragraph so if you start typing straight away the words you type are placed outside it and after it, as such:
| <p>This is a paragraph</p> |
| <p> </p>My new paragraph by clicking on the New Paragraph button |
This happens only if the cursor was placed at the last paragraph in the editor content before the button was clicked.
If another paragraph already exists after the one that the cursor is currently placed and you click on the New Paragraph button a new p tag is correctly added before the next paragraph but the cursor is placed at the beginning of the next one. If you start typing the content is placed on that paragraph leaving the new one in between untouched. There is no way to write in the new one unless you switch to the html view and add some content to the new paragraph in order to make it visible in the edit mode.
On FF:
The ENTER key actually generates a p tag.
The button labeled New Paragraph does absolutely nothing.

| void AddSpellCheckerButton() |
| { |
| Telerik.WebControls.RadEditorUtils.ToolbarButton spellCheckButton = new Telerik.WebControls.RadEditorUtils.ToolbarButton( SpellCheckerCommandName ); |
| spellCheckButton.ShowIcon = true; |
| ValueEditor.Toolbars[ MainToolBarName ].Tools.Add( spellCheckButton ); |
| } |
how do i create a Dynamic DataTable for RadGrid.
I just follow the same procedure for GridView
DataTable myDataTable = new DataTable();
DataColumn myDataColumn;
myDataColumn =
new DataColumn();
myDataColumn.DataType =
Type.GetType("System.String");
myDataColumn.ColumnName =
"ID";
myDataTable.Columns.Add(myDataColumn);
myDataColumn =
new DataColumn();
myDataColumn.DataType =
Type.GetType("System.String");
myDataColumn.ColumnName =
"TestName";
myDataTable.Columns.Add(myDataColumn);
myDataColumn =
new DataColumn();
myDataColumn.DataType =
Type.GetType("System.String");
myDataColumn.ColumnName =
"ReportResults";
myDataTable.Columns.Add(myDataColumn);
myDataColumn =
new DataColumn();
myDataColumn.DataType =
Type.GetType("System.String");
myDataColumn.ColumnName =
"CommunicationType";
myDataTable.Columns.Add(myDataColumn);
//add test row
DataRow drow = myDataTable.NewRow();
drow[
"ID"] = Guid.NewGuid().ToString();
drow[
"TestName"] = "TestName1";
drow[
"ReportResults"] = "ReportName1";
drow[
"CommunicationType"] = "CommunicationType1";
//Add the row to the datatable.
myDataTable.Rows.Add(drow);
this datatable is working fine for GridView.
But when i binding for RADGRID, it showing some error like
"
"
Any help will be highly appriceated.
Regards,
Suresh Kumar Udatha.
Hi
I need to get the grid item value thru javascript. The below code is working fine in IE.
var maxRowIndex = this.ncRadGrid.Grid.get_masterTableView().get_dataItems().length - 1;
var rowIndex;
for (rowIndex = 0; rowIndex <= maxRowIndex; rowIndex++) {
var nodeID = this.ncRadGrid.GetValue(rowIndex, 'NodeID')
}
GridEditableItem grdSelected = (GridEditableItem)e.Item;
Results in the error:
{"The current EditFormType does not support the requested editing capabilities."}
and I am unable to retrieve the form's data values from their controls.
This same code works fine with a SQL dataset. Here is my OleDb code that populates the grid:
| OleDbConnection accConn = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=//webservice/C$/temp/fcData.mdb"); |
| OleDbCommand accCommand = new OleDbCommand("select mmw_drug_disp.descdisplay,strength,strengthunit,ddid,dosechekunit, strength+' '+strengthunit as dispdose, mmw_drug_name.descdisplay as drugname, " |
| + "'' as freq, '' as route, '' as comments, null as startdate, null as stopdate, null as dcdate, '' as therapy " |
| + "from mmw_drug_disp " |
| + "inner join mmw_drug_name on mmw_drug_disp.pnid = mmw_drug_name.pnid " |
| + "where mmw_drug_disp.haspackdrugind=1 and mmw_drug_disp.descsearch like '" + searchtext + "%' order by mmw_drug_disp.descdisplay", accConn); |
| OleDbDataAdapter myDataAdapter = new OleDbDataAdapter(accCommand); |
| accConn.Open(); |
| DataSet myDataSet = new DataSet(); |
| myDataAdapter.Fill(myDataSet, "Names"); |
| RadGrid1.DataSource = myDataSet; |
| RadGrid1.DataMember = "Names"; |
| this.DataBind(); |