hi,
I try to implement custom control (inherit RadComboBox). For customize dropdownList I make the class for radcombobox.ItemTemplate. In this class in InstantiateIn method add some labels with DataBinding eventhandler.
I also set event ItemsRequested for data load ondemad:
void RadComboBox_ItemsRequested(object o, RadComboBoxItemsRequestedEventArgs e)
{
int noItems = 15;
RadComboBox combo = (RadComboBox)o;
combo.DataSourceID = null;
combo.DataSource = null;
String sortExpression = this.Sort.SelectedValue;
// new datasource
ObjectDataSource ods = new ObjectDataSource("Artikli", "GetArtikliPagedSortedKlas");
// set parameters
ods.SelectParameters.Add("maximumRows", noItems.ToString());
ods.SelectParameters.Add("sortExpression", sortExpression);
//.... // there are more parameters. Those parameters must set at this point(depends from other controls)
combo.DataSource = ods;
combo.DataBind(); // There get the message InvalidOperationException ONLY IF PUT THE CONTROL IN FORMVIEW(on edit)
//Error message:"Databinding methods such as Eval(), XPath(), and Bind() can only be used in the context of a databound control."
}
The new control works fine until I don't databind it. My case:put it on the FormView, databind and on run time choose edit(insert i did't try).
To summarize:
The solution must be acteptable also for radgrid and gridview.
Hi,
I am using TabStrips for creating tabs in my project. Previously i have created
tabs structure as shown in the diagram
Now as per our new project requirement i want to change the tab look in to
hyper link like structure. as shown in diagram
So is there any solution how can we convert these tabs look in to hyper
link. So please suggest solution for that
Thanks and regard,
Sagar
<
telerik:RadEditor
ID="RadEditor1"
runat="server"
Width="99%"
height="650"
Skin="WebBlue"
>
<Tools>
<telerik:EditorToolGroup>
<telerik:EditorTool Name="AjaxSpellCheck" />
<telerik:EditorTool name="FindAndReplace" shortcut="CTRL+F" />
<telerik:EditorSeparator />
<telerik:EditorTool name="Cut" shortcut="CTRL+X" />
<telerik:EditorTool name="Copy" shortcut="CTRL+C" />
<telerik:EditorTool name="Paste" shortcut="CTRL+V" />
<telerik:EditorTool name="PasteFromWord" />
<telerik:EditorTool name="PasteFromWordNoFontsNoSizes" />
<telerik:EditorTool name="PastePlainText" />
<telerik:EditorTool name="PasteAsHtml" />
<telerik:EditorSeparator />
<telerik:EditorTool name="Undo" shortcut="CTRL+Z" />
<telerik:EditorTool name="Redo" shortcut="CTRL+Y" />
</telerik:EditorToolGroup>
<telerik:EditorToolGroup>
<telerik:EditorTool name="ImageManager" shortcut="CTRL+G" />
<telerik:EditorTool name="ImageMapDialog" />
<telerik:EditorTool name="AbsolutePosition" />
<telerik:EditorSeparator />
<telerik:EditorTool name="FlashManager" />
<telerik:EditorTool name="MediaManager" />
<telerik:EditorTool name="DocumentManager" />
<telerik:EditorTool name="TemplateManager" />
<telerik:EditorTool name="LinkManager" shortcut="CTRL+K" />
<telerik:EditorTool name="Unlink" shortcut="CTRL+SHIFT+K" />
<telerik:EditorTool Name="InsertSpecialLink" Text="Insert Page Link" />
</telerik:EditorToolGroup>
<telerik:EditorToolGroup>
<telerik:EditorTool name="Bold" shortcut="CTRL+B" />
<telerik:EditorTool name="Italic" shortcut="CTRL+I" />
<telerik:EditorTool name="Underline" shortcut="CTRL+U" />
<telerik:EditorTool name="StrikeThrough" />
<telerik:EditorSeparator />
<telerik:EditorTool name="JustifyLeft" />
<telerik:EditorTool name="JustifyCenter" />
<telerik:EditorTool name="JustifyRight" />
<telerik:EditorTool name="JustifyFull" />
<telerik:EditorTool name="JustifyNone" />
<telerik:EditorSeparator />
<telerik:EditorTool name="Indent" />
<telerik:EditorTool name="Outdent" />
<telerik:EditorTool name="InsertOrderedList" />
<telerik:EditorTool name="InsertUnorderedList" />
</telerik:EditorToolGroup>
<telerik:EditorToolGroup>
<telerik:EditorTool name="ConvertToLower" />
<telerik:EditorTool name="ConvertToUpper" />
<telerik:EditorSeparator />
<telerik:EditorTool name="InsertTable" />
<telerik:EditorTool name="InsertSnippet" />
<telerik:EditorTool name="InsertFormElement" />
<telerik:EditorTool name="InsertSymbol" />
</telerik:EditorToolGroup>
<telerik:EditorToolGroup>
<telerik:EditorTool name="ForeColor" />
<telerik:EditorTool name="BackColor" />
<telerik:EditorSeparator />
<telerik:EditorTool name="FontName" />
<telerik:EditorTool name="FontSize" />
<telerik:EditorTool name="ApplyClass" />
<telerik:EditorTool name="InsertCustomLink" />
<telerik:EditorTool name="FormatBlock" />
<telerik:EditorSeparator />
<telerik:EditorTool name="FormatStripper" />
</telerik:EditorToolGroup>
<telerik:EditorToolGroup>
<telerik:EditorTool name="IncreaseSize" shortcut="F10" />
<telerik:EditorTool name="DecreaseSize" shortcut="F9" />
<telerik:EditorTool name="Print" shortcut="CTRL+P" />
<telerik:EditorTool name="Superscript" />
<telerik:EditorTool name="Subscript" />
<telerik:EditorTool name="InsertParagraph" />
<telerik:EditorTool name="InsertHorizontalRule" />
<telerik:EditorTool name="InsertDate" />
<telerik:EditorTool name="InsertTime" />
<telerik:EditorSeparator />
<telerik:EditorTool name="AboutDialog" />
<telerik:EditorTool name="Help" shortcut="F1" />
</telerik:EditorToolGroup>
<telerik:EditorToolGroup>
<telerik:EditorTool name="ToggleScreenMode" shortcut="F11" />
<telerik:EditorTool name="ToggleTableBorder" />
<telerik:EditorTool name="Zoom" />
<telerik:EditorTool name="ModuleManager" />
<telerik:EditorTool name="ToggleDocking" />
<telerik:EditorTool name="RepeatLastCommand" shortcut="F4" />
</telerik:EditorToolGroup>
</Tools>
<DocumentManager DeletePaths="/Documents/" UploadPaths="/Documents/" ViewPaths="/Documents/" />
<ImageManager DeletePaths="/Images/" UploadPaths="/Images/" ViewPaths="/Images/" />
<MediaManager UploadPaths="/Media/" DeletePaths="/Media/"
ViewPaths="/Media/"
SearchPatterns="*.wma,*.wmv,*.avi,*.wav,*.mpeg,*.mpg,*.mpe,*.mp3,*.divx,*.m3u,*.mid,*.midi,*.snd,*.mkv,*.m4v,*.mp4"
MaxUploadFileSize="10240000">
</MediaManager>
<TemplateManager UploadPaths="/Templates/" DeletePaths="/Templates/" ViewPaths="/Templates/" />
<FlashManager UploadPaths="/Flash/" DeletePaths="/Flash/" ViewPaths="/Flash/" />
</telerik:RadEditor>
<script type="text/javascript">
//<![CDATA[
Telerik.Web.UI.Editor.CommandList[
"InsertSpecialLink"] = function(commandName, editor, args)
{
var elem = editor.getSelectedElement(); //returns the selected element.
if (elem.tagName == "A")
{
editor.selectElement(elem);
argument = elem;
}
else
{
var content = editor.getSelectionHtml();
var link = editor.get_document().createElement("A");
link.innerHTML = content;
argument = link;
}
var myCallbackFunction = function(sender, args)
{
editor.pasteHtml(String.format(
"<a href=\"{0}\" originalAttribute="href" originalPath="\"{0}\"" >{1}</a> ", args.href, args.name))
}
editor.showDialog(
"InsertSpecialLink", argument, myCallbackFunction);
};
</script>
//// Code Behind Called on Page Loadprivate void InsertCustomDialogues()
{
DialogDefinition insertSpecialLinkDialogDefinition = new DialogDefinition("~/UI/Content/ItemSelect.ascx", new DialogParameters());
insertSpecialLinkDialogDefinition.Modal =
true;
insertSpecialLinkDialogDefinition.VisibleTitlebar = true;
insertSpecialLinkDialogDefinition.VisibleStatusbar = true;
insertSpecialLinkDialogDefinition.Width = Unit.Pixel(250);
insertSpecialLinkDialogDefinition.Height = Unit.Pixel(650);
insertSpecialLinkDialogDefinition.VisibleStatusbar = false;
RadEditor1.AddDialogDefinition(
"InsertSpecialLink", insertSpecialLinkDialogDefinition);
}

| Dim cell1 As TableCell = editItem("ddlStatus") | |
| Dim Status As String = (CType(cell1.Controls(0), RadComboBox)).Text | |
| If Status = "Scheduled" Then | |
| ' rest of code |
I have datepicker user control and run this on load.
In ie6 it loads the page for a couple seconds then it refreshes the page once it finishes loading the javascript. The below script is run for each calendar. I have tons of calendars on the page - over 25.
Is there a solution to the page refresh. In ie7 it doesn't refresh - it just takes longer to load.
string script = string.Format(@"
var {0}invalidInput = false;
var {0}errmessage = '';
function {0}_ShowDetails()
{{
var pnlName = '{0}_pnlDetails';
var myPanel = document.getElementById(pnlName);
if (myPanel != undefined)
{{
myPanel.style.display='block';
var rfvName = '{0}_rfv';
var ReqValidator = document.getElementById(rfvName);
ValidatorEnable(ReqValidator,true);
}}
}}
function {0}_HideDetails()
{{
var pnlName = '{0}_pnlDetails';
var myPanel = document.getElementById(pnlName);
if (myPanel != undefined)
{{
myPanel.style.display='none';
var rfvName = '{0}_rfv';
var ReqValidator = document.getElementById(rfvName);
ValidatorEnable(ReqValidator,false);
}}
}}
function {0}_OnDateSelected(sender, args)
{{
{0}invalidInput = false;
{0}_ShowDetails();
}}
function {0}_OnError(sender, args)
{{
if (args.get_reason() == Telerik.Web.UI.InputErrorReason.ParseError)
{{
{0}errmessage='Date must be in valid format (mm/dd/yyyy)';
{0}invalidInput = true;
}}
else if (args.get_reason() == Telerik.Web.UI.InputErrorReason.OutOfRange)
{{
{0}errmessage='Date out of range';
{0}invalidInput = true;
}}
alert({0}errmessage);
}}
function {0}_CustomValidate(sender, args)
{{
var customVal = document.all ? document.all['{1}'] : document.getElementById('{1}');
customVal.errormessage = {0}errmessage;
if ({0}invalidInput)
args.IsValid = false;
}}
function {0}_OnBlur(sender, args)
{{
if (sender.GetTextBoxValue() == '')
{{
{0}invalidInput = false;
}}
}}"
, this.ClientID, CustomValidator1.ClientID);
RadDatePicker picker = (RadDatePicker)RadDatePicker1;
RadDatePicker1.DateInput.ClientEvents.OnError =
string.Format("{0}_OnError", this.ClientID);
RadDatePicker1.DateInput.ClientEvents.OnBlur =
string.Format("{0}_OnBlur", this.ClientID);
RadDatePicker1.ClientEvents.OnDateSelected =
string.Format("{0}_OnDateSelected", this.ClientID);
CustomValidator1.ClientValidationFunction =
string.Format("{0}_CustomValidate", this.ClientID);
| <ItemTemplate> |
| <div style="background-color:Gray; padding:5px"> <a href="#" onclick="openRadWindow('<%#DataBinder.Eval(Container.DataItem,"ID")%>'); return false;">Test</a> |
| </div> |
| </ItemTemplate> |
RadEditor1.Document.execCommand(
"Cut", false, null);
RadEditor1.Document.execCommand("Copy", false, null);
RadEditor1.Document.execCommand("Paste", false, null);
Also i tried to find any client event for RadEditor but there is no such command that support cut copy paste.
Is there any Client side command for Editor itself that will not introduce this extra <FONT> tag on these Cut, Copy, Paste operation.
Thanks in advance for any fruitfull suggestion.
