Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
45 views
Good morning guys,
In my aspx page I have the following code:
<telerik:RadTreeView runat="server" ID="RadTreeView1" OnClientNodeClicking="nodeClicking">
        <Nodes>
          <telerik:RadTreeNode runat="server" Text="All Trans" Expanded="true" >
           <Nodes>
            <telerik:RadTreeNode runat="server" Text="Approved"    >
            </telerik:RadTreeNode>
             <telerik:RadTreeNode runat="server" Text="Entered"   >
             </telerik:RadTreeNode>
                         
            </Nodes>
            </telerik:RadTreeNode>
            </Nodes>  
            <Nodes>
             <telerik:RadTreeNode runat="server" Text="Processed" ></telerik:RadTreeNode>
            </Nodes>
            <Nodes>
             <telerik:RadTreeNode runat="server" Text="All" ></telerik:RadTreeNode>
            </Nodes>  
       </telerik:RadTreeView>

In my code behind I have the followign code to disable treenode:
string runFl = dt.Rows[0][4].ToString();
if (runFl == "I")
                    {
                        RadTreeView tree = (RadTreeView)RadComboBoxStatusGrp.Items[0].FindControl("RadTreeView1");
                        tree.FindNodeByText("Processed").Enabled = false;

"Processed" node get disable but when I click on this disable node it is appearing in combobox.
My question is:when I click on it I do not want to see this node in combobox at all.

Thanks guys for your help.
Shinu
Top achievements
Rank 2
 answered on 17 Feb 2014
1 answer
44 views
how could we do same thing at demos link from code behind at radrating rate event or button click event .
Thank you.
Cuneyt
Top achievements
Rank 1
 answered on 16 Feb 2014
1 answer
175 views
Hi,

I have a problem in enable/disable RadButton in RadGrid control below is my code snippet. 

binding is not working as expected.

design:
<telerik:GridTemplateColumn HeaderText="Print" ItemStyle-Width="80px" UniqueName="PrintUN">
                            <ItemTemplate>
                                <telerik:RadButton runat="server" ID="btnPrintTicket" Text="Print Tickets" CommandArgument  ='<%# DataBinder.Eval(Container.DataItem, "ID")%>' CommandName="Print" Enabled="false"></telerik:RadButton>
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>

code behind:
protected void rgd_ItemDataBound(object sender, GridItemEventArgs e)
        {
            List<User_MyRegistration> lstResult = b.GetRegistrationsForUser(UserSessionClass.UserName);

            if (e.Item is GridDataItem)
            {
                GridDataItem item =(GridDataItem) e.Item;
                RadButton btnPrint = (RadButton)item.FindControl("btnPrintTicket");

                if (lstResult.Count > 0)
                {
                    foreach (User_MyRegistration userReg in lstResult)
                    {
                        if (userReg.Status == "Yes")
                        {
                            btnPrint.Enabled = true;
                        }
                    }
                }
            }
        }









R
Top achievements
Rank 1
 answered on 16 Feb 2014
1 answer
97 views
In am having issue with ImageEditor whereby the custom dialog control trigger Ajax request event every time the toolbar is clicked. I couldn't find any reason for it to trigger the event. Any idea?

ASPX:
01.  <script type="text/javascript">
02.        function add_div_event() {
03.            $("body").on('click', '.frameImage', function (e) { selectFrame(this) });
04.        }
05.    </script>
06. 
07.</head>
08.<body onload="add_div_event()">
09.    <form id="form1" runat="server">
10.        <telerik:RadScriptManager ID="RadScriptManager1" runat="server"></telerik:RadScriptManager>
11.        <telerik:RadAjaxManager ID="ajaxManager" runat="server" OnAjaxRequest="ajaxManager_AjaxRequest" >
12.            <AjaxSettings>
13.                <telerik:AjaxSetting AjaxControlID="ajaxManager">
14.                    <UpdatedControls>
15.                        <telerik:AjaxUpdatedControl ControlID="imgEditor"  />
16.                    </UpdatedControls>
17.                </telerik:AjaxSetting>
18.            </AjaxSettings>
19.        </telerik:RadAjaxManager>
20.        <div id="main">
21.            <div id="fixed-left">
22.                <asp:Repeater ID="repeater" runat="server" EnableViewState="false">
23.                    <ItemTemplate>
24.                        <fieldset>
25.                            <div class="imageWrapper">
26.                                <div id="sig-container" class="frameImage">
27.                                    <telerik:RadBinaryImage runat="server" ID="bImgSig" DataValue='<%#Eval("ImgMemory") %>' Width="135px"
28.                                        AutoAdjustImageControlSize="false" ImageAlign="Middle" />
29.                                </div>
30.                            </div>
31.                        </fieldset>
32.                    </ItemTemplate>
33.                </asp:Repeater>
34.            </div>
35.            <div id="edt">
36.                <telerik:RadImageEditor ID="imgEditor" runat="server" CanvasMode="Automatic" EnableResize="true" RegisterWithScriptManager="true"
37.                    RenderMode="Native" StatusBarMode="Bottom" ToolBarMode="Default" OnImageLoading="imgEditor_ImageLoading" Skin="Metro"
38.                    OnDialogLoading="imgEditor_DialogLoading" ExternalDialogsPath="~/CustomDialog" OnClientImageLoad="OnClientImageLoad"
39.                    OnImageSaving="imgEditor_ImageSaving">
40.                    <Tools>
41.                        <telerik:ImageEditorToolGroup>
42.                            <telerik:ImageEditorTool CommandName="SaveFrame" Text="Save Change" />
43.                            <telerik:ImageEditorToolSeparator />
44.                            <telerik:ImageEditorToolStrip CommandName="Undo"></telerik:ImageEditorToolStrip>
45.                            <telerik:ImageEditorToolStrip CommandName="Redo"></telerik:ImageEditorToolStrip>
46.                            <telerik:ImageEditorToolSeparator />
47.                            <telerik:ImageEditorTool CommandName="Zoom"></telerik:ImageEditorTool>
48.                            <telerik:ImageEditorTool CommandName="Reset"></telerik:ImageEditorTool>
49.                            <telerik:ImageEditorToolSeparator></telerik:ImageEditorToolSeparator>
50.                            <telerik:ImageEditorTool CommandName="AddText" Text="Text Input"></telerik:ImageEditorTool>
51.                            <telerik:ImageEditorTool CommandName="Pencil" Text="Instant Sign"></telerik:ImageEditorTool>
52.                            <telerik:ImageEditorTool CommandName="DrawCircle"></telerik:ImageEditorTool>
53.                            <telerik:ImageEditorTool CommandName="DrawRectangle"></telerik:ImageEditorTool>
54.                            <telerik:ImageEditorTool CommandName="Line"></telerik:ImageEditorTool>
55.                            <telerik:ImageEditorToolSeparator />
56.                            <telerik:ImageEditorTool CommandName="RotateLeft" />
57.                            <telerik:ImageEditorTool CommandName="RotateRight" />
58.                            <telerik:ImageEditorToolSeparator />
59.                            <telerik:ImageEditorTool CommandName="CustomInsertImage" Text="Signature" ToolTip="Add your signature" />
60.                        </telerik:ImageEditorToolGroup>
61.                    </Tools>
62.                </telerik:RadImageEditor>
63.            </div>
64.            <telerik:RadScriptBlock ID="scriptBlock" runat="server">
65.                <script type="text/javascript">
66.                    Telerik.Web.UI.ImageEditor.CommandList["CustomInsertImage"] = function (imgEditor, commandName, args) {
67.                        imgEditor.executeCommand("CustomInsertImage");
68.                        };
69.                        Telerik.Web.UI.ImageEditor.CommandList["SaveFrame"] = function (imgEditor, commandName, args) {
70.                            imgEditor.saveImageOnServer("", true);
71.                        };
72. 
73.                        function OnClientImageLoad(sender, args) {
74.                            var editorWidth = sender.get_width().substring(0, sender.get_width().lastIndexOf("px"));
75.                            var editorHeight = sender.get_height().substring(0, sender.get_height().lastIndexOf("px"));
76.                            sender.zoomImage(43, true);
77.                        }
78. 
79.                        function selectFrame(obj) {
80.                            //alert('frameselected');
81.                            var img = obj.childNodes[1];
82.                            //alert(img.src);
83.                            var ajaxManager = $find("<%= ajaxManager.ClientID %>");
84.                            ajaxManager.ajaxRequest(img.src);
85.                        }
86.                </script>
87.            </telerik:RadScriptBlock>
88.        </div>
89.    </form>

Somehow this command
Telerik.Web.UI.ImageEditor.CommandList["CustomInsertImage"] = function (imgEditor, commandName, args) {
67.                        imgEditor.executeCommand("CustomInsertImage");
68.                        };

always trigger OnAjaxRequest and causing the image editor to loose the image. 
fca
Top achievements
Rank 2
 answered on 15 Feb 2014
2 answers
521 views
Hi,

i am new to Telerik controls. i am in a situation where i need to bind a NestedViewTemplate  with a datasource having values from different tables connected with an id of an item within a RadGrid.
what i want to do is to bind that nested view template by getting value of id from its RadGrid using a datasource.
i have tried many option but didnt find any luck. is there anyway to bind its datasource from code behind as we do with RadGrid (as radgrid.datasource="any datasource").
is there any way to do that

<asp:EntityDataSource ID="EDSPrePostConfig" runat="server" ConnectionString="name=AdminPortalDBEntities"
                            DefaultContainerName="AdminPortalDBEntities" EntitySetName="PrePostConfigurations"
                            Select="PrePostCourseActivities.[CourseName] as PreLearning,
                            PrePostConfiguration.[Duration] as Duration
                             from (PrePostConfiguration
                            join LearningMatrix on PrePostConfiguration.[BaseCourseId]  = LearningMatrix.[Id]
                            join PrePostCourseActivities on PrePostConfiguration.[PrePostCourseActivityId] = PrePostCourseActivities.[Id]
                            join PrePostType on PrePostConfiguration.[PrePostTypeId] = PrePostType.[Id])" Where="PrePostConfigurations.[Id] = @Id">
                        <WhereParameters>
                             <asp:Parameter Name="Id" Type="Int32"/>
                        </WhereParameters>
                   
                </asp:EntityDataSource>

<NestedViewSettings  DataSourceID="EDSPrePostConfig">
                            <ParentTableRelation>
                                <telerik:GridRelationFields DetailKeyField="Id" MasterKeyField="Id" />
                            </ParentTableRelation>
                        </NestedViewSettings>
                        <NestedViewTemplate>
                            <asp:Panel ID="NestedViewPanel" runat="server" CssClass="viewWrap" BorderColor="#3366FF" BorderWidth="3px">
                                <div class="contactWrap">
                                    <table width="90%">
                                        <tbody>
                                            <tr>
                                                <td><b>Pre-Learning Configurations:</b> </td>
                                                <td></td>
                                            </tr>
                                            <tr>
                                                <td width="100">Pre-Learning: </td>
                                                <td><%#Eval("PreLearning") %></td>
                                                <td width="100">Duration: </td>
                                                <td><%#Eval("Duration") %></td>
                                            </tr>
                                            <tr>
                                                <td>Required: </td>
                                                <td><%#Eval("Required") %></td>
                                                <td>Feedback URL: </td>
                                                <td><%#Eval("PreFeedbackURL") %></td>
                                            </tr>
                                        
                                          
                                        </tbody>
                                    </table>
                                </div>
                            </asp:Panel>
                        </NestedViewTemplate>

it would be great if someone can help me with this.

Thanks and BR
JK

Jahanzaib
Top achievements
Rank 1
 answered on 15 Feb 2014
1 answer
160 views
Hi ,

I have a RadGrid with  sorting / paging / filtering enabled. While any of these operations are performed, the RadGrid should be greyed out with loading circle displayed and prevent the user to click anything inside the Radgrid. 

To keep short, I am trying to achieve the exact behaviour which is demonstrated in the link below:
http://demos.telerik.com/aspnet-ajax/controls/examples/integration/persisting-grid-settings/defaultcs.aspx?product=grid

How can I achieve this by just customizing RadAjaxLoadingPanel

Below is my code
<form>
<telerik:RadAjaxPanel  ID="RadAjaxPanel1" runat="server" Width="950px">
 
                              <telerik:RadAjaxManager runat="server" ID="RadAjaxManager2" DefaultLoadingPanelID="RadAjaxLoadingPanel1">
                                <AjaxSettings>
                                    <telerik:AjaxSetting AjaxControlID="rgrdViewAnotherAccount">
                                        <UpdatedControls>
                                                <telerik:AjaxUpdatedControl ControlID="rgrdViewAnotherAccount"></telerik:AjaxUpdatedControl>
                                        </UpdatedControls>
                                    </telerik:AjaxSetting>
                                        <telerik:AjaxSetting AjaxControlID="btnClearFilter">
                                        <UpdatedControls>
                                                <telerik:AjaxUpdatedControl ControlID="rgrdViewAnotherAccount"></telerik:AjaxUpdatedControl>
                                        </UpdatedControls>
                                    </telerik:AjaxSetting>
                                </AjaxSettings>
                            </telerik:RadAjaxManager>
                                     <telerik:RadAjaxLoadingPanel runat="server" Transparency="50" ID="RadAjaxLoadingPanel1">Loading</telerik:RadAjaxLoadingPanel>
 
                             <div style="height: 20px;float:right;white-space:nowrap">
                             <asp:Button ID="btnClearFilter" runat="server" Text="CLEAR FILTER" OnClick="btnClearFilter_Click" />
                             <a class="tooltipclose" style="display: inline-block;" title="Close" href="javascript:void(0)" onclick="toggleviewaccounts()"></a>
                              
                             </div>                           
                               
                              <br /><br />
                            <p style="display:block">To <a class="tooltip" href="javascript:void(0)" title='<asp:Literal runat="server" Text="<%$ Resources: ToolTips, overview.viewanotheraccount.sort%>" />'>sort</a> the list, click the desired column heading.
                            To <a class="tooltip" href="javascript:void(0)" title='<asp:Literal runat="server" Text="<%$ Resources: ToolTips, overview.viewanotheraccount.filter%>" />'>filter</a> the list, enter a value in the desired
                                column and click the Filter icon</p>     
                                                                 
                                        <telerik:RadGrid runat="server" Width="950px" ID="rgrdViewAnotherAccount" AutoGenerateColumns="false" AllowPaging="true" AllowSorting="true"
                                             AllowFilteringByColumn="true" Height="417px" OnItemCommand="rgrdViewAnotherAccount_ItemCommand" OnItemDataBound="rgrdViewAnotherAccount_ItemDataBound" OnNeedDataSource="rgrdViewAnotherAccount_NeedDataSource" CssClass="rgNoScrollImage">                  
                                              
                                            <MasterTableView DataKeyNames="ListIndex" AllowFilteringByColumn="true"  CommandItemDisplay="Top">                                                 
                                                 <PagerStyle AlwaysVisible="true" />
                                                 <FilterItemStyle HorizontalAlign="Left" />
                                                 <CommandItemSettings ShowRefreshButton="false" ShowAddNewRecordButton="false"/>
                                                 <Columns>
                                                        <telerik:GridTemplateColumn  HeaderText="ACCOUNT #" HeaderStyle-Wrap="false" DataField="Account" SortExpression="Account"   AutoPostBackOnFilter="true" AllowFiltering="True" CurrentFilterFunction="Contains"
                                                            ShowFilterIcon="true">
                                                           <ItemTemplate>
                                                                <asp:LinkButton ID="lnkbtnSelectAccount" CausesValidation="false" runat="server"
                                                                    CommandName="Select" CommandArgument='<%#Eval("Account")%>' Text='<%#Eval("Account")%>' >
                                                                    </asp:LinkButton>
                                                           </ItemTemplate>
                                                              <HeaderStyle HorizontalAlign="Left"  Width="200px" />   
                                                              <ItemStyle HorizontalAlign="Left"  Width="200px" />
                                                        </telerik:GridTemplateColumn>
                                                        <telerik:GridBoundColumn HeaderText="NAME" FilterControlWidth="200px" SortExpression="FULL_COMPANYNAME" DataField="FULL_COMPANYNAME"
                                                           UniqueName="NAME" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains"
                                                            ShowFilterIcon="true">
                                                              <HeaderStyle HorizontalAlign="Left" />   
                                                              <ItemStyle HorizontalAlign="Left" />
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridBoundColumn FilterControlWidth="105px" HeaderText="ADDRESS" SortExpression="FULL_ADDRESS"
                                                            UniqueName="ADDRESS" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" DataField="FULL_ADDRESS"
                                                            ShowFilterIcon="true">
                                                            <HeaderStyle HorizontalAlign="Left" Width="200px" />   
                                                              <ItemStyle HorizontalAlign="Left" Width="200px"/>
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridTemplateColumn HeaderText="MY DEFAULT" SortExpression="DefaultAccount" AllowFiltering="false" ShowFilterIcon="false">
                                                        <ItemTemplate>
                                                             <%#Eval("DefaultAccount")%>
                                                            <span class="<%#Eval("MakeDefault")%>">                                                               
                                                                <asp:LinkButton ID="lnkbtnMakeDefaultAccount" CausesValidation="false" runat="server"
                                                                    CommandName="Default" CommandArgument='<%#Eval("Account")%>' OnCommand="lnkbtnMakeDefault_OnCommand" >Make Default</asp:LinkButton>
                                                            </span>
                                                        </ItemTemplate>
                                                        <HeaderStyle Width="105px" />
                                                        <ItemStyle Width="105px" />
                                                        </telerik:GridTemplateColumn>
                                                         <telerik:GridBoundColumn FilterControlWidth="105px" DataField="Status" HeaderText="STATUS" SortExpression="Status"
                                                           UniqueName="Status" AllowFiltering="false">
                                                            <HeaderStyle HorizontalAlign="Left" Width="100px" />   
                                                              <ItemStyle HorizontalAlign="Left" Width="100px" />
                                                        </telerik:GridBoundColumn>
                                                     </Columns>
                                             
                                                    </MasterTableView>
                                                    <GroupingSettings  CaseSensitive="false"/>
 
                                                     <ClientSettings>
                                                        <Scrolling AllowScroll="True" UseStaticHeaders="True"  SaveScrollPosition="false">
                                                        </Scrolling>
                                                        <Selecting AllowRowSelect="false" />
                                                    </ClientSettings>
                                                </telerik:RadGrid>   
                                             <br />
                                             <br />            
                                         
                                  </telerik:RadAjaxPanel>
                                  </form>
Shinu
Top achievements
Rank 2
 answered on 15 Feb 2014
1 answer
554 views
Hi is it possible to alter the style of the gridbuttonColumn, the button background seems to disappear when using enablerowhoverstyle

Thanks
Gareth
Shinu
Top achievements
Rank 2
 answered on 15 Feb 2014
5 answers
115 views
We are using RadGrid quite extensively in one of our projects and as we moved to Visual Studio 2013 basically the rendering of all of them crashed. Some grids stopped outputting a table altogether, others justs rendered wrong.

This only happened in VS2013, not in 2012 and not on servers where we deployed. Finally we tracked it down to the new BrowserLink functionality in VS 2013. Once we disabled BrowserLink in appSettings in web.config everything started working again.

<appSettings>
 <add key="vs:EnableBrowserLink" value="false" />
</appSettings>
Chris Honselaar
Top achievements
Rank 1
 answered on 14 Feb 2014
2 answers
92 views
Hello,

I have a radasyncupload control on my form for file uploads and have the PostBackTriggers property set to a button on the form for submitting the information.  The button also performs some server side validation and eventually performs some tasks based on successful validation.  The problem I have having is two fold:

1. When I click the button to submit my form, half of my code does not end up executing because the FileUploaded event fires.
2. If server side validation does complete prior and is not valid, the FileUpload still completes and the control is blank again causing the need to upload the file again.

What can I do to prevent this type of behavior?  More so I really need to get problem #1 fixed but I can't seem to find a way to be sure all code fires in the proper order.  Is there a way to call the FileUploaded event server side versus specifying the PostBackTriggers in the markup?  This way I can ensure all my code executes in the proper order and also completes.

Thanks,
Ron
Ron
Top achievements
Rank 2
 answered on 14 Feb 2014
6 answers
1.1K+ views
I have a radButton in my page dinamially built on page load with checked set to true.
When page loads I see the button checked, but when I post I check if button is checked and its not!!!
But in this same scenario: page loads and button is checked. If I uncheck the button then check again, when I post the button is checked as expected!

What Im doing wrong?
Danail Vasilev
Telerik team
 answered on 14 Feb 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?