Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
154 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
514 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
311 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
3 answers
213 views
Hi,

I need to be able to show / hide (toggle) all columns in a grid view where the columns name begins with (A).  I've search and found this script:

function HideColumn(index)
           {
               var columnCount = RadGrid1.get_masterTableView().get_columns().length - 1;
               if (index < 0 || index > columnCount)
               {
                   alert("Invalid index! The valid range is: " + 0 + "-" + columnCount);
               }
               else
               {
                   RadGrid1.get_masterTableView().hideColumn(index);
               }
           }


Does anybody have any suggestions how it could be tailored to accomplish my goals?
Angel Petrov
Telerik team
 answered on 23 Sep 2014
4 answers
106 views
Hello!

I have a user control that searches recursively for an radajaxmanger in its page hierarchy. Then the control adds its components that should be ajaxified like that:

ajaxManager.AjaxSettings.AddAjaxSetting(btnEditValues, gridPanel, radLoadingPanel);

the page hierarchy looks like that

Page (with the Ajax Manager)
-Control
--gridPanel
---btnEditValues

Now every control in the gridPanel makes an ajaxpostback as well.
When I try to exclude the control from the AjaxRequest with a javascript (OnRequestStart for example) the Clientside event "OnRequestStart" is not even called. But still an ajax postback is made.

I successfully excluded other controls from the postback, like "btnEditValues".

Is it possible that control that are the updated ones a somehow implicitly the updating ones as well ??

I'm really stuck here...

thx in advance for your help,

kind regards,
 M
Steven
Top achievements
Rank 1
 answered on 23 Sep 2014
0 answers
92 views
I am trying to write a javascript code.  This is code I have right now.

<script type='text/javascript'>
function onCheckBoxClickctl00_Content_ddc1_CB1(){
var combo=$find('ctl00_Content_ddc1_CB1');
 var CountChecked=0;
var text='This is the text message';
var max ='4';
var items = combo.get_items();
for(var i=0;i<items.get_count();i++){
var item=items.getItem(i);
var chk1=$get(combo.get_id()+'_i'+i+'_chk1');
if(chk1.checked){
CountChecked ++;
if(max < CountChecked) {
chk1.checked = false;
}
text+=item.get_text()+',';
 if(CountChecked > 3)
{ text = 'You have ' + CountChecked  + ' items selected :';}
}
}
 text=removeLastDelimiter(text);
if(text.length>0){combo.set_text(text);}else{combo.set_text('');}}
</script>

if(text.length>0){combo.set_text(text);}else{combo.set_text('');}}

I would like to write the text in the first line of the drop down.  Something like items._array[0].set_text(text).  But when I did this I get an error.  Can you please tell me how to do this.

Thank you
Kalyani
Top achievements
Rank 1
 asked on 22 Sep 2014
2 answers
134 views
Does anybody know how to hide all grid items in MastertableView and DetailTableVies after clicking on "Add new item" button?
I wont to Display only the insert form and hide all ofter GridView elements:


​
protected void GrdTicketsItemCommand(object sender, GridCommandEventArgs e)
{
    if (e.CommandName == RadGrid.InitInsertCommandName)
    {
        // show insert form works fine
        e.Item.OwnerTableView.EditFormSettings.UserControlName = "BackendControls/AddBillingAndTicket.ascx";
        e.Item.OwnerTableView.EditFormSettings.EditFormType = GridEditFormType.WebUserControl;
        e.Item.OwnerTableView.InsertItem();
 
        // How to hide all items in MasterTableView and all DetailsTables?
        // this doesn't work:
        foreach (GridDataItem item in GrdTickets.Items)
            item.Visible = false;
    }
}


Thank you for your help.
Christopher
kzimny
Top achievements
Rank 1
 answered on 22 Sep 2014
1 answer
115 views
I am working on a project that requires complex conditional validation and I want to be able to access the controls in the edit template on the server validate event. I have looked through the object model and I am not seeing anything I can use to access the page values. Any clues?

During an edit I can use the RadGrid1.EditItems but insert there are none there.
Jayesh Goyani
Top achievements
Rank 2
 answered on 22 Sep 2014
1 answer
114 views
Hi,

I have a  radgrid and the the radgrid is set to autogenerated columns =  true. Once the radcombo box is changed the grid should have null data and the columns are added based on listbox source to destination selection. Though i Make the Datasource = null i still see the column names. Do i have the ability to make the total grid empty and with no columns and rows . 

Thanks in advance,

Vamsi
Jayesh Goyani
Top achievements
Rank 2
 answered on 22 Sep 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?