Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
581 views
Hi,
I have a RadTreeView with 3 levels child nodes with check boxes.
When user click a button and the page is post back, how can i get all the nodes being checked?
Thanks!
Way Hang Wee
Top achievements
Rank 1
 answered on 10 Mar 2010
5 answers
1.4K+ views
I have a tree view control on a page, but I have a limited amount of space to display it in. I want to minimize the spacing between nodes as much as possible. I've followed the instructions here, but even when I set the relevant margin and padding values to 0px I still get a rather large gap between nodes. After mucking around in the tree view CSS I found that if I added this
.RadTreeView .rtMid, 
.RadTreeView .rtTop, 
.RadTreeView .rtBot 
  height16px
that it got the node spacing to a more acceptable level, but only in IE 7 and 8. In IE 6 the same large gap still exists. I've attached a screen shot to demonstrate. What am I doing wrong? Is there any way to get smaller spacing across all IE versions? It's important that any solution work in IE 6.

Here is the code used to generate the screen shot:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="RadTreeViewExample.Index" %> 
 
<!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>RadTreeView Example</title> 
  <style type="text/css"
    .RadTreeView, 
    .RadTreeView a.rtIn, 
    .RadTreeView .rtEdit .rtIn input 
    { 
       font-size:11px; 
    } 
   .RadTreeView .rtLI 
    { 
       padding-bottom: 0px; 
    } 
    .RadTreeView .rtUL .rtUL 
    { 
       margin-top: 0px; 
    } 
    .RadTreeView .rtLast 
    { 
       padding-bottom: 0; 
    } 
    .RadTreeView .rtMid, 
    .RadTreeView .rtTop, 
    .RadTreeView .rtBot 
    { 
      height: 16px; 
    }   
  </style> 
</head> 
<body> 
  <form id="form1" runat="server"
    <asp:ScriptManager ID="scriptManager" runat="server" /> 
    <telerik:RadTreeView ID="treeView" runat="server" ShowLineImages="false"
      <Nodes> 
        <telerik:RadTreeNode Text="One"
          <Nodes> 
            <telerik:RadTreeNode Text="Child One" /> 
          </Nodes> 
        </telerik:RadTreeNode> 
        <telerik:RadTreeNode Text="Two"
          <Nodes> 
            <telerik:RadTreeNode Text="Child Two" /> 
          </Nodes> 
        </telerik:RadTreeNode> 
        <telerik:RadTreeNode Text="Three"
          <Nodes> 
            <telerik:RadTreeNode Text="Child Three" /> 
          </Nodes> 
        </telerik:RadTreeNode> 
        <telerik:RadTreeNode Text="Four"
          <Nodes> 
            <telerik:RadTreeNode Text="Child Four" /> 
          </Nodes> 
        </telerik:RadTreeNode> 
        <telerik:RadTreeNode Text="Five"
          <Nodes> 
            <telerik:RadTreeNode Text="Child Five" /> 
          </Nodes> 
        </telerik:RadTreeNode> 
      </Nodes> 
    </telerik:RadTreeView> 
  </form> 
</body> 
</html> 
 
There was no extra code in the code behind file.

I'm using Visual Studio 2008 with .NET 3.5 SP1 and Telerik.Web.UI.dll version of 2009.3.1314.35.

Thanks for your help.


Yana
Telerik team
 answered on 10 Mar 2010
9 answers
230 views
Hi,

I've a radeditor and a radcombobox in my usercontrol (.ascx).
My scenario is I need to select some value from radcombobox and insert that value in the RADeditor. I got this working by the below approach.

<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">

<script type="text/javascript">

   function getSelected()
   {
      var obTagCombo = $find('<%=m_radTagCombo.ClientID %>');
      var value = obTagCombo.get_value();
      var text = obTagCombo.get_text();
      var editor = $find("<%=m_radEmailEditor.ClientID%>"); //get a reference to RadEditor client object 
      editor.pasteHtml(text);

   }  
  
</script>
</telerik:RadCodeBlock>

and i have a button  <input type="button" value="Insert Tag" onclick="getSelected();" />
when this button is clicked it inserts the text from combobox and puts it in radeditor.

Note: m_radTagCombo is my name of radcombobox and m_radEmailEditor is my radeditor name.

But my problem is : I've my curor at the radeditor a a particular position. When I select a value from radcombobox, the cursor
position defaults to the begining of the line(first place).
Pls tell me how do I preserve the cursor position without going back to first position when i select value from a combobox.
pls do help me with code.

Eric Bindt
Top achievements
Rank 1
 answered on 10 Mar 2010
7 answers
296 views
Any one else having problems with using the rad progress for monitoring custom progress.

My progress doesn't appear at all. I have implemented the following just to check but this doesn't even work: http://www.telerik.com/help/aspnet-ajax/upload_progresscustomprogress.html

The last version worked fine.

I am using the latest version.
J soeharto
Top achievements
Rank 1
 answered on 10 Mar 2010
1 answer
145 views
Hi.
I have applied a custom css class for one partuclar menu item in my Rad Menu so that it would display an application specific image. 

Problem is that it still seems to be also applying the default class (.rmLink) attributes from the menu css as well.  The menu item displays as intended until the user mouses over the item, then it is applying the .rmLink hover attributes, as well as my custom class attributes. 

What am I missing as far as disabling the default menu css?

<style> 
.LogoItem  
{  
background:url('url to my image') no-repeat -280px -48px;  
cursor:pointer;  
width:100px;  
height:100px;  
vertical-align:top;  
text-align:center;  
}  
 
.LogoItem:hover   
{  
background-repeat:no-repeat;    
background-position: -380px -48px;  
}   
 
</style> 
 
<telerik:RadMenu ID="RadMenu2"  runat="server" Flow="Horizontal" EnableEmbeddedSkins="True" Skin="Default" OnItemClick="RadMenu1_ItemClick">  
            <CollapseAnimation Type="InOutSine" Duration="300" /> 
            <ExpandAnimation Type="InOutSine" Duration="300" /> 
            <Items> 
                <telerik:RadMenuItem runat="server"   
                    DisabledCssClass="LogoItem" ExpandMode="ClientSide"   
                     BorderStyle="none"   
                                        CssClass="LogoItem" ClickedCssClass="LogoItem" ExpandedCssClass="LogoItem" FocusedCssClass="LogoItem"   
                    OuterCssClass="LogoItem" SelectedCssClass="LogoItem">  
                    <Items> 
                    <telerik:RadMenuItem runat="server" Text="Desktop Home" ></telerik:RadMenuItem> 
                        <telerik:RadMenuItem runat="server" Text="Our Website">  
                            <Items> 
                                <telerik:RadMenuItem runat="server" Text="Departments" > 
                                </telerik:RadMenuItem> 
                                <telerik:RadMenuItem runat="server" Text="Services">  
                                </telerik:RadMenuItem> 
                            </Items> 
                        </telerik:RadMenuItem> 
</items> 
        </telerik:RadMenu>    
Yana
Telerik team
 answered on 10 Mar 2010
6 answers
181 views
Dear,

Please can you check where i am doing mistake i follow your example but out put is only one record.

        <asp:SqlDataSource ID="SqlDataSource1" runat="server"
            ConnectionString="<%$ ConnectionStrings:MyH2HDBConnectionString %>"
            SelectCommand="SELECT [Country_Code], [Country_Name], [Supplier_Code] FROM [tblCountry]"></asp:SqlDataSource>
   
    </div>
 <telerik:RadGrid ID="RadGrid1" DataSourceID="SqlDataSource1" AllowFilteringByColumn="true"
            runat="server" GridLines="None" AllowPaging="true" AllowSorting="true" OnPreRender="RadGrid1_PreRender"
            PageSize="6">
            <PagerStyle Mode="NextPrevAndNumeric" />
            <MasterTableView TableLayout="Fixed">
                <ItemTemplate>
               
                    <%#IIf(Not CType(Container, GridItem).ItemIndex = 0, "</td></tr></table>", "")%>
                   
                    <asp:Panel ID="ItemContainer" CssClass='<%# IIf(CType(Container, GridItem).ItemType = GridItemType.Item, "item", "alternatingItem") %>'
                        runat="server">
                        <b>CustomerID:</b>
                        <%# Eval("Country_Code")%>
                        <br />
                        <b>CompanyName:</b>
                        <%# Eval("Country_Name")%>
                        <br />
                       
                 
                    </asp:Panel>
                </ItemTemplate>
            </MasterTableView>
            <GroupingSettings CaseSensitive="false" />
        </telerik:RadGrid>

Regards,
Dimo
Telerik team
 answered on 10 Mar 2010
1 answer
94 views
Hi,
I'm reading about StyleSheetManager. You wrote in documentation: "RadStyleSheetManager merges the RadControls embedded skins", so it doesn't work with custom skins?

Dimo
Telerik team
 answered on 10 Mar 2010
1 answer
68 views
I have folllowed the demo at http://demos.telerik.com/aspnet-ajax/grid/examples/programming/listview/defaultcs.aspx in order to format my grid in a listview fashion - and that works fine.  However, as soon as I try to edit an item the popup edit form does not show anymore and the problem seems to arise due to the code in the protected void RadGrid1_PreRender(object sender, EventArgs e) method since the <table> is being hidden. Could you please suggest a solution or workaround to this?

Thanks
Matthew
Princy
Top achievements
Rank 2
 answered on 10 Mar 2010
1 answer
67 views
We just updated our dll to the latest release and we are getting "was unable to find embedded skin with name 'Gray'."

Where is this skin?  How do we get it back? 

Vincent
Dimo
Telerik team
 answered on 10 Mar 2010
1 answer
119 views
Hello,

I've been trying to come up with a way to modify a value in the grid based on business logic within the application.  For example, if showing a list of employee's, the business logic checks to see if they have access to salary information for the employee's department.  Based on the complexity of the logic, it is done within the applicaiton and not in SQL.

So, if the user does NOT have access to the salary, I would like to change the cell to say "Protected" or something similar.  I can do this fine, however, the user could still sort the grid and infer the salary range based on where the records show up in the sort results.  What I can't figure out how to do is change the underlying value to 0 (zero) when checking this logic.  I have tried doing this in the ItemCreated event and the ItemDataBound event, but whatever I do, it seems to continue knowing how to sort based on the real value and doesn't honor the new 0 (zero) I put in there.  Here is what I have tried....a little overkill now, but I was trying to modify they value everywhere I could.

Does anyone know how to do this?

Thanks,
Chris

void RadGrid1_ItemCreated(object sender, Telerik.Web.UI.GridItemEventArgs e)  
        {  
            if (e.Item.ItemType == Telerik.Web.UI.GridItemType.AlternatingItem || e.Item.ItemType == Telerik.Web.UI.GridItemType.Item)  
            {  
                Telerik.Web.UI.GridDataItem item = (Telerik.Web.UI.GridDataItem)e.Item;  
                System.Data.DataRowView dataRow = (DataRowView)item.DataItem;  
 
                if (dataRow != null && !SecurityManager.HasAccessToGroupByRole(BusinessServices.Security.RoleCode.ViewSalary, dataRow["Dept"].ToString() ))  
                {  
                    item["Annual_Salary"].Text = "Protected";  
                    dataRow["Annual_Salary"] = 0;  
                    ((System.Data.DataRow)dataRow.Row)["Annual_Salary"] = 0;  
                    gridData.Tables[0].Rows[item.DataSetIndex]["Annual_Salary"] = 0;  
 
                }  
 
            }  
        }  
 
void RadGrid1_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)  
{  
    if (e.Item.ItemType == Telerik.Web.UI.GridItemType.AlternatingItem || e.Item.ItemType == Telerik.Web.UI.GridItemType.Item)  
    {  
        Telerik.Web.UI.GridDataItem item = (Telerik.Web.UI.GridDataItem)e.Item;  
        System.Data.DataRowView dataRow = (DataRowView)item.DataItem;  
          
        if (!SecurityManager.HasAccessToGroupByRole(BusinessServices.Security.RoleCode.ViewSalary, dataRow["Dept"].ToString() ))  
        {  
            //item["Annual_Salary"].Text = "Protected";  
            dataRow["Annual_Salary"] = 0;  
            ((System.Data.DataRow)dataRow.Row)["Annual_Salary"] = 0;  
            gridData.Tables[0].Rows[item.DataSetIndex]["Annual_Salary"] = 0;  
              
        }  
 
    }  

Princy
Top achievements
Rank 2
 answered on 10 Mar 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?