Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
164 views
Hi,
If I drag a treeview control onto my page and set the DataFieldParentID, I get the treeview correctly displaying with multi-levels of nodes/hierarchy.

However - if I try to create a treeView from my code like this:

            radTreeView.DataTextField = "CategoryName"; 
            radTreeView.DataValueField = "ID"; 
            radTreeView.DataFieldParentID = "ParentCategory"; 
            radTreeView.CheckBoxes = true; 
            radTreeView.DataSource = myDataSource; 
            radTreeView.DataBind(); 
            
            this.Controls.Add(radTreeView); 
The treeview just displays all the nodes at the same, top level - so there's there's no tree to it. It seems to be ignoring the ParentCategory field that I bound to the DataFieldParentID property.

Any ideas? And also - As this is a dynamically created control, I'm having trouble picking up the selected nodes. I'm adding the control at OnInit and Viewstate is enabled. Is there anything I need to do?

Thanks.


John
Top achievements
Rank 1
 answered on 19 Feb 2010
3 answers
168 views
Hi,
I'm using RadEditor. All work good, but after inserting silverlight object some problem appears:
1. DialogWindow(Image Manager, Document Manager ...) shape was showen under silverlight object, at the same time content of this dialogs  is over silverlight
2. Toolbar dropdowns are also showen under silverlight

Help me please to solve this problem.

Here is the Html example:

<object width="739" height="433" data="data:application/x-silverlight-2," type="application/x-silverlight-2" style="width: 739px; height: 433px;">
<param name="source" value="/Silverlight/Example.xap"/>
<param name="windowless" value="false"/>
<param name="minRuntimeVersion" value="2.0.31005.0"/>
<param name="autoUpgrade" value="true"/><a href="http://go.microsoft.com/fwlink/?LinkID=124807" style="text-decoration: none;"><img src="http://go.microsoft.com/fwlink/?LinkId=108181" alt="Get Microsoft Silverlight" style="border-style: none;"></a></object><img alt="product logo" src="../../Img/productLogoLight.gif" />is the successor of the well known industry standard Editor for ASP.NET. The tight integration with ASP.NET AJAX and the powerful new capabilities make Telerik's WYSIWYG Editor a flexible and lightweight component, turning it into the fastest loading Web Editor. Among the hottest features are:
<ul>
    <li><em>Single-file, drag-and-drop deployment</em> </li>
    <li><em>Built on top of ASP.NET AJAX</em> </li>
    <li><em>Unmatched loading speed with new semantic rendering </em></li>
    <li><em>Full keyboard accessibility</em> </li>
    <li><em>Flexible Skinning mechanism</em> </li>
    <li><em>Simplified and intuitive toolbar configuration</em> </li>
    <li><em>Out-of-the-box XHTML-enabled output</em> </li>
</ul>
Svetlina Anati
Telerik team
 answered on 19 Feb 2010
6 answers
185 views
A picture is worth a thousand words:

The problem...


As you can hopefully see, when I select a row that is taller than the selected row image, I get rather ugly results.

I tried adding the following to my main CSS file, hoping to override the repeat-x which is set in the grid.css.  No joy, possibly because I don't have 'Grid/sprite.gif' in my website?
.RadGrid_Office2007 .rgSelectedRow  
{  
    background:#ffcb60 0 -3900px repeat url('Grid/sprite.gif');  
} 

Any suggestions?

Thanks,
  Chris

 

 

Craig
Top achievements
Rank 1
Iron
 answered on 19 Feb 2010
1 answer
126 views
Hey guys,
Is there a way to to set indentation of a node with sub nodes so that it's expand/collapse icon is flush left with the text of nodes that do not have sub nodes?
Thanks in advance,
mdk
Yana
Telerik team
 answered on 19 Feb 2010
3 answers
93 views
Good Day to you.

I have been using telerik controls for some times now.  We had this site where telerik controls are implemented. 

Our site is composed of different controls.
We have 3 panels separated using RadSplitter. RadPanelbars in the left, grids in the center and docks with panel with grid in the side.

During the development we notice that our site loads slowly.......
It would take us 5 to 10 seconds to load the site.  The controls will load lastly.

We have observed that the CPU Usage of our site is 20%-30% in standby mode(doing nothing after loading with out mouse movements)

I have read Your Tutorials about Optimizition Tips
This is what i did so far.

RadScriptManager- I put it in my main page but did not use its reference property since my javascripts are in the same page of my code
RadStyleSheetManager -Put it in my mainpage but didnot use its reference property since i did not costumize my telerik control's skin. My Css is Attached using  <link href="
Debug - i already set it to false and I am using II7

So far from the above it does not give me a better CPU Usage of my site.
I think the control RadPanelBar is the one using most of the CPU since if i remove it in the code or hide it using the splitter my CPU Usage is 5%-10%. I also notice that when i press ESC after page load. the CPU Usage is going down.

I would appriciate if you could help me optimize my CPU Usage.

Thanks

Kamen Bundev
Telerik team
 answered on 19 Feb 2010
4 answers
233 views
Hi,

I have in a control a ComboBox where item are load on Demand.
When we whant to update the data i try to retreive the value with SelectedValue but off course the list is empty.
I alreay read many item on this forum but i cannot find any solution about this!!!!

What is the solution for this problem please?

The code is:

 <telerik:RadComboBox runat="server" ID="ddl_ParentCustomer" Width="410px" Height="300px" 
                                EnableLoadOnDemand="true" HighlightTemplatedItems="true" EnableVirtualScrolling="true" 
                                OnItemsRequested="RadComboBoxCustomerOnItemsRequested" OnItemDataBound="RadComboBoxCustomerOnItemDataBound" 
                                EmptyMessage="-Selecteer-">  
                                <HeaderTemplate> 
                                    <table border="0" cellpadding="0" cellspacing="0" width="100%">  
                                        <tr> 
                                            <td style="width: 220px;">  
                                                ComapanyName  
                                            </td> 
                                            <td style="width: 50px;">  
                                                ZipCode  
                                            </td> 
                                            <td> 
                                                City  
                                            </td> 
                                        </tr> 
                                    </table> 
                                </HeaderTemplate> 
                                <ItemTemplate> 
                                    <table border="0" cellpadding="0" cellspacing="0" width="100%">  
                                        <tr> 
                                            <td style="width: 220px;">  
                                                <%# Eval("Name")%> 
                                            </td> 
                                            <td width="50px;">  
                                                <%# Eval("ZipCode")%> 
                                            </td> 
                                            <td> 
                                                <%# Eval("City")%> 
                                            </td> 
                                        </tr> 
                                    </table> 
                                </ItemTemplate> 
                            </telerik:RadComboBox> 


C# code is:
I suppose on my method SetValues, I need to load the parent customer. But all? if I try to load all customer in the comboBox, i have a error on the method OnItemDataBound!!!!!

 protected void RadComboBoxCustomerOnItemsRequested(object o, RadComboBoxItemsRequestedEventArgs e)  
        {  
            string sFilter = e.Text;  
 
            // safety check  
            if (sFilter.Length > 100 || sFilter.IndexOf(";") != -1) return;  
 
            ddl_ParentCustomer.Items.Clear();  
 
            var customers = (from c in Customer.GetAllParentCustomers()  
                             where c.Name.StartsWith(sFilter)  
                             select new  
                                        {  
                                            CustomerId = c.Id,  
                                            c.Name,  
                                            c.ZipCode,  
                                            c.City  
                                        }).Page((e.NumberOfItems / 20) + 1, 20).ToList();  
 
            ddl_ParentCustomer.DataSource = customers;  
            ddl_ParentCustomer.DataBind();  
        }  
 
        protected void RadComboBoxCustomerOnItemDataBound(object sender, RadComboBoxItemEventArgs e)  
        {  
            object o = e.Item.DataItem;  
            e.Item.Text = o.GetType().GetProperty("Name").GetValue(o, null).ToString();  
            e.Item.Value = o.GetType().GetProperty("CustomerId").GetValue(o, null).ToString();  
        }  
 
public void SetValues(Customer customer)  
{  
 if(customer.ParentCustomerId > 0)  
{  
  ddl_ParentCustomer.SelectedValue = customer.ParentCustomerId.ToString();  
}  
 
} 


Any idee about a solution?

Thanks,

Edwin.

Yana
Telerik team
 answered on 19 Feb 2010
3 answers
186 views
Hi,

I have a treeview that I'm using to provide a set of controls on each node.  There is the normal node text, a textbox and a checkbox.  I've got it all working except for reading the data back.  My routine can't use Node.FindControl to find any of the controls that I've created.  Some relevant snippets of code are shown below. 

I've read that I need to reallocate the template to the nodes on the ajax callback.  How do I go about this? (current update code at the bottom).

Regards,

Jon

'CODE FOR GENERATING THE TREE  
 
            uxRadTreeView.DataTextField = "LocationCombo" 
            uxRadTreeView.DataFieldID = "AuditEntryID" 
            uxRadTreeView.DataValueField = "AuditEntryID" 
            uxRadTreeView.DataSource = groups  
            uxRadTreeView.DataBind()  
            Dim template As NodeTemplate = New NodeTemplate()  
            template._InEditMode = _InEditMode  
            For Each node As RadTreeNode In uxRadTreeView.GetAllNodes()  
                template.InstantiateIn(node)  
                node.Expanded = True 
                node.DataBind()  
            Next 
 
' TEMPLATE CODE  
        Class NodeTemplate  
            Implements ITemplate  
            Public _InEditMode As Boolean 
 
            Public Sub New()  
            End Sub 
 
            Public Sub InstantiateIn(ByVal container As Control) Implements System.Web.UI.ITemplate.InstantiateIn  
                Dim uxLocationCombo As Label = New Label()  
                uxLocationCombo.ID = "uxLocationCombo" 
                uxLocationCombo.Width = 300  
                AddHandler uxLocationCombo.DataBinding, AddressOf nodeText_DataBinding  
                container.Controls.Add(uxLocationCombo)  
 
                If _InEditMode Then 
                    Dim uxScore As RadNumericTextBox = New RadNumericTextBox()  
                    uxScore.ID = "uxScore" 
                    uxScore.Enabled = True 
                    uxScore.Width = 60  
                    uxScore.MinValue = 1  
                    uxScore.MaxValue = 5  
                    uxScore.ShowSpinButtons = True 
                    uxScore.NumberFormat.DecimalDigits = 0  
                    AddHandler uxScore.DataBinding, AddressOf uxScore_DataBinding  
                    container.Controls.Add(uxScore)  
                Else 
                    Dim uxScore As Label = New Label()  
                    uxScore.ID = "uxScore" 
                    uxScore.Enabled = True 
                    uxScore.Width = 60  
                    AddHandler uxScore.DataBinding, AddressOf uxScoreLabel_DataBinding  
                    container.Controls.Add(uxScore)  
                End If 
 
 
                Dim uxNotScored As CheckBox = New CheckBox()  
                uxNotScored.ID = "uxNotScored" 
                uxNotScored.Enabled = _InEditMode  
                uxNotScored.Width = 60  
                AddHandler uxNotScored.DataBinding, AddressOf uxNotScoredCheckbox_DataBinding  
                container.Controls.Add(uxNotScored)  
            End Sub 
 
            Private Sub uxScoreLabel_DataBinding(ByVal sender As Object, ByVal e As EventArgs)  
                Try 
                    Dim target As Label = DirectCast(sender, Label)  
                    Dim node As RadTreeNode = DirectCast(target.BindingContainer, RadTreeNode)  
                    target.Text = node.Attributes("Score").ToString()  
                    'target.Attributes("onClick") = "onNodeClick(" & node.Attributes("DocumentTypeID").ToString() & ");"  
                Catch ex As Exception  
                End Try 
            End Sub 
 
            Private Sub uxScore_DataBinding(ByVal sender As Object, ByVal e As EventArgs)  
                Try 
                    Dim target As RadNumericTextBox = DirectCast(sender, RadNumericTextBox)  
                    Dim node As RadTreeNode = DirectCast(target.BindingContainer, RadTreeNode)  
                    target.Text = node.Attributes("Score").ToString()  
                    'target.Attributes("onClick") = "onNodeClick(" & node.Attributes("DocumentTypeID").ToString() & ");"  
                Catch ex As Exception  
                End Try 
            End Sub 
 
            Private Sub uxNotScoredCheckbox_DataBinding(ByVal sender As Object, ByVal e As EventArgs)  
                Try 
                    Dim target As CheckBox = DirectCast(sender, CheckBox)  
                    Dim node As RadTreeNode = DirectCast(target.BindingContainer, RadTreeNode)  
                    target.Checked = CBool(node.Attributes("NotScored").ToString())  
                    'target.Attributes("onClick") = "onNodeClick(" & node.Attributes("AuditEntryID").ToString() & ");"  
                Catch ex As Exception  
                End Try 
            End Sub 
 
            Private Sub nodeText_DataBinding(ByVal sender As Object, ByVal e As EventArgs)  
                Try 
                    Dim target As Label = DirectCast(sender, Label)  
                    Dim node As RadTreeNode = DirectCast(target.BindingContainer, RadTreeNode)  
                    target.Text = node.Attributes("LocationCombo").ToString()  
                    'target.Attributes("onClick") = "onNodeClick(" & node.Attributes("DocumentTypeID").ToString() & ");"  
                Catch ex As Exception  
                End Try 
            End Sub 
        End Class 
 
 
 
' CODE IN THE UPDATE BUTTON CALLBACK  
 
                For Each node As RadTreeNode In uxRadTreeView.Nodes  
 
                    i += 1  
                    idArray(i) = node.Value  
                    scoreArray(i) = DirectCast(node.TemplateControl.FindControl("uxScore"), RadNumericTextBox).Value.ToString()  
                    If DirectCast(node.TemplateControl.FindControl("uxNotScored"), CheckBox).Checked Then 
                        noScoreArray(i) = "1" 
                    Else 
                        noScoreArray(i) = "0" 
                    End If 
 
                Next 
Yana
Telerik team
 answered on 19 Feb 2010
3 answers
197 views
I am having some trouble getting a scale break to display on my chart.

I only want to have 10 labels on the Y axis so in the BeforeLayout event I do the following

            double max = Math.Floor(chart.PlotArea.YAxis.MaxValue); 
            double step = Math.Round( max / 10); 
 
            chart.PlotArea.YAxis.Clear(); 
            chart.PlotArea.YAxis.AutoScale = false; 
            chart.PlotArea.YAxis.AddRange(0, max, step); 
 
            AxisSegment seg = new AxisSegment(); 
            seg.Name = "asdfasdfasdf"; 
            seg.MaxValue = 3000; 
            seg.MinValue = 100; 
            seg.Step = 1000; 
 
            chart.PlotArea.YAxis.ScaleBreaks.Segments.Add(seg); 
            chart.PlotArea.YAxis.ScaleBreaks.MaxCount = 1; 
            chart.PlotArea.YAxis.ScaleBreaks.Enabled = true; 
 

The range is displays correctly. But when I turn ScaleBreaks.Enabled = true nothing displays on the Y axis. The range does not appear and neither does the ScaleBreak.

Seems like it should be fairly straight forward... anyone have any ideas on why this does not work.

Thanks!


Bartholomeo Rocca
Top achievements
Rank 1
 answered on 19 Feb 2010
1 answer
56 views
 
WMPagina is a Rad window manager 

var wlogin = WMPagina.Windows.Find(delegate(RadWindow w) { return w.ID == "LoginWindow"; });  
                wlogin.AutoSize = true;  
                wlogin.VisibleOnPageLoad = true;  
                

I in Q2 version of telerik ajax control i'll be able to find a radwindow by id, now the collection does not expose the find method.

How can i correct this?

obviously i can iterate wit a for each but it is possible to have a quick way the same result??

Thanks
Andrea Del brocco
Svetlina Anati
Telerik team
 answered on 19 Feb 2010
5 answers
159 views
Hi,

We have a toolbar button which is set up like this:  

 

<telerik:RadToolBarButton runat='server' ImageUrl='~/Images/monitor.png' Value='Monitored' 
    CommandName='Monitored' Text='Monitored' Enabled='false' CheckOnClick='true'>  
</telerik:RadToolBarButton> 

 

In the code behind, during Page_Load, we set button.Checked = true;

In the described state, its style flicks from Checked to Unchecked whenever the cursor hovers over the button. It also seems to do some sort of ajax call when this happens. I tried catching the OnMouseOver event of the toolbar in order to cancel the event but it won't fire when the button is disabled. Is there a way to ensure that the button can be set to checked and disabled in the Code Behind and will not respond to any user action?




 

 

 

 

Kamen Bundev
Telerik team
 answered on 19 Feb 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?