Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
147 views
Hi

I've bound my RadTabStrip to a SiteMapDataSource and want to hide or disable certain tabs depending on SiteMapNodeAttributes. But my settings (enabled/visible) are ignored. 

(GetBool() is a function to test and cast the value, true is the fallback value.)
 
        protected override void OnTabDataBound(telerik.RadTabStripEventArgs e) 
        { 
            e.Tab.Enabled = (e.Tab.DataItem as System.Web.SiteMapNode)["enabled"].GetBool(true); 
            e.Tab.Visible = (e.Tab.DataItem as System.Web.SiteMapNode)["visible"].GetBool(true); 
 
            base.OnTabDataBound(e); 
        } 

The only way to hide a tab was by removing it completly...
 
            if (!(e.Tab.DataItem as System.Web.SiteMapNode)["visible"].GetBool(true)) 
            { 
                this.Tabs.Remove(e.Tab); 
            } 

So when is the right moment to do this? I tried it in OnDataBound but then the DataItem of the node is empty...
Softec
Top achievements
Rank 1
 answered on 09 Sep 2009
10 answers
400 views
Hi,

I'm loading tooltip using radtooltipmanager from the main page. The content of the tooltip is a usercontrol.
I can't get reference to the control inside the usercontrol using javascript.

Main Page :

<%@ Register TagPrefix="pd1" TagName="popup_detail" Src="~/.../collection/WebUserControl.ascx" %> 
 
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server"
 
<script type="text/javascript"
 
function change_image(id_cl, id_modele, photo) 
var img = $get('<%=popup_detail.FindControl("Image2").ClientID %>'); 
 
img.src = "http://www.iii.com/photos/modeles/2009/" + id_cl + "/l/" + id_modele + "_" + photo + ".jpg"; 
 
}</script> 
 
    </telerik:RadCodeBlock> 
 
<telerik:RadToolTipManager runat="server" ID="RadToolTipManager1" Position="MiddleRight" 
            Skin="Default" ManualClose="true" Animation="Fade" RelativeTo="BrowserWindow" 
            Width="810px" Height="650px" ShowCallout="False" OnAjaxUpdate="OnAjaxUpdate"  
            ShowEvent="OnClick" /> 

Protected Sub OnAjaxUpdate(ByVal sender As Object, ByVal args As ToolTipUpdateEventArgs) 
        Me.UpdateToolTip(args, args.UpdatePanel) 
    End Sub 
    Private Sub UpdateToolTip(ByVal args As Object, ByVal panel As UpdatePanel) 
         
        Dim ctrl As Control = Page.LoadControl("WebUserControl.ascx") 
        panel.ContentTemplateContainer.Controls.Add(ctrl) 
    End Sub 

The usercontrol :

<asp:Image ID="Image2" runat="server" /> 
 <href="#" onclick="change_image(<%=request.querystring("id_cl")%><%# DataBinder.Eval(Container.DataItem, "id_modele") %><%# DataBinder.Eval(Container.DataItem, "nbrphotos") %>); return false;">blabla</a> 


My problem is here :
var img = $get('<%=popup_detail.FindControl("Image2").ClientID %>');

I can't get reference to the image2.

I tried
var img = $get('<%=Image2.ClientID %>');
var img = document.getElementById('<%=Image2.ClientID %>');
var img = document.getElementById('<%=popup_detail.FindControl("Image2").ClientID %>');

etc ... without sucess.

Thank you







arnaud
Top achievements
Rank 1
 answered on 09 Sep 2009
4 answers
136 views

Hi Telerik supporters,

In the progress of implementing my task, I met a strange behavior in Telerik Radlistbox control.

I have a Radlistbox with 5 items:

Item1

Item2

Item3

Item4

Item5

Select the first three items (item1, item2, item3); drag these three items and drop at the position after item5 (separator points at end of list box).

Nothing happens meanwhile it should be:

 

Item4

Item5

Item1

Item2

Item3

This occurs for a range of items which is equal or greater than 3. The list box reordering works fine while dropping with only one item.

Is there a work around solution? Any advice are all appreciated.

 

Thanks and regards,

PhuongTo

 

Veselin Vasilev
Telerik team
 answered on 09 Sep 2009
1 answer
143 views
The treeview has two to three levels of nodes with checkboxes (CheckBoxes="True" TriStateCheckBoxes="True" CheckChildNodes="True"). The intention is to allow the user to select one node out of all of them. Upon selecting, all nodes except the one that they have selected are disabled. Upon unchecking the previously checked node, all the nodes within the tree are re-enabled. For some reason this only works as long as the user selects any of the most child nodes within the tree. If an intermediate/parent or root node is selected, it can not be de-selected. Upon debugging I see that I am always getting a value of "e.Node.Checked=true" upon NodeChecked! However the client side code does indicate correctly that the state of the checkbox has changed.

<telerik:RadTreeView ID="TreeViewRoles" runat="server" CheckBoxes="True" TriStateCheckBoxes="True" CheckChildNodes="True" Skin="WebBlue" OnClientNodeChecked="onNodeClicked" OnNodeCheck="TreeViewRoles_NodeCheck" Height="290px"></telerik:RadTreeView>

The following code works just fine if the node is a child most node:

Protected Sub TreeViewRoles_NodeCheck(ByVal sender As Object, ByVal e As Telerik.Web.UI.RadTreeNodeEventArgs) Handles TreeViewRoles.NodeCheck
    
If e.Node.Checkable Then
        
Dim checked As Boolean = e.Node.Checked

        'Assuming that the tri-state was partly an issue this work around was tried but with no effect…

        Dim checkedState As Telerik.Web.UI.TreeNodeCheckState = e.Node.CheckState

        checked = IIf(checkedState = Telerik.Web.UI.TreeNodeCheckState.Checked, True, False)
        
Dim NodeUniqueID As String = e.Node.Attributes("UniqueID").ToString()
        
For Each rootNode As Telerik.Web.UI.RadTreeNode In TreeViewRoles.Nodes
            
EnableNode(rootNode, Not checked, NodeUniqueID)
        
Next
    
End If

End Sub

  

Private Sub EnableNode(ByVal node As Telerik.Web.UI.RadTreeNode, ByVal enable As Boolean, ByVal checkedNodeUniqueID As String)

    If node.Nodes.Count > 0 Then
        
For Each childNode As Telerik.Web.UI.RadTreeNode In node.Nodes
            
EnableNode(childNode, enable, checkedNodeUniqueID)
        
Next
    
End If
    
If node.Attributes("UniqueID").ToString() <> checkedNodeUniqueID Then node.Enabled = enable
    
Debug.Print("Node:" + node.Attributes("UniqueID").ToString() + " Checked: " + node.Checked.ToString() + " / " + PadText(node.CheckState.ToString() + " NodeName: " + node.Text)

End Sub


The following client side code shows that the checkbox's state has changed:

function onNodeClicked(sender, args)

{

    var node = args.get_node();

    alert("Level:" + node.get_attributes().getAttribute("NodeLevel") + "\nChecked:" + node.get_checked() + "\n");

}


Is there something that I am missing with respect to tri-state checkboxes in the nodes? Why am I not getting the checked=false when a user unchecks it?

Yana
Telerik team
 answered on 09 Sep 2009
3 answers
282 views
I have a fixed size RadWindow opening as a modal popup window for my application.  Within this window I have multiple time/date pickers with some near the edge of the window, how can i make the calendar or time popup float above the window rather than make the window's scroll bars appear?  is it even possible since the window is an iFrame and the popups are within the frame?
Shinu
Top achievements
Rank 2
 answered on 09 Sep 2009
3 answers
134 views
It appears that this is selecting parent Nodes as well if the value matches.  Is this a bug?

As a workaround, I am setting attributes only on nodes that have parents and then doing FindNodeByAttribute but would like to use the FindChildNodeByValue rather than the setup for appending attributes.  Is there an additional setting that is needed?
Yana
Telerik team
 answered on 09 Sep 2009
1 answer
165 views
Hi,
 I am using the Q1 2009 RAD AJAX control for ASP.NET. I hvae an odd problem when using a GridDropDownListColumnEditor to modify the width of the dropdownbox in edit mode. When the grid is not in edit mode the first row does not display a value for the field that is bound to the dropdown column. The value is correctly picked up in edit mode and in all the other rows. If i remove the column editor ID from the dropdown column all the values are displayed as expected.

The GridTextBoxColumnEditor works as expected.

Thanks

Chris

ASPX Code
<%@ Control Language="C#" AutoEventWireup="true"  
        CodeFile="TuteeTargetGrades.ascx.cs"  
        Inherits="usercontrols_TuteeTargetGrades" %> 
<%@ Import Namespace="System.ComponentModel"%> 
         
<%@ Register assembly="Telerik.Web.UI, Version=2009.1.311.20, Culture=neutral, PublicKeyToken=121fae78165ba3d4"  
        namespace="Telerik.Web.UI" tagprefix="telerik" %> 
 
<%@ Register assembly="AjaxControlToolkit, Version=1.0.20229.25335, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e"  
        namespace="AjaxControlToolkit" tagprefix="cc1" %> 
 
<telerik:RadAjaxManagerProxy runat="server" ID="rampChild" > 
</telerik:RadAjaxManagerProxy> 
 
<telerik:RadAjaxLoadingPanel Runat="server" height="75px" width="75px"  
    ID="alpMain" Transparency="20" BackColor="White"  
    HorizontalAlign="Center" > 
    <br /> 
    <br /> 
    <img alt="Loading..." src='<%= RadAjaxLoadingPanel.GetWebResourceUrl(Page, "Telerik.Web.UI.Skins.Default.Ajax.loading.gif") %>' 
        style="border: 0px;" /> 
</telerik:RadAjaxLoadingPanel> 
 
<asp:UpdatePanel ID="updMain" runat="server"  UpdateMode="Conditional"
<ContentTemplate> 
<asp:Panel ID="pnlCommonList" runat="server" Width="100%"
    <span class="ec-smartpart" > 
        <telerik:RadGrid runat="server" ID="rgMaster" DataSourceID="dsMaster"  
        AutoGenerateColumns="false" AllowSorting="true"  
        onprerender="rgMaster_PreRender" AllowMultiRowEdit="true"  
        ondetailtabledatabind="rgMaster_DetailTableDataBind"  
        onitemcommand="rgMaster_ItemCommand"  
        onupdatecommand="rgMaster_UpdateCommand" 
        Skin="Sunset" oncancelcommand="rgMaster_CancelCommand" TableLayout="Auto"
             
            <MasterTableView Name="Master" DataSourceID="dsMaster" DataKeyNames="pupil_code" EditMode="InPlace"
                <DetailTables> 
                    <telerik:GridTableView Name="Detail" EditMode="InPlace" runat="server"  
                                        DataKeyNames="unique_id" DataSourceID="dsDetail" 
                                         AutoGenerateColumns="false" AllowAutomaticUpdates="true" 
                                         width="100%" TableLayout="Auto"
                        <ParentTableRelation> 
                            <telerik:GridRelationFields DetailKeyField="pupil_code" MasterKeyField="pupil_code" /> 
                        </ParentTableRelation> 
                        <Columns> 
                            <telerik:GridBoundColumn SortExpression="subject_code" HeaderText="Subject" HeaderButtonType="TextButton" 
                                                     DataField="subject_code" UniqueName="subject_code" ReadOnly="true" 
                                                     HeaderStyle-Width="5%"/> 
                            <telerik:GridBoundColumn SortExpression="set_code" HeaderText="Set" HeaderButtonType="TextButton" 
                                                     DataField="set_code" UniqueName="set_code  ReadOnly="true
                                                     HeaderStyle-Width="5%"/> 
                            <telerik:GridBoundColumn SortExpression="initials" HeaderText="Tutor" HeaderButtonType="TextButton" 
                                                     DataField="initials" UniqueName="initials  ReadOnly="true
                                                     HeaderStyle-Width="5%"/> 
                            <telerik:GridDropDownColumn SortExpression="prediction" HeaderText="Grade" HeaderButtonType="TextButton" 
                                                     DataField="prediction" UniqueName="prediction" DataSourceID="xsGrades"  
                                                     ListTextField="text" ListValueField="text" HeaderStyle-Width="5%"  
                                                     ColumnEditorID="GridDropDownListColumnEditor1" /> 
                            <telerik:GridBoundColumn SortExpression="comments" HeaderText="Comment" HeaderButtonType="TextButton" 
                                                     DataField="comments" UniqueName="comments" HeaderStyle-Width="80%" MaxLength="128"  
                                                     ColumnEditorID="GridTextBoxColumnEditor1"/> 
                             
                        </Columns> 
                         
                    </telerik:GridTableView> 
                </DetailTables> 
                <Columns> 
                    <telerik:GridTemplateColumn SortExpression="imageLink" DataField="imageLink" UniqueName="imageLink 
                                        HeaderStyle-Width="5%"
                        <ItemTemplate> 
                            <div style="display:block"
                                <img src='../<%# DataBinder.Eval(Container.DataItem,"imageLink") %>' width="75px" height="100px"/> 
                            </div> 
                        </ItemTemplate> 
                    </telerik:GridTemplateColumn> 
                    <telerik:GridTemplateColumn SortExpression="imageLink" DataField="imageLink" UniqueName="details 
                                            HeaderStyle-Width="10%"
                        <ItemTemplate> 
                            <div> 
                                <%# DataBinder.Eval(Container.DataItem,"NAME") %><br /> 
                                <%# DataBinder.Eval(Container.DataItem,"yeargroup") %><br /> 
                                <%# DataBinder.Eval(Container.DataItem,"house") %><br /> 
                            </div> 
                        </ItemTemplate> 
                    </telerik:GridTemplateColumn> 
                    <telerik:GridEditCommandColumn ButtonType="PushButton" HeaderStyle-Width="85%" ItemStyle-HorizontalAlign="Left"/> 
                </Columns> 
            </MasterTableView> 
        </telerik:RadGrid> 
        <telerik:GridTextBoxColumnEditor ID="GridTextBoxColumnEditor1" TextBoxStyle-Width="600px" runat="server">  
        </telerik:GridTextBoxColumnEditor>  
        <telerik:GridDropDownListColumnEditor ID="GridDropDownListColumnEditor1" DropDownStyle-Width="40px" runat="server"
        </telerik:GridDropDownListColumnEditor> 
    </span> 
</asp:Panel> 
</ContentTemplate> 
</asp:UpdatePanel> 
 
<asp:SqlDataSource ID="dsMaster" runat="server"  
    ConnectionString="<%$ ConnectionStrings:PassMainConnectionString %>"  
     
    SelectCommand="SELECT DISTINCT AL.PUPIL_CODE, N.SURNAME + ', ' +N.PREFERRED_NAME AS NAME, P.HOUSE_1 AS house, P.FORM AS yeargroup, '_layouts/ec/handlers/ImageHandler.ashx?nID=' + CAST(P.NAME_ID AS VARCHAR) AS imageLink FROM ASSESSMENT_HEADER AS AH INNER JOIN ASSESSMENT_LINES AS AL ON AH.UNIQUE_ID = AL.HEADER_ID INNER JOIN PUPIL AS P ON AL.PUPIL_CODE = P.CODE INNER JOIN NAME AS N ON N.NAME_ID = P.NAME_ID INNER JOIN _metisStaffView AS S ON AH.TUTOR_CODE = S.staffCode WHERE (AH.ACADEMIC_YEAR = (SELECT ACADEMIC_YEAR FROM _CURR_YEAR)) AND (P.ACADEMIC_YEAR = (SELECT ACADEMIC_YEAR FROM _CURR_YEAR AS _CURR_YEAR_1)) AND (AH.ASSESSMENT_Nr = 15) AND (P.GROUP_TUTOR = (SELECT CODE FROM STAFF WHERE (NAME_ID = (SELECT NAME_ID FROM EC_CONTACT_USER_FIELDS WHERE (UPPER(MetisLogon) = UPPER(RTRIM(REPLACE(UPPER(@MetisLogon), 'EPCOT\', '')))))))) ORDER BY yeargroup, NAME"  
    onselecting="dsMaster_Selecting"
    <SelectParameters> 
        <asp:Parameter Name="metisLogon" /> 
    </SelectParameters> 
</asp:SqlDataSource> 
<asp:SqlDataSource ID="dsDetail" runat="server"  
    ConnectionString="<%$ ConnectionStrings:PassMainConnectionString %>" SelectCommand="SELECT 
    al.unique_id , 
    exam_date , 
    tutor_code , 
    set_code , 
    subject_code , 
    pupil_code,  
    S.initials, 
    grade_1 AS prediction , 
    comments  
FROM 
assessment_header AH 
INNER JOIN assessment_lines AL 
    ON AH.unique_id = AL.header_id 
INNER JOIN pupil P 
    ON AL.pupil_code = P.code 
INNER JOIN name N 
    ON N.name_id = P.name_id 
inner join dbo._metisStaffView S 
    on tutor_code =S.staffCode 
WHERE 
    AH.academic_year = ( SELECT 
                             academic_year 
                         FROM 
                             _curr_year ) 
    AND P.academic_year = ( SELECT 
                                academic_year 
                            FROM 
                                _curr_year ) 
    AND AH.assessment_nr = 15 
    AND pupil_code = @Pupil_Code 
ORDER BY subject_code, S.initials"  
     
    UpdateCommand="UPDATE ASSESSMENT_LINES SET GRADE_1 = @prediction, COMMENTS = RTRIM(@comments) WHERE (UNIQUE_ID = @unique_id)"  
    onupdating="dsDetail_Updating"
    <SelectParameters> 
        <asp:SessionParameter Name="Pupil_Code" SessionField="Pupil_Code" Type="String" /> 
    </SelectParameters> 
    <UpdateParameters> 
        <asp:Parameter Name="prediction" /> 
        <asp:Parameter Name="comments" /> 
        <asp:Parameter Name="unique_id" /> 
    </UpdateParameters> 
</asp:SqlDataSource> 
 
 
<asp:XmlDataSource ID="xsGrades" runat="server"  
    DataFile="~/usercontrols/Grades.xml" > 
</asp:XmlDataSource> 


XMLDataSource XML
<?xml version="1.0" encoding="utf-8" ?> 
<grades> 
    <grade text="-"/> 
    <grade text="S"/> 
    <grade text="A"/> 
    <grade text="B"/> 
    <grade text="C"/> 
    <grade text="D"/> 
    <grade text="E"/> 
    <grade text="U"/> 
</grades> 



Pavel
Telerik team
 answered on 09 Sep 2009
4 answers
126 views
Hello,

Simulating a callback using code in documentation:
 $find("<%=RadAjaxManager.GetCurrent(Page).ClientID %>").ajaxRequest(eventArgs);
I have added this radajaxmanager in its own ajaxsettings with the updated controls in codebehind.

But I am unable to have the default loading panel displayed during this callback ?
Call back is working normally and this loading panel works perfectly for other controls ???

Am i missing something ?

Thanks for help.
CS

v 2009.2.826
Yavor
Telerik team
 answered on 09 Sep 2009
2 answers
86 views
I have a table and the width of the table is in % and in that i have radinput controls like raddatepicker,radnumbericbox and radtextbox.
and the width of these controla are also in %.
and when ever i enter the text lenth greater than the texbox length then its width automatically increase which destroyed the forms look and feel
how can i overcome from this problem.

and i need the width and height in % because i have to design my  in such a way that it can be fit in any resolution.

plz help me in this regard
Dimo
Telerik team
 answered on 09 Sep 2009
2 answers
85 views
I use Radcombobox in Radwindow with IE8, when I show Popup(using RadWindows) with contains RadCombobox. When i move mouse to RadCombobox and I can see the link in Parent Page like transparent.
How i can solve this problem .Please help me as impossible as.
Bruce Lam
Top achievements
Rank 1
 answered on 09 Sep 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?