Hello!
1. How can I set the temporaryFolder to be in the MemoryStream?
2. I am using the control dynamically. That is, one control has several file selection buttons. The problem is that if the user wants to cancel / remove the file that is uploading then the entire line is deleted. How can I cancel / delete only the file and not the entire line (which has a title and a select button)?
Thanks
I'm looking to get my site up to WCAG 2.0 AA and I have a RadAsyncUpload control:
<telerik:RadAsyncUpload ID="mfUpload" runat="server" MultipleFileSelection="Automatic" RenderMode="Auto" Skin="Bootstrap"
OnClientFileUploadFailed="failed" EnableViewState="false" OnClientFilesUploaded="OnClientFilesUploaded"
OnClientFileUploading="OnClientFileUploading" EnableAriaSupport="true"
AllowedFileExtensions="jpg,png,gif,pdf" DisablePlugins="true" OnClientFileSelected="OnClientFileSelected"
OnClientFileUploadRemoved="removed" OnClientFilesSelected="onSelect" OnClientValidationFailed="OnClientValidationFailed"
OnClientAdded="added" Localization-Select="<%$ Resources:GlobalResource, SelectTitle %>"
Localization-Cancel="<%$ Resources:GlobalResource,CancelText %>"
Localization-Remove="<%$ Resources:GlobalResource,RemoveText %>" EnableInlineProgress="true">
</telerik:RadAsyncUpload>
AriaSettings don't seem to be available and I need to set a label to the form element (upload control). I set the EnableAriaSupport=true but I don't think that's going to solve my problem.
What are my options?
Hello,
i have facing problem while i tried to Cascading ComboBoxes inside the radgrid.
my website has to Cascading ComboBoxes first one for Departments and second One for Task List and both working fine but the task combobox while i select any item from the list every time jump to the first item in the list.
could you please advice ? kindly find the code below ?
Protected Sub LoadDepartments()
Dim connection As New SqlConnection(ConfigurationManager.ConnectionStrings("PayrollConnectionString").ConnectionString)
Dim adapter As New SqlDataAdapter("SELECT IDDepartment, DepartmentCode, DepartmentName, DepartmentCode + '-' + DepartmentName AS FullName FROM MasterDepartments ORDER BY DepartmentName", connection)
Dim dt As New DataTable()
adapter.Fill(dt)
For i As Integer = 0 To RadGrid1.Items.Count - 1
DirectCast(RadGrid1.Items(i).FindControl("Department"), RadComboBox).DataTextField = "FullName"
DirectCast(RadGrid1.Items(i).FindControl("Department"), RadComboBox).DataValueField = "DepartmentCode"
DirectCast(RadGrid1.Items(i).FindControl("Department"), RadComboBox).DataSource = dt
DirectCast(RadGrid1.Items(i).FindControl("Department"), RadComboBox).DataBind()
DirectCast(RadGrid1.Items(i).FindControl("Department"), RadComboBox).Items.Insert(0, New RadComboBoxItem("- Select a Department -"))
Next
End Sub
Protected Sub LoadTasks()
Dim connection As New SqlConnection(ConfigurationManager.ConnectionStrings("PayrollConnectionString").ConnectionString)
Dim dt As New DataTable()
For i As Integer = 0 To RadGrid1.Items.Count - 1
Dim adapter As New SqlDataAdapter("SELECT id, Category, Title, SortOrder, Colors, IsEditable, IsVisible, Descripion, SUBSTRING(Title, 1, 2) AS Expr1 FROM dbo.LookUps WHERE (Category = N'task code') AND (SUBSTRING(Title, 1, 2) = @DeptCode)", connection)
adapter.SelectCommand.Parameters.AddWithValue("@DeptCode", DirectCast(RadGrid1.Items(i).FindControl("Department"), RadComboBox).SelectedValue)
DirectCast(RadGrid1.Items(i).FindControl("TaskList"), RadComboBox).DataTextField = "Descripion"
DirectCast(RadGrid1.Items(i).FindControl("TaskList"), RadComboBox).DataValueField = "Expr1"
DirectCast(RadGrid1.Items(i).FindControl("TaskList"), RadComboBox).DataSource = dt
DirectCast(RadGrid1.Items(i).FindControl("TaskList"), RadComboBox).DataBind()
DirectCast(RadGrid1.Items(i).FindControl("TaskList"), RadComboBox).Items.Insert(0, New RadComboBoxItem("- Select a task list -"))
adapter.Fill(dt)
Next
On C#/ASP.NET I am creating a graph that I am putting dates on X axis; however, the dates are only being displayed on the major ticks. Does RadHtmlChart have a setting to display dates on minor ticks as well ?
I am attaching a screenshot.
Thanks
Hello,
I'm currently looking into using a grid with Batch Editing and custom EditItemTemplates. I'm running into a wall because I need the custom template for editing to render differently depending on the values in the DataItem object for the row that is being edited.
I've created an example that is attached, and will describe it to hopefully outline what I'm trying to do.
In a database that contains people, some people are under organizations, and within those organizations are different bosses. I've created a dictionary that contains the list of bosses for 2 organizations with Id's 0 and 1. The grid shows a list of people, and if you go to edit the boss selection for any given person I'm trying to have the drop down list display different items in the list depending on the organization id for that person.
Because the DataBinding event does not fire for custom templates that are used on the EditItemTemplate property of a TemplateColumn I'm at a loss on how to do this. I've thought of creating a new class that inherits the Control class, then overriding the Render() function in hopes that I may be able to access the DataItem through the parent hierarchy but my knowledge of the RadGrid structure isn't enough to figure this out.
Here is a simple example of my code. I've made comments in the InstantiateIn function with what I'm trying to do.
Any help would be greatly appreciated and thanks in advance.
TestItemTemplate.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="TestItemTemplate.aspx.cs" Inherits="Test_TestItemTemplate" %>
<!DOCTYPE html>
<
html
xmlns
=
"http://www.w3.org/1999/xhtml"
>
<
head
runat
=
"server"
>
<
title
></
title
>
</
head
>
<
body
>
<
form
id
=
"form1"
runat
=
"server"
>
<
telerik:RadScriptManager
ID
=
"ScriptManager"
runat
=
"server"
EnableTheming
=
"True"
>
</
telerik:RadScriptManager
>
<
div
>
<
asp:Panel
runat
=
"server"
ID
=
"Panel"
>
<
telerik:RadGrid
runat
=
"server"
ID
=
"grid"
>
</
telerik:RadGrid
>
</
asp:Panel
>
</
div
>
</
form
>
</
body
>
</
html
>
TestItemTemplate.aspx.cs
using System;
using System.Collections.Generic;
using System.Data;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;
public partial class Test_TestItemTemplate : Page
{
private class GridItemTemplate : ITemplate
{
string _colName;
public GridItemTemplate(string colName)
{
_colName = colName;
}
public void InstantiateIn(Control container)
{
Label label = new Label();
label.DataBinding += new EventHandler(Label_DataBinding);
container.Controls.Add(label);
}
void Label_DataBinding(object sender, EventArgs e)
{
Label label = (Label)sender;
GridDataItem container = (GridDataItem)label.NamingContainer;
label.Text = ((DataRowView)container.DataItem)[_colName].ToString();
}
}
private class GridEditItemTemplate : ITemplate
{
Dictionary<
int
, List<ListItem>> organizationBosses = new Dictionary<
int
, List<ListItem>>
{
{ 0, new List<
ListItem
> { new ListItem("Harry"), new ListItem("Jim") } },
{ 1, new List<
ListItem
> { new ListItem("Jen") } }
};
string _colName;
public GridEditItemTemplate(string colName)
{
_colName = colName;
}
public void InstantiateIn(Control container)
{
DropDownList ddl = new DropDownList();
// Add the default item
ddl.Items.Add(new ListItem("Self"));
// This event will never fire to my knowledge
// ddl.DataBinding += new EventHandler(ddl_databinding);
// Somehow get the parent DataItem container upon rendering to retrieve the "OrganizationId" value from the dataitem so I can show the additional items for the Boss drop down list
// If (OrganizationId == 0)
// ddl.Items.AddRange(organizationBosses[0].ToArray());
// Else if (OrganizationId == 1)
// ddl.Items.AddRange(organizationBosses[1].ToArray());
container.Controls.Add(ddl);
}
}
protected void Page_Init(object sender, EventArgs e)
{
grid.AutoGenerateColumns = false;
GridBoundColumn boundColumn1 = new GridBoundColumn();
boundColumn1.DataField = "PersonId";
boundColumn1.UniqueName = "PersonId";
boundColumn1.Display = false;
grid.MasterTableView.Columns.Add(boundColumn1);
boundColumn1.DataField = "OrganizationId";
boundColumn1.UniqueName = "OrganizationId";
boundColumn1.Display = false;
grid.MasterTableView.Columns.Add(boundColumn1);
boundColumn1 = new GridBoundColumn();
boundColumn1.DataField = "FirstName";
boundColumn1.UniqueName = "FirstName";
boundColumn1.HeaderText = "First Name";
grid.MasterTableView.Columns.Add(boundColumn1);
boundColumn1 = new GridBoundColumn();
boundColumn1.DataField = "LastName";
boundColumn1.UniqueName = "LastName";
boundColumn1.HeaderText = "Last Name";
grid.MasterTableView.Columns.Add(boundColumn1);
boundColumn1 = new GridBoundColumn();
boundColumn1.DataField = "Email";
boundColumn1.UniqueName = "Email";
boundColumn1.HeaderText = "Email";
grid.MasterTableView.Columns.Add(boundColumn1);
GridTemplateColumn templateColumn = new GridTemplateColumn();
GridItemTemplate itemTemplate = new GridItemTemplate("Boss");
templateColumn.ItemTemplate = itemTemplate;
GridEditItemTemplate editItemTemplate = new GridEditItemTemplate("Boss");
templateColumn.EditItemTemplate = editItemTemplate;
templateColumn.HeaderText = "Boss";
grid.MasterTableView.Columns.Add(templateColumn);
grid.MasterTableView.EditMode = GridEditMode.Batch;
grid.MasterTableView.BatchEditingSettings.EditType = GridBatchEditingType.Cell;
grid.MasterTableView.BatchEditingSettings.OpenEditingEvent = GridBatchEditingEventType.Click;
grid.DataSource = GetDataSource();
grid.AllowPaging = true;
grid.PageSize = 50;
}
private DataTable GetDataSource()
{
DataTable dataSource = new DataTable();
dataSource.Columns.AddRange(new DataColumn[] {
new DataColumn("PersonId"),
new DataColumn("OrganizationId"),
new DataColumn("FirstName"),
new DataColumn("LastName"),
new DataColumn("Email"),
new DataColumn("Boss")
});
dataSource.Rows.Add(new object[] { 0, null, "John", "Doe", "john@doe.com", "Self" });
dataSource.Rows.Add(new object[] { 1, 0, "Bill", "Carson", "bill@carson.com", "Harry"});
dataSource.Rows.Add(new object[] { 2, 0, "Jessie", "Jones", "jessie@jones.com", "Jim"});
dataSource.Rows.Add(new object[] { 3, 1, "Joe", "Schmoe", "joe@schmoe.com", "Jen" });
dataSource.Rows.Add(new object[] { 4, null, "Sarah", "Conner", "sarah@conner.com", "Self" });
return dataSource;
}
}
hi
I use function OnClientFilesUploaded() in that i call one button click event in the button click i save the file in DB ,after i click the browser back button i check AsyncUpload1.UploadedFiles.Count=0 in IE,mozila,chrome,opera but in edge AsyncUpload1.UploadedFiles.Count=1 so in this path "E:\MU\AKPKCheckin\App_Data\RadUploadTemp" the file is not there so it through error message "could not find the file...." in that location.
Hello,
After i updated my Telerik ASP.NET AJAX to the 2018.3.910 version i got some bugs to my site.
When i push a tab or a button nothing at all happens and a '#' appears after my link in the URL.
This problem does not happen at all of my pages on my site. I have tried google this problem and looked here at your site but haven't found any solution for it.
I didn't had this problem before i updated the Telerik version.
Best regards, Tim
Hi,
The image draghandles are gone in Firefox 65.0.2
Is this a known issue?
Marc