Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
74 views
I have a RadScheduler that displays multiple resources on a single view (DayView). Is there a way to control the ability to add/edit/delete appointments within a single resource independent of the other resources? I have security that I want to apply and I cannot figure out how to do it. Something like a Readonly at the Resources level or AllowInsert at that level.
Boyan Dimitrov
Telerik team
 answered on 24 Nov 2014
1 answer
154 views

I am creating one entry screen using RadGrid in Batch Edit Mode. My Grid is having mainly some columns of ComboBox (rdcombPayCodeNm) and  TextBox ("txtHours" or "txtAmount"). I have added attribute like "PaidInAmount"/"PaidInHours" in RadCombo in PageLoad.  I want to verify textBox value based on user selected item and their attribut value of ComboBox. Suppose user selected one item in combo and their attribute value is  "PaidInAmount" then user should not enter any value in "txtHours" textbox and opposite if user selected combobox attribute is "PaidInHours" then there should be any value in "txtAmount" textbox. There would be multiple row in grid and I have to validate one by one row and show message to user. I want to perform this operation in client side as I can't read grid value in server side in BatchEdit mode.

I am copying my aspx code and code behind for your ref.

ASPX
------------------------------------------------------------------
<telerik:RadGrid ID="rdgvOtherPay" runat="server" AllowAutomaticInserts="True" AllowAutomaticUpdates="true" AllowMultiRowEdit="true" AllowPaging="True"
    AutoGenerateColumns="False" CellSpacing="0" OnNeedDataSource="rdgvOtherPay_NeedDataSource"
    GridLines="None"
    PageSize="12" AllowMultiRowSelection="true">
    <ClientSettings>
        <ClientEvents OnBatchEditSetEditorValue="setEditorValue" OnRowCreated="rowCreated" OnBatchEditOpened="editOpened" />
    </ClientSettings>
    <MasterTableView AutoGenerateColumns="False" CommandItemDisplay="Top" CommandItemSettings-AddNewRecordText=""
        CommandItemSettings-CancelChangesText="" CommandItemSettings-RefreshText="" CommandItemSettings-ShowRefreshButton="false"
        CommandItemSettings-ShowSaveChangesButton="false" CommandItemSettings-ShowCancelChangesButton="false" DataKeyNames="idEmpOtherPay"
        Dir="rtl" EditMode="Batch" HorizontalAlign="NotSet" InsertItemDisplay="Bottom">
        <BatchEditingSettings EditType="Row" />
        <SortExpressions>
            <telerik:GridSortExpression FieldName="idEmpOtherPay" SortOrder="Descending" />
        </SortExpressions>
        <Columns>
            
            <telerik:GridTemplateColumn DataField="PayCodeId" HeaderStyle-Width="110px" HeaderText="Pay Code" UniqueName="PayCodeId">
                <ItemTemplate>
                    <%# Eval("PayCodeName") %>
                </ItemTemplate>
                <EditItemTemplate>
                    <telerik:RadComboBox ID="rdcombPayCodeNm" runat="server" class="TelerikDrop" dir="ltr" DropDownAutoWidth="Enabled" Filter="StartsWith" TabIndex="8"
                         >
                        <Items>
                            <telerik:RadComboBoxItem Text="PayCodeName1" />
                            <telerik:RadComboBoxItem Text="PayCodeName2" />
                        </Items>
                    </telerik:RadComboBox>
                    <span style="color: red; font-size: larger; vertical-align: bottom">
                    </span>
                </EditItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridTemplateColumn DataField="OtherHours" HeaderStyle-Width="90px" HeaderText="Hours" UniqueName="OtherHours">
                <ItemTemplate>
                    <asp:Label runat="server" ID="lblOtherHours" Text='<%# Eval("OtherHours") %>'></asp:Label>
                </ItemTemplate>
                <EditItemTemplate>
                    <telerik:RadNumericTextBox ID="txtHours" runat="server" MaxLength="15" Width="80%">
                        <NumberFormat DecimalDigits="2" GroupSeparator="" />
                    </telerik:RadNumericTextBox>
                    <%--<ajax:popupcontrolextender id="PopupControlExtender1" runat="server" popupcontrolid="Panel1" position="Bottom" targetcontrolid="txtHours" />--%>
                    <span style="color: red; font-size: larger; vertical-align: bottom">
                    </span>
                </EditItemTemplate>
            </telerik:GridTemplateColumn>
            
            <telerik:GridTemplateColumn DataField="OtherAmount" HeaderStyle-Width="90px" HeaderText="Amount" UniqueName="OtherAmount">
                <ItemTemplate>
                    <%# Convert.ToDouble(Eval("OtherAmount")).ToString("0.00") %>
                </ItemTemplate>
                <EditItemTemplate>
                    <telerik:RadNumericTextBox ID="txtAmount" runat="server" MaxLength="15" Width="80%">
                        <NumberFormat DecimalDigits="2" GroupSeparator="" />
                    </telerik:RadNumericTextBox>
                    <span style="color: red; font-size: larger; vertical-align: bottom"></span>
                </EditItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridButtonColumn ConfirmText="Delete Other Earnings?" ConfirmDialogType="RadWindow"
                ConfirmTitle="Delete" HeaderText="Delete" HeaderStyle-Width="50px" ButtonType="ImageButton"
                CommandName="Delete" Text="Delete" UniqueName="DeleteColumn">
            </telerik:GridButtonColumn>
        </Columns>
        <PagerStyle Mode="NumericPages" ShowPagerText="False" />
    </MasterTableView>
</telerik:RadGrid>



Code Behind-


            foreach (PayCodeDO _row in payCodeList)
            {
                RadComboBoxItem item = new RadComboBoxItem
                {
                    Value = _row.PayCodeId.ToString() + " " + _row.Description,
                    Text = _row.Description,
                };
                // string noOfHours = Convert.ToString(_row.PaidInAmount);
                item.Attributes.Add("PaidInAmount", _row.PaidInAmount);
                item.Attributes.Add("PaidInHours", _row.PaidInHours);
                item.Attributes.Add("PaidInHrAndAm", _row.PaidInHourseAndAmount);
                payCodeCombo.Items.Add(item);
            }

            payCodeCombo.Items.Insert(0, new RadComboBoxItem(""));



Thank in Advance.

Regards,
Anil

Angel Petrov
Telerik team
 answered on 24 Nov 2014
3 answers
143 views
Hi all,
   Could someone help me with this issue...  I'm wanting to code the AllowedFileExtensions on the server side or make it dymanic...

Code behind:
radAsyncUpload1.AllowedFileExtensions = "doc.docx,pdf.xls".Split(',');

doesn't seem to be working and it fails on the client end.

But when I it's in the control like this it work...

<telerik:RadAsyncUpload ID="radAsyncUpload1" runat="server" AllowedFileExtensions="doc,docx,pdf,xls" />

based on this http://demos.telerik.com/aspnet-ajax/asyncupload/examples/validation/defaultcs.aspx.
Hristo Valyavicharski
Telerik team
 answered on 24 Nov 2014
1 answer
39 views
I have a load-on-demand combobox set with a custom OnItemRequested handler.  The user can start typing a part of a client name, email, address, etc and the custom code will go do a select on the database and return items.

The problem I am having is that IF the items returned from the database do not include the typed text - they are not displayed in the dropdown.  I have set Filter="none" but that does not seem to help.

For Example: I type in ABC - the database finds a match - returns it - and it is databound to the combobox.  However ABC is not actually in the DataTextField or DataValueField - nor is it in any of the fields displayed in the <ItemTemplate> of the dropdown.  In this case, the line does not display.

Is there a workaround for this?  
Nencho
Telerik team
 answered on 24 Nov 2014
2 answers
78 views
Hello,

I'm using a RadGrid with EditForms. I find that when I use GridDropDownColumn, I get a js error generated by telerik's dynamic code when calling the grid edit form.
If I take GridDropDownColumns out of my grid, everything works fine. Even if I'm using a generic GridDropDownColumn with no datafield, I still get the error.

I can't figure out what's causing this, as it worked the day before and I haven't changed anything.

Here's the error message:

Line: 6
Error: Object doesn't support property or method 'toUpperCase'

Here's my grid:

<telerik:RadGrid runat="server" ID="gridMedications" OnItemDataBound="gridMedications_ItemDataBound" OnInsertCommand="gridMedications_InsertCommand" OnDeleteCommand="gridMedications_DeleteCommand" >
    <MasterTableView AutoGenerateColumns="false" NoMasterRecordsText="<i><b>None - Not taking any medications</b></i>"
        CommandItemDisplay="Bottom" EditMode="EditForms" >
        <CommandItemSettings AddNewRecordText="Add Medication" ShowAddNewRecordButton="true" ShowRefreshButton="false" />
        <EditFormSettings EditColumn-InsertText="Add" EditColumn-ButtonType="PushButton" />
        <Columns>
            <telerik:GridBoundColumn DataField="NameOfMed" HeaderText="Medication" UniqueName="NameOfMed" >
                <ColumnValidationSettings EnableRequiredFieldValidation="true">
                    <RequiredFieldValidator SetFocusOnError="true" Display="Dynamic" ForeColor="Red" Text=" *Required" />
                </ColumnValidationSettings>
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="ReasonForTaking" HeaderText="Reason for Taking" UniqueName="ReasonForTaking" DefaultInsertValue="" />
            <telerik:GridBoundColumn DataField="FormOfMed" HeaderText="Form Of Medication" UniqueName="FormOfMedCol" ReadOnly="true" />
            <telerik:GridBoundColumn DataField="Prescription" HeaderText="Rx or OTC" UniqueName="PrescriptionCol" ReadOnly="true" />
            <telerik:GridBoundColumn DataField="ForAllergies" HeaderText="For Allergies?" UniqueName="ForAllergiesCol" ReadOnly="true" />
            <telerik:GridDropDownColumn DataField="FormOfMed" HeaderText="Form Of Medication" UniqueName="FormOfMed" Visible="false" ReadOnly="false" />
            <telerik:GridDropDownColumn DataField="Prescription" HeaderText="Rx or OTC" UniqueName="Prescription" Visible="false" ReadOnly="false" />
            <telerik:GridDropDownColumn DataField="ForAllergies" HeaderText="For Allergies?" UniqueName="ForAllergies" Visible="false" ReadOnly="false" />
 
            <telerik:GridButtonColumn ButtonType="LinkButton" Text="Remove" CommandName="Delete" />
        </Columns>
    </MasterTableView>
</telerik:RadGrid>

Maria Ilieva
Telerik team
 answered on 24 Nov 2014
5 answers
185 views
Hello all,

I have really two problems, but they are connected to each other, so I will explain both in this thread. 

Problem 1 - Loading panel - Master Page

I have been at this for a while, and even though I am following the code sample from here: http://www.telerik.com/help/aspnet-ajax/ajax-show-loadingpanel-on-initial-pageload.html the Loading Panel is not working.

Code for Main.Master:

<telerik:RadCodeBlock runat="server">
    <script type="text/javascript">
 
        function pageLoad(sender, eventArgs) {
            if (!eventArgs.get_isPartialLoad()) {
                $find("<%=RadAjaxManager1.ClientID%>").ajaxRequest("InitialPageLoad");
            }
        }
.....


<form id="form1" runat="server">
         
        <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
 
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" DefaultLoadingPanelID="RadAjaxLoadingPanel1">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="MainContentPanel" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>
 
......


        <div id="mainContent">
            <section class="container-content">
                <div class="bottom-container-content">
                    <div class="content-page">
 
                        <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server"></telerik:RadAjaxLoadingPanel>
                        <asp:Panel ID="MainContentPanel" runat="server">
                            <asp:Panel ID="AjaxMainContentPanel" runat="server" Visible="false">
                                <asp:ContentPlaceHolder ID="MainContent" runat="server"></asp:ContentPlaceHolder>
                            </asp:Panel>
                        </asp:Panel>
 
.......

Code for Main.Master.vb:

Private Sub RadAjaxManager1_AjaxRequest(sender As Object, e As Telerik.Web.UI.AjaxRequestEventArgs) Handles RadAjaxManager1.AjaxRequest
 
    If e.Argument = "InitialPageLoad" Then
        AjaxMainContentPanel.Visible = True
    End If
 
End Sub


Symptoms:

Although the page seems to load in the correct order, master and content page layout, menus, images, etc... the RadAjaxLoadingPanel does not show. 
I have a RadGrid on the content page being loaded from some very heavy queries which can take up to 5 seconds, and the place where the grid would show is blank until the data is loaded. 


Problem 2 - RadGrid's NeedDataSource event will not fire with the above scenario:


 Code for Content.aspx:

<asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="server">
     
    <telerik:RadAjaxManagerProxy ID="AjaxManagerProxy1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="AjaxManagerProxy1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="rdList" LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManagerProxy>
 
    <telerik:RadGrid ID="rdList" runat="server" AllowPaging="False" Skin="Silk" AllowMultiRowSelection="true" AutoGenerateColumns="false">
        <MasterTableView>
            <Columns>
 
.....

Code for Content.aspx.vb:
Private Sub rdList_NeedDataSource(sender As Object, e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles rdList.NeedDataSource
 
    LoadGrid()
 
End Sub

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
 
    If Not Page.IsPostBack Then
 
 
    Else
        If PageIsLoaded.Value <> "true" Then
            rdList.Rebind()
            PageIsLoaded.Value = "true"
        End If
    End If
 
End Sub


Symptoms:

On the initial page load (I haven't gotten to the point where I have any PostBack on the Content page yet), the NeedDataSource event will not fire.
The solution I found was to call the Grid's Rebind() method on the Content page's Page_Load method. However, I am not sure that this is correct. To me it seems an unnecessary action. And I had to use a Hidden Field so that I could check whether or not it's been called so that I don't do any unnecessary rebinds, and it only happens on the initial page load.

Can anyone help?

Thanks!!!




















Maria Ilieva
Telerik team
 answered on 24 Nov 2014
1 answer
55 views
The 2014Q3 release brought about the edit popup dialog.
Will there be any chances to add customn properties to this (and hide default ones)?

Bozhidar
Telerik team
 answered on 24 Nov 2014
1 answer
83 views
Hi,

in my application i have a button that displays a modal popup. in that Modal i have a button that displays another modal popup.
the issue is the second popup shows behind the first one. I have read where people are suggesting using setActive to bring the second modal forward (ontop)
however when i try and get do this using the following code.

                      window.parent.purchaseLicense(licenseTypeId, ownerId, licenseIdToUpgrade, onLicensePurchased);
                      oWindow = window.frameElement.radWindow;
                      setTimeout(function () { oWindow.setActive(true); }, 0);
                   
Owindow is coming back with the first Modal.

How can i get the second modal and show that ontop?
As you can see the second modal is coming  from the parent because i don't want it to be inside the other.


thoughts?




Marin Bratanov
Telerik team
 answered on 24 Nov 2014
2 answers
331 views
My grid has a <telerik:GridClientSelectColumn UniqueName="ClientSelectColumn" HeaderStyle-Width="30px" /> column to start things out. I am then trying to follow this example http://www.telerik.com/help/aspnet-ajax/grid-persist-selected-rows-client-sorting-paging-grouping-filtering.html in order to keep track of what rows I've selected.

However, I find that the javascript event for selecting a row only fires when I press the checkbox in the header ("select all"). And it fires once for every visible row, of course. Why isn't it firing when I click on the checkboxes next to an individual row?
C
Top achievements
Rank 1
 answered on 24 Nov 2014
1 answer
720 views
Just started learning Telerik APIs.  Using C# / Linq.  Reading up on MasterTableView and trying to hook up a simple grid which lists row data from an Orders table, including one column that lists the Name (a GridDropDownColumn) from a Customers table. So far no name is being displayed.

Where do I set datasource for the Customers table - how do I hook this up?
Thanks.
====
CREATE TABLE Customers
  (
    ID int NOT NULL IDENTITY(1,1) PRIMARY KEY,
    Name varchar(128) NOT NULL
  )

CREATE TABLE Orders
  (
    ID int NOT NULL IDENTITY(1,1) PRIMARY KEY,
    Description varchar(32) NOT NULL,
    CustomerID int NOT NULL FOREIGN KEY REFERENCES Customers(ID)
  )


    <telerik:RadGrid runat="server" ID="RadGrid_Order" AutoGenerateColumns="false" AllowPaging="true"
        OnNeedDataSource="RadGrid_NeedDataSource" OnUpdateCommand="RadGrid_UpdateCommand"
        OnItemCreated="RadGrid_ItemCreated" OnDeleteCommand="RadGrid_DeleteCommand"
        OnInsertCommand="RadGrid_InsertCommand" OnItemDataBound="RadGrid_ItemDataBound">
        <MasterTableView DataKeyNames="ID" CommandItemDisplay="Top" InsertItemPageIndexAction="ShowItemOnCurrentPage" EditMode="InPlace">
            <Columns>
                <telerik:GridEditCommandColumn ButtonType="ImageButton" />
                <telerik:GridBoundColumn DataField="ID" HeaderText="ID" ReadOnly="true" ForceExtractValue="Always" ConvertEmptyStringToNull="true" />
                <telerik:GridBoundColumn DataField="Description" HeaderText="Description" />
                <telerik:GridDropDownColumn UniqueName="RadCombo_Customer" HeaderText="Name" DropDownControlType="RadComboBox"
                    DataField="CustomerID" ListDataMember="Customers" ListValueField="ID" ListTextField="Name" />

                <telerik:GridButtonColumn ConfirmDialogType="RadWindow" ConfirmTitle="Delete" ButtonType="ImageButton" CommandName="Delete" />
            </Columns>
            <EditFormSettings>
                <EditColumn ButtonType="ImageButton" />
            </EditFormSettings>
        </MasterTableView>
    </telerik:RadGrid>

        protected void RadGrid_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
        {
           RadGrid_Order.DataSource = OrdersTable.DataSource();  // query returns SELECT * FROM Orders;
        }


Radoslav
Telerik team
 answered on 24 Nov 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?