Telerik Forums
UI for ASP.NET AJAX Forum
0 answers
39 views

I success show the full length ddl.item.text(selected choice) in limited length ddl. But I want to use it in ddl items too, what should I do?

Form.aspx

<tr>
   <td>
      <asp:Label ID="lblFolderPath" runat="server" Width="75px" Text="Folder Path: " ></asp:Label>

      <ToolTip1>
         <telerik:RadDropDownList ID="ddlFolderPath" runat="server" Skin="Windows7" 
            Width="650px" Height="23px" AutoPostBack="True" 
            onClientSelectedIndexChanged="loadingAnimation">
            <Items>
               <telerik:DropDownListItem runat="server" DropDownList="ddlFolderPath " Text="" />
            </Items>
         </telerik:RadDropDownList>
      </ToolTip1>
   </td>
</tr>

Form.aspx.vb

Select Case GetMMRCode("CueSheetImportSegmentRoot", CurrentSide, ReturnTable) 'CurrentSide = DEV
   Case 0
      '// Get ddl choices from DB
      ddlFolderPath.Items.Clear()  'Prevent do items.add multiple times

      For Each row As DataRow In ReturnTable.Rows
         ddlFolderPath.Items.Add(New DropDownListItem(CType(row.Item("Opt1"), String), CType(row.Item("Code"), String)))  
     Next
End Select



Matthew
Top achievements
Rank 1
 updated question on 09 Dec 2024
1 answer
39 views

I am working with multiple RadAsyncUpload controls, and for each RadAsyncUpload, I use a RadProgressBar to track the progress of the file uploads. However, I am encountering an issue when uploading multiple files to one of the RadAsyncUpload controls. In this case, all the RadProgressArea components display unexpectedly, as shown in the screenshot below.

Can anyone help by providing sample code or advice to handle this case?

Rumen
Telerik team
 answered on 05 Dec 2024
1 answer
28 views

This Telerik aspx-ajax RadScheduler is driving me nuts. Normally i prefer Telerik Web UI to DevExpress anything, but I'm banging my head against a wall here and not getting anywhere.I have two interdependent selections to make when adding an appointment on the scheduler. I need to select a doctor, and I need to select a patient (patients filtered by the selected doctor). The rest is your standard date and time and subject gumpf.For this I'm using the <AdvancedInsertTemplate> and <AdvancedUpdateTemplate> elements of the scheduler:

<AdvancedInsertTemplate>
   <div class="rsAdvancedEdit rsAdvancedModal" style="position: relative; height: 300px;">
       <div class="rsModalBgTopLeft">
       </div>
       <div class="rsModalBgTopRight">
       </div>
       <div class="rsModalBgBottomLeft">
       </div>
       <div class="rsModalBgBottomRight">
       </div>
       <div class="rsAdvTitle">
           <h1 class="rsAdvInnerTitle">
               <%# Container.Appointment.Owner.Localization.AdvancedEditAppointment %></h1>
           <asp:LinkButton runat="server" ID="LinkButton1" CssClass="rsAdvEditClose"
               CommandName="Cancel" CausesValidation="false" ToolTip='<%# Container.Appointment.Owner.Localization.AdvancedClose %>'>
               <%# Container.Appointment.Owner.Localization.AdvancedClose%>
           </asp:LinkButton>
       </div>
       <div class="rsAdvContentWrapper">
           <div class="form-horizontal">
               <div class="form-group">
                   <label class="col-md-2 control-label">Subject</label>
                   <div class="col-md-10">
                       <asp:TextBox runat="server" ID="AppointmentSubject" CssClass="col-md-10 form-control" />
                   </div>
               </div>
               <div class="form-group">
                   <label class="col-md-2 control-label">Start time:</label>
                   <div class="col-md-10">
                       <telerik:RadDateTimePicker RenderMode="Lightweight" ID="StartTime" SelectedDate='<%# DateTime.Now.Date %>' runat="server"
                           EnableSingleInputRendering="false" />
                   </div>
               </div>
               <div class="form-group">
                   <label class="col-md-2 control-label">Doctor:</label>
                   <div class="col-md-10">
                       <asp:DropDownList runat="server" ID="DoctorsList"
                           CssClass="form-control" />
                   </div>
               </div>
               <div class="form-group">
                   <label class="col-md-2 control-label">Patient Name:</label>
                   <div class="col-md-10">
                       <asp:DropDownList runat="server" ID="PatientsList"
                           CssClass="form-control" />
                    </div>
               </div>
           </div>
           <asp:Panel runat="server" ID="Panel1" CssClass="rsAdvancedSubmitArea">
               <div class="rsAdvButtonWrapper">
                   <asp:LinkButton CommandName="Insert" runat="server" ID="LinkButton2" CssClass="rsAdvEditSave">
                       <span><%# Container.Appointment.Owner.Localization.Save%></span>
                   </asp:LinkButton>
                   <asp:LinkButton runat="server" ID="LinkButton3" CssClass="rsAdvEditCancel" CommandName="Cancel"
                       CausesValidation="false">
                       <span><%# Container.Appointment.Owner.Localization.Cancel%></span>
                   </asp:LinkButton>
               </div>
           </asp:Panel>
       </div>
   </div>
</AdvancedInsertTemplate>

Now in all cases, I would prefer a telerik RadComboBox in place of the DropDownList for the Patients selection as I can allow the user to type the patient's name and get an item back, but the damn thing won't bind.If I use the RadComboBox here, the markup errors while creating the form saying that there is no data source for the list.Here's my binding code:


protected void RadScheduler_FormCreated(object sender, SchedulerFormCreatedEventArgs e)
{
	if (e.Container.Mode == SchedulerFormMode.AdvancedEdit || e.Container.Mode == SchedulerFormMode.AdvancedInsert)
	{
		var doctorsDropdown = e.Container.FindControl("DoctorsList") as DropDownList;
		_doctorsList = doctorsDropdown;
		var patientsDropdown = e.Container.FindControl("PatientsList") as DropDownList;
		_patientsList = patientsDropdown;
		DoInitialBindings(doctorsDropdown, patientsDropdown);
		e.Appointment.End = e.Appointment.Start.AddHours(1);
	}
}
private void DoInitialBindings(DropDownList doctorsList, DropDownList patientsList)
{
   var doctorHelper = new DoctorsHelper();
   var doctorItems = new List<DoctorsViewModel>();
   var patientHelper = new PatientsHelper();
   var patientItems = new List<PatientsViewModel>();
   // Gets all the doctors and patients relevant to the Medical Practice
   // where the user is a receptionist.
   if (Roles.IsUserInRole(nameof(UserRole.Receptionist)))
   {
       int.TryParse(Request.Cookies["lcyduh"]["practice"], out int practiceId);
       doctorItems = doctorHelper.ListItemsForParent(practiceId);
       foreach (var doctor in doctorItems)
       {
           patientItems.Add(patientHelper.ListItemsForDoctor(doctor.Id));
       }
   }
   doctorsList.DataSource = doctorItems;
   doctorsList.DataTextField = "Name";
   doctorsList.DataValueField = "Id";
   doctorsList.DataBind();
   patientsList.DataSource = patientItems;
   patientsList.DataTextField = "Firstname"; // Firstname and Lastname fields are concatenated into the Firstname field by the helper function that retrieves the data.
   patientsList.DataValueField = "Id";
   patientsList.DataBind();
}
This works but its just a little bit blegh in terms of user friendly.Any ideas how I can bind this to a RadComboBox?
Attila Antal
Telerik team
 updated answer on 05 Dec 2024
1 answer
45 views

hi,

 

we are looking for a component (client side is preferred) that gets 2 inputs: a json schema and a json data fields that match the schema.

the component should generate a static html component (not inputs) to nicely display the data values according to the schema

for example in case we have 3 items of types string, number and boolean.

Name:  David the king

Age:      38

Married:    Yes

 

do you have such component?  maybe created as PDF?

Rumen
Telerik team
 answered on 03 Dec 2024
1 answer
56 views

Good afternoon,

I'm using a RadGrid with Batch Editing.  The grid is populated using OnNeedDataSource.

<telerik:RadGrid ID="RadGridEntries" runat="server" RenderMode="Lightweight" AllowSorting="True" CellSpacing="-1" GridLines="Horizontal"
    OnNeedDataSource="RadGridEntries_NeedDataSource" AllowAutomaticUpdates="false"
    AllowAutomaticInserts="false" AllowAutomaticDeletes="false" OnBatchEditCommand="RadGridEntries_BatchEditCommand"
    OnPreRender="RadGridEntries_PreRender">
    <ClientSettings>
        <Scrolling AllowScroll="true" UseStaticHeaders="true" SaveScrollPosition="true" />
    </ClientSettings>
    <MasterTableView Name="Authorities" AutoGenerateColumns="false" DataKeyNames="Index_id"
        CommandItemDisplay="Top" EditMode="Batch" BatchEditingSettings-OpenEditingEvent="DblClick" HeaderStyle-HorizontalAlign="Center">
        <CommandItemSettings ShowRefreshButton="false" />
        <BatchEditingSettings EditType="Row" HighlightDeletedRows="true" />
        <Columns>
            <telerik:GridBoundColumn DataField="Index_id" UniqueName="Index_id" ReadOnly="true" Visible="false" Exportable="false" />
            <telerik:GridBoundColumn DataField="Authority" SortExpression="Authority" UniqueName="Authority"
                HeaderText="Authority" MaxLength="2">
				<ColumnValidationSettings EnableRequiredFieldValidation="true">
					<RequiredFieldValidator ForeColor="Red" Text="*Authority is required" Display="Dynamic">
					</RequiredFieldValidator>
				</ColumnValidationSettings>
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="Short_description" SortExpression="Short_description" UniqueName="Short_description"
                MaxLength="30" HeaderText="Short Description" ItemStyle-HorizontalAlign="Left" HeaderStyle-Width="150px">
				<ColumnValidationSettings EnableRequiredFieldValidation="true">
					<RequiredFieldValidator ForeColor="Red" Text="*Short Description is required" Display="Dynamic">
					</RequiredFieldValidator>
				</ColumnValidationSettings>
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="Long_description" SortExpression="Long_description" UniqueName="Long_description"
                MaxLength="100" HeaderText="Long Description" ItemStyle-HorizontalAlign="Left" HeaderStyle-Width="200px" />
            <telerik:GridTemplateColumn DataField="Percentage" SortExpression="Percentage" UniqueName="Percentage" HeaderText="Percentage">
                <ItemTemplate>
                    <%#DataBinder.Eval(Container.DataItem, "Percentage","{0} %")%>
                </ItemTemplate>
                <EditItemTemplate>
                    <span>
                        <telerik:RadNumericTextBox RenderMode="Lightweight" Width="75px" runat="server" ID="txtPercentage"
                            MaxValue="100" MinValue="-100">
                            <NumberFormat DecimalDigits="3" NegativePattern="-n %" PositivePattern="n %" />
                        </telerik:RadNumericTextBox>
                        <span style="color: Red">
                            <asp:RequiredFieldValidator ID="rvPercentage"
                                ControlToValidate="txtPercentage" ErrorMessage="*Percentage is required" runat="server" Display="Dynamic">
                            </asp:RequiredFieldValidator>
                        </span>
                    </span>
                </EditItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridCheckBoxColumn DataField="IsPriceList" DataType="System.Boolean" SortExpression="IsPriceList"
                StringFalseValue="0" StringTrueValue="1" HeaderText="Price List" />
            <telerik:GridBoundColumn DataField="Date_amended" SortExpression="Date_amended" HeaderText="Date Amended" ReadOnly="true" />
        </Columns>
    </MasterTableView>
</telerik:RadGrid>

In RadGridEntries_BatchEditCommand I'm capturing the old and new values:

Hashtable newValues = command.NewValues;
Hashtable oldValues = command.OldValues;

But the Percentage template column is missing from OldValues:

The Percentage column is stored as a decimal(6,3).  I'm trying to display the value with the 3 d.p and a % sign.  It's not stored as a percentage i.e. if the value is stored as 10.505 then it is displayed as 10.505 - I'm not storing it divided by 100.

I'm using the Command Item buttons to Save and Insert.

What can I do to make sure that the Percentage Old Value is stored so that I can compare it to the New Value?

Kind regards,

Richard

Richard
Top achievements
Rank 4
Iron
Iron
Iron
 answered on 29 Nov 2024
1 answer
57 views

I just updated to ASP>NET AJAX 2024 Q4 and I get an error in the following code...

string fileName = "SampleFile.xlsx"; 
 
IWorkbookFormatProvider formatProvider = new XlsxFormatProvider(); 
 
using (Stream output = new FileStream(fileName, FileMode.Create)) 
{ 
    formatProvider.Export(workbook, output); 
} 

'formatProvider.Export(workbook, output);' is looking for an additional parameter now 'TimeSpan? timeout'.

I took a guess and entered null and it seems to work.

What are the options for this new parameter?

Rumen
Telerik team
 updated answer on 29 Nov 2024
2 answers
83 views

When you switch between the Design tab and the HTML tab in the RadEditor, it does not remember your position in the text/content.

It seems like this is a bug, but I am wondering if there is any way to tell the RadEditor to remember the position when switching between those two tabs.

If you have a large amount of content with many HTML tags it becomes quite difficult to find the exact position you were in on the other tab.

 

Rumen
Telerik team
 answered on 29 Nov 2024
1 answer
36 views

Hello,

 

I have the advanced template setup like so in the radscheduler:

 


                        <AdvancedEditTemplate> 
                        <div class="card" style="padding:10px" >
                            <div class="card-header corpsnet_panelPrimary" style="padding:10px">
                                <strong><h4><asp:Label ID="lblTitle"  runat="server" Text='<%# Bind("RosterDateStringLong") %>' ></asp:Label></h4></strong>
                            </div>
                            <div class="card-body smallscreensection" style="padding:10px">
                                <div class="container">
                                    <div class="row">
                                        <div class="col-md-4" >                                           
                                           CREW:</h5>
                                        </div>
                                        <div class="col-md-8" >
                                            <h5 class="card-title"><asp:Label ID="lblCrew" runat="server" Text='<%# Bind("CrewName") %>' ></asp:Label></h5>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-4" >                                           
                                           <h5>SUPERVISOR:</h5>
                                        </div>
                                        <div class="col-md-8" >
                                            <h5 class="card-title"><asp:Label ID="Label1" runat="server" Text='<%# Bind("SupervisorUserProfileName") %>' ></asp:Label></h5>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-4" >                                           
                                           <h5>MEETING POINT (Click for directions):
                                        </div>
                                        <div class="col-md-8" >
                                            <h5 class="card-title-link"><asp:HyperLink runat="server" ID="hyplnkMeetingPoint" Target="_blank" Text='<%# Bind("MeetingPointDescription") %>' NavigateUrl='<%# Bind("MeetingPointURL") %>' ></asp:HyperLink></h5>
                                        </div>
                                     </div>
                                    <div class="row">
                                        <div class="col-md-4" >                                           
                                           <h5>MEETING/START TIME:
                                        </div>
                                        <div class="col-md-8" >
                                            <h5 class="card-title"><asp:Label  ID="lblStartTime" runat="server" Text='<%# Bind("StartTimeString") %>' ></asp:Label></h5>
                                        </div>
                                     </div>
                                    <div class="row">
                                        <div class="col-md-4" >                                           
                                           <h5>PROJECT:</h5>
                                        </div>
                                        <div class="col-md-8" >
                                            <h5 class="card-title"><asp:Label  ID="lblProject" runat="server" Text='<%# Bind("Project") %>' ></asp:Label></h5>
                                        </div>
                                     </div>
                                    <div class="row">
                                        <div class="col-md-12" >                                           
                                           <asp:Button ID="btnClose" CssClass="btn btn-primary" runat="server" Text="Close" OnClientClick="closeEditForm(); return false;" />
                                        </div>
                                     </div>
                                </div>
                            </div>
                        </div>
                        </AdvancedEditTemplate>                         

I want the close button to revert to the weekview from the edit form.  I can get the form to close but it's then blank.  How do I show the radscheduler weekview view again on close.  here is my closeEditForm javascript function


        function closeEditForm() {
            var scheduler = $find("<%= RadScheduler1.ClientID %>");
            scheduler.hideAdvancedForm();
            // Switch the view to Month View
            scheduler.set_selectedView(Telerik.Web.UI.SchedulerViewType.MonthView);
            scheduler.navigateToDate(new Date()); // Optional: Navigate to today's date 
            return false;
        }
thanks!!
Rumen
Telerik team
 answered on 27 Nov 2024
4 answers
48 views

I try to use

         <telerik:RadFileExplorer ID="RadFileExplorer1" Runat="server" EnableEmbeddedSkins="True"
             InitialPath="\\network\EL00394132">
             <Configuration ViewPaths="\\network\EL00394132" 
                 DeletePaths="\\network\EL00394132" 
                 UploadPaths="\\network\EL00394132" SearchPatterns="*.*"/>
        </telerik:RadFileExplorer>

 

access a network shared folder by creating my own FileBrowserContentProvider 

            this.RadFileExplorer1.Configuration.ContentProviderTypeName = typeof(Extensions.NetworkShareProvider).AssemblyQualifiedName;

It can view files

 

But when I try to upload a file

 

After click Upload button, it triggers my own FileBrowserContentProvider class

but no files are being uploaded, then get an error

 

it dose not trigger

 

How to fix? Please help !

Rumen
Telerik team
 answered on 22 Nov 2024
1 answer
56 views

When I try to open a file I'd like to be able to click on a link to an Excel file and have it open directly in Excel on my computer, without any intermediate popup windows. Is this possible? or download to local?

Rumen
Telerik team
 answered on 22 Nov 2024
Narrow your results
Selected tags
Tags
+? more
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?