Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
275 views
Hi,

I am trying to attach onkeypress eventhandler in onclientload of radeditor. I want to check a checkbox as soon as any alphabet is entered in radeditor.

<telerik:RadEditor runat="server" ID="RadEditor1" ContentAreaMode="Div" EditModes="Design" 
                                 OnClientLoad="OnClientLoad">

<script type="text/javascript">
     function OnClientLoad(editor) {
            editor.AttachEventHandler("onkeypress", function (e) {
                $('#<%=chktext.ClientID %>').attr('checked', true);
            });
        }
</script>

i get a javascript error which says UnCaught Reference Error:OnClientLoad is not defined. What should i do?
Shinu
Top achievements
Rank 2
 answered on 01 Nov 2012
1 answer
57 views
Hi,

I create some Controls (e.g. a button and a div) in CreateChildControls and add them to the RadAjaxManager in OnPreRender.
Finally, I overwrite "RenderContents" to render my own layout. But when doing this, the panel generated by the RadAjaxManager (for the LoadingPanel) isn't rendered. 

Whats the best way to use the RadAjaxManager when I overwrite RenderContents? How can I "force" the RadAjaxManager to render the panel?

Thanks!
Maria Ilieva
Telerik team
 answered on 01 Nov 2012
2 answers
86 views
I have a grid with datasource1 and then I have a gridtableview with datasource2 similar to the example "Grid / Several Tables at a Level"both data sources have a column called Price.

Can I create an aggregate that uses the values from both?

If so, can you point me in the right direction.

Thanks, Marty
moegal
Top achievements
Rank 1
 answered on 01 Nov 2012
1 answer
55 views
Hi,
i have installed the telerik reporting, i couldn't view the designer part, it does not show in the context menu as in attached file. even i have reinstalled the telerik reporting but there is no response it shows as the same. I need a quick Support.







Thanks



     
 
IvanY
Telerik team
 answered on 01 Nov 2012
5 answers
170 views
I have a RadGrid with the EditFormSettings set to WebUserControl. Within the WebUserControl I have a CustomValidator, when I run the update command from the WebUserControl page the CustomValidator is run, but does not stop the page from processing. I am checking for Page.IsValid on my RadGrid_ItemCommand.

Page.aspx
<telerik:RadGrid ID="rgSiteContent" runat="server" CellSpacing="0" GridLines="None" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" onneeddatasource="rgSiteContent_NeedDataSource" onitemcommand="rgSiteContent_ItemCommand">
    <MasterTableView CommandItemDisplay="Top" DataKeyNames="pageid">
        <Columns>
            <telerik:GridTemplateColumn FilterControlAltText="Filter EditCommandColumn column" Groupable="False" UniqueName="EditCommandColumn" HeaderText="Actions">
                <EditItemTemplate>
                    <telerik:RadButton runat="server" CommandName="Update" Text="Update" /> 
                    <telerik:RadButton runat="server" CausesValidation="false" CommandName="Cancel" Text="Cancel" />
                </EditItemTemplate>
                <ItemTemplate>
                    <telerik:RadButton runat="server" CausesValidation="false" CommandName="Edit" Text="Edit" /> 
                    <telerik:RadButton runat="server" CausesValidation="false" CommandName="Delete" Text="Delete" />
                </ItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridBoundColumn DataField="title" FilterControlAltText="Filter title column" HeaderText="Page Title" ReadOnly="True" SortExpression="title" UniqueName="title" />
            <telerik:GridBoundColumn DataField="metadesc" FilterControlAltText="Filter metadesc column" HeaderText="Meta Description" ReadOnly="True" SortExpression="metadesc" UniqueName="metadesc" />
            <telerik:GridBoundColumn DataField="metaword" FilterControlAltText="Filter metaword column" HeaderText="Meta Keywords" ReadOnly="True" SortExpression="metaword" UniqueName="metaword" />
            <telerik:GridHyperLinkColumn FilterControlAltText="Filter pagelink column" HeaderText="Page Link" SortExpression="pagelink" UniqueName="pagelink" DataTextField="pagelink" Target="_blank" DataNavigateUrlFields="pagelink" />
            <telerik:GridBoundColumn DataField="created" DataType="System.DateTime" FilterControlAltText="Filter created column" HeaderText="Created" ReadOnly="True" SortExpression="created" UniqueName="created" />
            <telerik:GridBoundColumn DataField="lastedit" DataType="System.DateTime" FilterControlAltText="Filter lastedit column" HeaderText="Last Edit" ReadOnly="True" SortExpression="lastedit" UniqueName="lastedit" />
            <telerik:GridBoundColumn DataField="fullname" DataType="System.Int32" FilterControlAltText="Filter fullname column" HeaderText="Edited By" ReadOnly="True" SortExpression="fullname" UniqueName="fullname" />
        </Columns>
        <EditFormSettings EditFormType="WebUserControl" UserControlName="~/managers/controls/admin_sitecontent_editor.ascx">
            <EditColumn FilterControlAltText="Filter EditCommandColumn column"></EditColumn>
        </EditFormSettings>
    </MasterTableView>
</telerik:RadGrid>

Page .aspx.cs
protected void Page_Load(object sender, EventArgs e)
{
 
}
protected void rgSiteContent_NeedDataSource(object sender, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
{
    getSiteContent();
}
protected void getSiteContent()
{
    using (SiteDataContext DB = new SiteDataContext())
    {
        var rsSiteContent = from rs in DB.contents
                            where rs.parentid == 0
                            select new
                            {
                                pageid = rs.pageid,
                                pagelink = String.Format("http://www.mysite.com/site/{0}", rs.pagename),
                                pagename = rs.pagename,
                                title = rs.title,
                                metadesc = rs.metadesc,
                                metaword = rs.metaword,
                                created = rs.created,
                                lastedit = rs.lastedit,
                                fullname = String.Format("{0} {1}", rs.tbl_user.firstname, rs.tbl_user.lastname),
                                pagecontent = rs.pagecontent
                            };
        rgSiteContent.DataSource = rsSiteContent.ToList();
    }
}
protected void rgSiteContent_ItemCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e)
{
    if (e.CommandName == RadGrid.UpdateCommandName)
    {
        GridEditFormItem editForm = (GridEditFormItem)e.Item;
        UserControl userControl = (UserControl)editForm.FindControl(GridEditFormItem.EditFormUserControlID);
        
        if (Page.IsValid)
        {
            using (SiteDataContext DB = new SiteDataContext())
            {
                var rsSiteContent = (from rs in DB.contents where rs.pageid == Convert.ToInt32(editForm.GetDataKeyValue("pageid")) select rs).SingleOrDefault();
                rsSiteContent.pagename = ((RadTextBox)userControl.FindControl("pagelinkTextBox")).Text;
                rsSiteContent.title = ((RadTextBox)userControl.FindControl("pagetitleTextBox")).Text;
                rsSiteContent.pagecontent = (((RadEditor)userControl.FindControl("contentEditor"))).Content;
                rsSiteContent.metadesc = ((RadTextBox)userControl.FindControl("metadescTextBox")).Text;
                rsSiteContent.metaword = ((RadTextBox)userControl.FindControl("metawordTextBox")).Text;
                rsSiteContent.lastedit = DateTime.Now;
                rsSiteContent.editby = Profile.UserID;
                DB.SubmitChanges();
            }
        }
    }
}

WebUserControl ascx
<asp:CustomValidator ID="editcontentCustomValidator" runat="server" ControlToValidate="pagetitleTextBox" ValidationGroup="editcontentValidationGroup" onservervalidate="editcontentCustomValidator_ServerValidate" Font-Bold="true" ForeColor="Red" ValidateEmptyText="true" /> 
<table style="width:100%;">
    <tr>
        <td colspan="2"
            <telerik:RadButton runat="server" CommandName="Update" CausesValidation="true" Text="Save" ValidationGroup="editcontentValidationGroup" /> 
            <telerik:RadButton runat="server" CommandName="Cancel" CausesValidation="false" Text="Cancel" />
        </td>
    </tr>
    <tr>
        <td style="width:110px;">Page Link:</td>
        <td><telerik:RadTextBox ID="pagelinkTextBox" Runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.pagename") %>' Width="800px" /></td>
    </tr>
    <tr>
        <td style="width:110px;">Page Title:</td>
        <td><telerik:RadTextBox ID="pagetitleTextBox" Runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.title") %>' Width="800px" /></td>
    </tr>
    <tr>
        <td style="width:110px;">Meta Description:</td>
        <td><telerik:RadTextBox ID="metadescTextBox" Runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.metadesc") %>' Width="800px" /></td>
    </tr>
    <tr>
        <td style="width:110px;">Meta Keywords:</td>
        <td><telerik:RadTextBox ID="metawordTextBox" Runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.metaword") %>' Width="800px" /></td>
    </tr>
    <tr>
        <td colspan="2">Page Content:</td>
    </tr>
    <tr>
        <td colspan="2">
            <telerik:RadEditor ID="contentEditor" Runat="server" Width="940px"  Content='<%# DataBinder.Eval(Container, "DataItem.pagecontent") %>' ContentAreaCssFile="~/Styles/RadEditor.css" ContentAreaMode="Div" Height="800px"  NewLineMode="Br" />
        </td>
    </tr>
</table>

WebUserControl ascx.cs
protected void Page_Load(object sender, EventArgs e)
{
 
}
protected void editcontentCustomValidator_ServerValidate(object source, ServerValidateEventArgs args)
{
    List<string> strErrors = new List<string>();
    if (pagelinkTextBox.Text.Count() > 0)
    {
        using (SiteDataContext DB = new SiteDataContext())
        {
            var rsCheckDupPageName = from rs in DB.contents where rs.pagename == pagelinkTextBox.Text select rs;
            if (rsCheckDupPageName.Count() > 1)
            {
                strErrors.Add("Duplicate Page Links are not allowed.");
            }
        }
    }
    else
    {
        strErrors.Add("Page Link is required.");
    }
    if (pagetitleTextBox.Text.Count() <= 0)
    {
        strErrors.Add("Page Title is required.");
    }
    if (metadescTextBox.Text.Count() <= 0)
    {
        strErrors.Add("Meta Description is required.");
    }
    if (metawordTextBox.Text.Count() <= 0)
    {
        strErrors.Add("Meta Keywords are required.");
    }
    if (contentEditor.Text.Count() <= 0)
    {
        strErrors.Add("Page Content is required.");
    }
    if (strErrors.Count() > 0)
    {
        string strErrorMessage = String.Empty;
        foreach (string errors in strErrors)
        {
            strErrorMessage = String.Format("{0}<br />", errors);
        }
        editcontentCustomValidator.IsValid = false;
        editcontentCustomValidator.ErrorMessage = strErrorMessage;
    }
}


Maria Ilieva
Telerik team
 answered on 01 Nov 2012
4 answers
119 views
Hello,

I modeled our dropdown very similar to this example:
http://demos.telerik.com/aspnet-ajax/controls/examples/integration/gridincombobox/defaultcs.aspx?product=combobox

I am using twitter bootstrap as well as your controls within a site.  I am having some issues with the radcombox in that when I turn EnableEmbeddedBaseStylesheet=true it will allow me to scroll and select items within the combobox like i want.  The radcombox however is taking the look of the embedded style sheet which i do not want.  if i turn it to false it now looks like i want it but when i enter an entry into the combox my information displays but I can no longer scroll through the returned items or select them.  Anyone else run into this and how did you fix it?  

Thanks,


<telerik:RadComboBox ID="rcmbSKU" Width="340px" runat="server" MarkFirstMatch="True" CssClass="SKUCombo" EnableEmbeddedBaseStylesheet="false" EnableEmbeddedSkins="false"
            AllowCustomText="True" OnClientDropDownOpening="HandleOpen" ExpandAnimation-Type="None"
            CollapseAnimation-Type="None" DropDownWidth="340px" onkeyup="HandleKeyPressed(this)">
            <ItemTemplate>
                <telerik:RadGrid ID="rgridSKU" Width="325px" runat="server" OnNeedDataSource="rgridSKU_NeedDataSource" EnableEmbeddedBaseStylesheet="true" EnableEmbeddedSkins="true">
                    <MasterTableView NoMasterRecordsText="" AutoGenerateColumns="False" DataKeyNames="ItemCode, ItemKey, Description"
                        Width="100%" ClientDataKeyNames="ItemCode, ItemKey, Description" TableLayout="Fixed">
                        <Columns>
                        <telerik:GridBoundColumn HeaderText="SKU" DataField="ItemCode" UniqueName="ItemCode">
                                <HeaderStyle Width="90px"></HeaderStyle>
                            </telerik:GridBoundColumn
                             
                            <telerik:GridBoundColumn HeaderText="Description" DataField="Description" UniqueName="Description">
                                <HeaderStyle Width="215px"></HeaderStyle>
                            </telerik:GridBoundColumn>
                        </Columns>
                    </MasterTableView>
                    <ClientSettings>
                        <ClientEvents OnRowClick="RowClicked" OnGridCreated="GridCreated"></ClientEvents>
                        <Scrolling AllowScroll="true" UseStaticHeaders="true" ScrollHeight="300px"></Scrolling>
                    </ClientSettings>
                </telerik:RadGrid>
            </ItemTemplate>
            <Items>
                <telerik:RadComboBoxItem runat="server" Text=" "></telerik:RadComboBoxItem>
            </Items>
        </telerik:RadComboBox>
Nencho
Telerik team
 answered on 01 Nov 2012
1 answer
123 views
Hi 

I am trying to implement a org chart for my organization.  In addtion to the staffs reporting to the superior, there is also a position called 'Assistant' working to the superior specifically, in which I would like to put this position as separate level against other subordinate.   The person who is assistant have the property isAssistant flag in SQL Table.  


Please advise How can I do it in ASP.net, I am using VB.net, Linq and SQL 2012.  The attached image is for your reference.  

And also, is it possible to set the block of the chart with whilte background color?  Thanks.


Patrick

Peter Filipov
Telerik team
 answered on 01 Nov 2012
1 answer
587 views
Hello,
i want to disable this functionality - expand and collapse. When i loaded my tree I using tree.ExpandAllNodes().
After that i hidden buttons(checkboxes) for this activity, but now they are invisible but they work.
Princy
Top achievements
Rank 2
 answered on 01 Nov 2012
1 answer
89 views
hello,
I am having a problem of adding a separator to the RibbonBarMenuItem in a ribbonbargroup!
Is there any way to add one?
thank you for your help!
Bozhidar
Telerik team
 answered on 01 Nov 2012
5 answers
196 views
I have a RadGrid with a simple NoRecordsTemplate, just an asp:Panel containing an asp:Label. The label text is fairly long. I do not want the text to wrap, so I specified white-space:nowrap in the css class for the panel. The panel displays narrower than the text, and the text is cut off partway (and outside of the panel). If I add a specific width to the panel, it is cut off as well. I have ShowHeadersWhenNoRecord set to true, and it appears as if the no records template is being placed in a table cell the width of the first column, which would explain why it is being cut off. How do I make the no record template span multiple columns so the full width of it will be displayed?

And as a follow up: Can I put in a request that the cell the no records template is placed in be set to colspan ALL of the table columns? Since there is no data to display anyway, and thus no grid, this certainly shouldn't hurt anything, and would give us much more flexibility in the use of the no records template. 
Antonio Stoilkov
Telerik team
 answered on 01 Nov 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?