Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
674 views
Hi,

I have an aspx page that has a UserControl which is shown on a Button click in a RadWindow.

The usercontrol has javascript function's written in a RadCodeBlock that gets rendered when the aspx page loads. Now when i click the button to show the radWindow with userControl the javascript functions inside the RadCodeBlock of the userControl are not rendered.

I do know the work arounds of injecting the javascript from serverside but in terms of maintenance its a very big hassle as i would need to rebuild my entire project for a small javascript change. 

I tried moving the javascript functions to the aspx page but since they need the clientId of the controls inside the usercontrol its getting difficult to have them in the aspx page. 

How would i proceed?

Thanks in advance.

Rajesh
Maria Ilieva
Telerik team
 answered on 23 Sep 2014
1 answer
171 views
Hi, I have found some weird bugs when playing with RadGrid in batch edit mode, here's the scenario:

1. First, I will add new record, then you can see the red triangle indicating changes
2. Then, I delete this record, and then I add new record again
3. Things getting strange from now on, when you are editing fields, e.g. when you lost focus, an item in combobox is automatically selected instead of validation prompted, also after one field edit done, I am not able to see the red triangle in each cell, this happen to "the" row only.

Also, I have try the demo http://demos.telerik.com/aspnet-ajax/grid/examples/data-editing/batch-editing/defaultcs.aspx
Same behavior is occured. 

Please help me solve the bug.

Thanks,
Hon Wai
Konstantin Dikov
Telerik team
 answered on 23 Sep 2014
0 answers
153 views

I am facing some problems in an ajax tab container tab panel inside an iframe. One application has more frames. I am showing a .net application in one of the frames in that application. Screens comes perfectly.

But in that screen which has ajax tab panel (3 tabs):
By default I am showing the 1st tab. The problem is, when clicking on the second tab the screen is not loading. When clicking on the 2nd tab nothing happens. Is that behavior related to the iframe?

I am facing some problems in an ajax tab container tab panelinside an iframe. One application has more frames. I am showing a.net application in one of the frames in that application. Screens comes perfectly.

But in that screen which has ajax tab panel (3 tabs):
By default I am showing the 1st tab. The problem is, when clicking on thesecond tab the screen is not loading. When clicking on the 2nd tab nothing happens. Is that behavior related to the iframe?

Ragesh
Top achievements
Rank 1
 asked on 23 Sep 2014
1 answer
105 views
hi

I've got a tabstrip that and at present I build up the first level based on a mapping list in SharePoint, when a tab is clicked I then build the next level again based on the mapping list and the tab value selected. again for the final level it is built up using  the same process.

This is proving to be time inefficient and I need to know if I can build all three levels on page load and when a tab is clicked it will show only those tabs that have the clicked tab as a parent value.

Level 1    tab-a          tab-b          tab-c

Level 2    tab-a1        tab-a2        tab-a3        tab-b1        tab-b2        tab-c1        tab-c2

Level 3    tab-a1a      tab-a1b      tab-a2a      tab-a2b      tab-a3a      tab-a3b      tab-b1a      tab-b2a      tab-c1a      tab-c2a

so here, the 3 levels would be built on page load and when tab-1 is selected then the second level is shown with only tab-a1, tab-a2 and tab-a3 shown and when tab-a3 is then clicked then the third level is displayed with only tab-a3a and tab-a3b shown.

hope what I'm asking makes sense

cheers
Nencho
Telerik team
 answered on 23 Sep 2014
1 answer
206 views
Hi

I have simple html header with css style, i want to add this
header to hierarchical/inner (detail tables) grids in 2nd and 3rd level
in telerik grid, how can i do this.

See the image, will help you in understanding the question.
https://www.dropbox.com/s/cse2w3d85vbgrzh/LeaveTypeSetup.png?dl=0

Thanks in advance.

Regards,
Zain

Viktor Tachev
Telerik team
 answered on 23 Sep 2014
1 answer
142 views
Image
Code

look at my link  and help me pls 

thank you
Viktor Tachev
Telerik team
 answered on 23 Sep 2014
2 answers
140 views
What version of .NET is required for this release? I put this thread in the PageLayout forum because that is what is inspiring me to upgrade. Currently I am running server 2003 with NDP40-KB2836939-v3-x86 applied to get proper browser detection for IE 11. We will be moving to server 2012 soon, but I will still have sites on older OS versions. Integrating this at the Server 2003 level would be best short term for me.

Dana

Ivan Zhekov
Telerik team
 answered on 23 Sep 2014
3 answers
1.5K+ views
Hi Team,

I need to filter the records on client side instead of server side.

I am binding the data to grid in code behind using 'DataBind()' method.

Can you please explain how can I achieve this?

Thanks,

Vinay
Radoslav
Telerik team
 answered on 23 Sep 2014
2 answers
474 views
Hello.
Excuse me if my english is not well.
i have a textbox column in radgrid.
<telerik:GridTemplateColumn  SortExpression="score" HeaderText="score" HeaderButtonType="TextButton"
                    DataField="score" UniqueName="score" ReadOnly="true">
                       <ItemTemplate>
                           <telerik:RadTextBox runat="server">
 
                           </telerik:RadTextBox>
                       </ItemTemplate>
                   </telerik:GridTemplateColumn>

and a button . 
how can i get value of each textbox by clicking button ?
for example row with id=1 >> textbox=15
actually i'm looking for bulk data submit.in edit mode i can submit values row by row and it's time consuming.
if there is any other option please tell me.
thank you
shervinrv
Top achievements
Rank 1
 answered on 23 Sep 2014
3 answers
285 views
Hello


I have a RadComboBox that updates two RadGrids, each with a detail table that has a command button which opens a different RadWindow containing another RadGrid, and I'm running into errors when trying to apply RadAjaxManager controls to the page. Everything is working fine until I set the second grid (uxRolesRG)  to update its window (RoleAvailUsers), which causes the page to throw a JScript runtime error whenever a new value is selected in the RadComboBox.



Error:
0x800a139e - Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerServerErrorException: Collection was modified; enumeration operation may not execute.
 
If there is a handler for this exception, the program may be safely continued.


Default.aspx:
<%@ Page Title="" Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="Applications_Default" %>
 
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="Server">
    <telerik:RadScriptBlock ID="RSBlock1" runat="server">
        <script type="text/javascript">
            function ShowAddRoleWindow(sender, args) {
                $find("<%=AddUserRoleRW.ClientID%>").show();
            }
 
            function ShowAddUserWindow(sender, args) {
                $find("<%=AddRoleUserRW.ClientID%>").show();
            }
        </script>
    </telerik:RadScriptBlock>
    <telerik:RadAjaxManager ID="uxAjaxManager" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="uxAppSelectCB">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="uxUserRG" />
                    <telerik:AjaxUpdatedControl ControlID="uxRolesRG" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="uxUserRG">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="UserAvailRoles" LoadingPanelID="UserAvailRolesLW" />
                    <telerik:AjaxUpdatedControl ControlID="AddUserRoleUN" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="uxRolesRG">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RoleAvailUsers" LoadingPanelID="RoleAvailUsersLW" />
                    <telerik:AjaxUpdatedControl ControlID="AddRoleUserUN" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <asp:Label ID="AddUserRoleUN" runat="server" Visible="false" />
    <asp:Label ID="AddRoleUserUN" runat="server" Visible="false" />
    <telerik:RadComboBox ID="uxAppSelectCB" AllowCustomText="true" runat="server" DataSourceID="AppListODS" DataValueField="ApplicationId" DataTextField="ApplicationName" MarkFirstMatch="true" AutoPostBack="true" />
    <telerik:RadWindow ID="AddUserRoleRW" runat="server">
        <ContentTemplate>
            <telerik:RadAjaxLoadingPanel ID="UserAvailRolesLW" runat="server" />
            <telerik:RadGrid ID="UserAvailRoles" runat="server" DataSourceID="UserRolesUnassignedODS" AutoGenerateColumns="false" AllowAutomaticUpdates="true" AllowAutomaticInserts="false">
                <MasterTableView EditMode="Batch" DataKeyNames="RoleId" CommandItemDisplay="Top" AllowPaging="true" PageSize="40">
                    <BatchEditingSettings OpenEditingEvent="MouseOver" />
                    <CommandItemSettings ShowAddNewRecordButton="false" ShowRefreshButton="false" />
                    <Columns>
                        <telerik:GridCheckBoxColumn UniqueName="GrantCB" HeaderStyle-Width="30px" DataField="IsSelected" />
                        <telerik:GridBoundColumn DataField="RoleName" HeaderText="Role" ReadOnly="true" />
                    </Columns>
                </MasterTableView>
            </telerik:RadGrid>
        </ContentTemplate>
    </telerik:RadWindow>
    <telerik:RadWindow ID="AddRoleUserRW" runat="server">
        <ContentTemplate>
            <telerik:RadAjaxLoadingPanel ID="RoleAvailUsersLW" runat="server" />
            <telerik:RadGrid ID="RoleAvailUsers" runat="server" DataSourceID="RoleUsersUnassignedODS" AutoGenerateColumns="false" AllowAutomaticUpdates="true" AllowAutomaticInserts="false">
                <MasterTableView EditMode="Batch" DataKeyNames="UserId" CommandItemDisplay="Top" AllowPaging="true" PageSize="40">
                    <BatchEditingSettings OpenEditingEvent="MouseOver" />
                    <CommandItemSettings ShowAddNewRecordButton="false" ShowRefreshButton="false" />
                    <Columns>
                        <telerik:GridCheckBoxColumn UniqueName="AddCB" HeaderStyle-Width="30px" DataField="IsSelected" />
                        <telerik:GridBoundColumn DataField="FirstName" HeaderText="First Name" ReadOnly="true" />
                        <telerik:GridBoundColumn DataField="LastName" HeaderText="Last Name" ReadOnly="true" />
                        <telerik:GridBoundColumn DataField="UserName" HeaderText="User Name" ReadOnly="true" />
                    </Columns>
                </MasterTableView>
            </telerik:RadGrid>
        </ContentTemplate>
    </telerik:RadWindow>
    <telerik:RadTabStrip runat="server" ID="uxAdminModeStrip" Orientation="HorizontalTop" SelectedIndex="0" MultiPageID="uxAdminModeMP">
        <Tabs>
            <telerik:RadTab Text="Manage By User" TabIndex="0" />
            <telerik:RadTab Text="Manage By Role" TabIndex="1" />
        </Tabs>
    </telerik:RadTabStrip>
    <telerik:RadMultiPage runat="server" ID="uxAdminModeMP" SelectedIndex="0" Width="100%">
 
        <%--Page: By User--%>
        <telerik:RadPageView runat="server" ID="uxByUserPV" TabIndex="0">
            <telerik:RadGrid ID="uxUserRG" runat="server" DataSourceID="UserListODS" AutoGenerateColumns="false">
                <MasterTableView DataKeyNames="UserId" AllowFilteringByColumn="true" AllowSorting="true">
                    <DetailTables>
                        <telerik:GridTableView DataKeyNames="RoleId" Name="uxUserRolesRG" AutoGenerateColumns="false" runat="server" DataSourceID="UserRolesODS" AllowAutomaticDeletes="true" CommandItemDisplay="Top">
                            <CommandItemTemplate>
                                <telerik:RadButton ID="AddUserRoleRB" runat="server" CommandName="AddRoles" OnClientClicked="ShowAddRoleWindow" AutoPostBack="true" Text="Add Roles" ButtonType="SkinnedButton" />
                            </CommandItemTemplate>
                            <CommandItemSettings ShowAddNewRecordButton="false" />
                            <ParentTableRelation>
                                <telerik:GridRelationFields DetailKeyField="UserId" MasterKeyField="UserId" />
                            </ParentTableRelation>
                            <Columns>
                                <telerik:GridBoundColumn DataField="RoleName" HeaderText="Role Name" ReadOnly="true" />
                                <telerik:GridBoundColumn DataField="Description" HeaderText="Description" ReadOnly="true" />
                                <telerik:GridButtonColumn CommandName="Delete" HeaderText="Remove" ButtonType="PushButton" Text="X" />
                            </Columns>
                        </telerik:GridTableView>
                    </DetailTables>
                    <Columns>
                        <telerik:GridBoundColumn DataField="UserName" HeaderText="User Name" CurrentFilterFunction="Contains" AutoPostBackOnFilter="true" />
                        <telerik:GridBoundColumn DataField="FirstName" HeaderText="First Name" CurrentFilterFunction="Contains" AutoPostBackOnFilter="true" />
                        <telerik:GridBoundColumn DataField="LastName" HeaderText="Last Name" CurrentFilterFunction="Contains" AutoPostBackOnFilter="true" />
                        <telerik:GridCheckBoxColumn DataField="IsLockedOut" HeaderText="Locked" AllowFiltering="false" />
                        <telerik:GridCheckBoxColumn DataField="IsArchive" HeaderText="Archived" AllowFiltering="false" />
                        <telerik:GridDateTimeColumn DataField="LastActivityDate" HeaderText="Last Active" DataFormatString="{0:dd/MM/yyyy}" CurrentFilterFunction="GreaterThanOrEqualTo" AutoPostBackOnFilter="true" />
                    </Columns>
                </MasterTableView>
                <GroupingSettings CaseSensitive="false" />
            </telerik:RadGrid>
        </telerik:RadPageView>
 
        <%--Page: By Role--%>
        <telerik:RadPageView runat="server" ID="uxByRolePV" TabIndex="1">
            <telerik:RadGrid ID="uxRolesRG" runat="server" DataSourceID="RoleListODS" AutoGenerateColumns="false">
                <MasterTableView DataKeyNames="RoleId" AllowFilteringByColumn="true" AllowSorting="true">
                    <DetailTables>
                        <telerik:GridTableView DataKeyNames="UserId" Name="uxRoleUsersRG" AutoGenerateColumns="false" runat="server" DataSourceID="RoleUsersODS" AllowAutomaticDeletes="true" CommandItemDisplay="top">
                            <CommandItemTemplate>
                                <telerik:RadButton ID="AddRoleUserRB" runat="server" CommandName="AddUsers" OnClientClicked="ShowAddUserWindow" AutoPostBack="true" Text="Add Users" ButtonType="SkinnedButton" />
                            </CommandItemTemplate>
                            <CommandItemSettings ShowAddNewRecordButton="false" />
                            <ParentTableRelation>
                                <telerik:GridRelationFields DetailKeyField="RoleId" MasterKeyField="RoleId" />
                            </ParentTableRelation>
                            <Columns>
                                <telerik:GridBoundColumn DataField="UserName" HeaderText="User Name" />
                                <telerik:GridBoundColumn DataField="FirstName" HeaderText="First Name" />
                                <telerik:GridBoundColumn DataField="LastName" HeaderText="Last Name" />
                                <telerik:GridCheckBoxColumn DataField="IsLockedOut" HeaderText="Locked" />
                                <telerik:GridCheckBoxColumn DataField="IsArchive" HeaderText="Archived" />
                                <telerik:GridDateTimeColumn DataField="LastActivityDate" HeaderText="Last Active" DataFormatString="{0:dd/MM/yyyy}" />
                                <telerik:GridButtonColumn CommandName="Delete" HeaderText="Remove" ButtonType="PushButton" Text="X" />
                            </Columns>
                        </telerik:GridTableView>
                    </DetailTables>
                    <Columns>
                        <telerik:GridBoundColumn DataField="RoleName" HeaderText="Role Name" CurrentFilterFunction="Contains" AutoPostBackOnFilter="true" />
                        <telerik:GridBoundColumn DataField="Description" HeaderText="Description" CurrentFilterFunction="Contains" AutoPostBackOnFilter="true" />
                        <telerik:GridCheckBoxColumn DataField="IsActive" HeaderText="Active" AllowFiltering="false" />
                        <telerik:GridCheckBoxColumn DataField="IsLocked" HeaderText="Locked" AllowFiltering="false" />
                        <telerik:GridDateTimeColumn DataField="CreateDate" HeaderText="Created" DataFormatString="{0:dd/MM/yyyy}" CurrentFilterFunction="GreaterThanOrEqualTo" AutoPostBackOnFilter="true" />
                        <telerik:GridDateTimeColumn DataField="ModifyDate" HeaderText="Modified" DataFormatString="{0:dd/MM/yyyy}" CurrentFilterFunction="GreaterThanOrEqualTo" AutoPostBackOnFilter="true" />
                    </Columns>
                </MasterTableView>
                <GroupingSettings CaseSensitive="false" />
            </telerik:RadGrid>
        </telerik:RadPageView>
    </telerik:RadMultiPage>
 
    <%--ODS For Dropdown--%>
    <asp:ObjectDataSource ID="AppListODS" runat="server" TypeName="Applications" SelectMethod="GetApplicationsWithAccessRights" />
 
    <%--ODS For Base Grids--%>
    <asp:ObjectDataSource ID="UserListODS" runat="server" TypeName="Applications" SelectMethod="GetApplicationUsers">
        <SelectParameters>
            <asp:ControlParameter ControlID="uxAppSelectCB" Name="ApplicationId" />
        </SelectParameters>
    </asp:ObjectDataSource>
    <asp:ObjectDataSource ID="RoleListODS" runat="server" TypeName="Applications" SelectMethod="GetApplicationRoles">
        <SelectParameters>
            <asp:ControlParameter ControlID="uxAppSelectCB" Name="ApplicationId" />
        </SelectParameters>
    </asp:ObjectDataSource>
 
    <%--ODS For Detail Tables--%>
    <asp:ObjectDataSource ID="UserRolesODS" runat="server" TypeName="Applications" SelectMethod="GetUserApplicationRoles" DeleteMethod="DeleteUserRole">
        <SelectParameters>
            <asp:ControlParameter ControlID="uxAppSelectCB" Name="ApplicationId" />
            <asp:Parameter Name="UserId" />
        </SelectParameters>
        <DeleteParameters>
            <asp:Parameter Name="UserId" />
            <asp:Parameter Name="RoleId" />
        </DeleteParameters>
    </asp:ObjectDataSource>
    <asp:ObjectDataSource ID="RoleUsersODS" runat="server" TypeName="Applications" SelectMethod="GetUsersWithRole" DeleteMethod="DeleteRoleUser">
        <SelectParameters>
            <asp:Parameter Name="RoleId" />
        </SelectParameters>
        <DeleteParameters>
            <asp:Parameter Name="UserId" />
            <asp:Parameter Name="RoleId" />
        </DeleteParameters>
    </asp:ObjectDataSource>
 
    <%--ODS For Add Window--%>
    <asp:ObjectDataSource ID="UserRolesUnassignedODS" runat="server" TypeName="Applications" SelectMethod="GetUserUngrantedRoles" UpdateMethod="BatchInsertUserRole">
        <SelectParameters>
            <asp:ControlParameter ControlID="uxAppSelectCB" Name="ApplicationId" />
            <asp:Parameter Name="UserId" />
        </SelectParameters>
        <UpdateParameters>
            <asp:ControlParameter ControlID="AddUserRoleUN" Name="UserId" />
        </UpdateParameters>
    </asp:ObjectDataSource>
    <asp:ObjectDataSource ID="RoleUsersUnassignedODS" runat="server" TypeName="Applications" SelectMethod="GetRoleUngrantedUsers" UpdateMethod="BatchInsertRoleUser">
        <SelectParameters>
            <asp:Parameter Name="RoleId" />
        </SelectParameters>
        <UpdateParameters>
            <asp:ControlParameter ControlID="AddRoleUserUN" Name="RoleId" />
        </UpdateParameters>
    </asp:ObjectDataSource>
</asp:Content>



Default.aspx.vb
Imports Telerik.Web.UI
 
Partial Class Applications_Default
    Inherits System.Web.UI.Page
 
    Protected Sub Page_Init(sender As Object, e As EventArgs) Handles Me.Init
        If Not Page.IsPostBack Then
            uxAppSelectCB.SelectedIndex = 0
            uxRolesRG.Rebind()
            uxUserRG.Rebind()
        End If
    End Sub
 
    Protected Sub uxUserRG_ItemCommand(sender As Object, e As GridCommandEventArgs) Handles uxUserRG.ItemCommand
        If e.Item.OwnerTableView.DataSourceID.Equals("UserRolesODS") Then
            Dim UserId = e.Item.OwnerTableView.ParentItem.GetDataKeyValue("UserId").ToString()
            If e.CommandName.Equals("Delete") Then
                UserRolesODS.DeleteParameters("UserId").DefaultValue = UserId
            ElseIf e.CommandName.Equals("AddRoles") Then
                UserRolesUnassignedODS.SelectParameters("UserId").DefaultValue = UserId
                AddUserRoleUN.Text = UserId
                UserAvailRoles.Rebind()
            End If
        End If
    End Sub
 
 
    Protected Sub uxRolesRG_ItemCommand(sender As Object, e As GridCommandEventArgs) Handles uxRolesRG.ItemCommand
        If e.Item.OwnerTableView.DataSourceID.Equals("RoleUsersODS") Then
            Dim RoleId = e.Item.OwnerTableView.ParentItem.GetDataKeyValue("RoleId").ToString()
            If e.CommandName.Equals("Delete") Then
                RoleUsersODS.DeleteParameters("RoleId").DefaultValue = RoleId
            ElseIf e.CommandName.Equals("AddUsers") Then
                RoleUsersUnassignedODS.SelectParameters("RoleId").DefaultValue = RoleId
                AddRoleUserUN.Text = RoleId
                RoleAvailUsers.Rebind()
            End If
        End If
    End Sub
End Class



Maria Ilieva
Telerik team
 answered on 23 Sep 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Top achievements
Rank 1
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ivory
Top achievements
Rank 1
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
YF
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Top achievements
Rank 1
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ivory
Top achievements
Rank 1
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
YF
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?