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

I am trying to upload a simple csv file with 6 columns via RadAsyncUpload. But everytime I try I get a 'File contains corrupted data' . But as soon as I convert the csv to xlsx. it uploads without issue. 

 

Is there a way to fix this?

Mark
Top achievements
Rank 2
Iron
Iron
Iron
 asked on 20 Dec 2021
1 answer
369 views

I'm not getting an error and the alert shows the correct tab ID, any ideas why the tab is not hiding.

function HideHistoryTab(sender, e)
{
	var tabIndex = sender.get_activeTabIndex();
	if (tabIndex == 0 || tabIndex == 1)
	{
		var tabStrip = $find(_TabClientID);
		var tabs = tabStrip.get_tabs();
		//alert(tabs[3].get_id());
		tabs[3].set_visible(false);
	}
}

Vessy
Telerik team
 answered on 20 Dec 2021
1 answer
380 views

I am dealing with a scenario where in grid , whether user clicks on a row or uses up/down arrow in the grid to select a row, it should do a postback and update other fields on the page. During research I have found that EnablePostBackOnRowClick and AllowKeyboard Navigation cannot work at the same time. This is what I have :

<Selecting AllowRowSelect="true" />

 <ClientEvents OnRowSelected="GridRowSelected" OnRowMouseOver="RowMouseOver" />

 

  function GridRowSelected(sender, args) {

// do a post back to update other controls on the  page

}

 

Can someone please help me in achieving this? I have tried different methods explained in forum but nothing worked for me. In short, I want it to do a post back  when either user clicks on a row or make a selection using keyboard navigation and call this:

  void RadGrid1_SelectedIndexChanged(object sender, EventArgs e)

{

}

 

Doncho
Telerik team
 answered on 20 Dec 2021
1 answer
257 views

Hi,

I'm trying to use the RowDrop method of the Radgrid to change the sort order in the database.  Each row in the database table has a "SortOrder" column to indicate the order in which items should appear. 

I want to allow the user to quickly change these orders.

Do you have any code samples that could easily do this?  The example provided online doesn't seem to address this.

Thank you!

 

Attila Antal
Telerik team
 answered on 17 Dec 2021
1 answer
654 views

I'm trying to remove the vertical scroll bar from a radgrid.  I'm not enabling paging and don't want to show the vertical scrolling. I only need the horizontal function.    Any help would be appreciated.   

 

Thanks

Doncho
Telerik team
 answered on 16 Dec 2021
1 answer
882 views

Hello,

 

is it possible to set the content-type of the file when uploading to Azure blob storage using radcloudupload?

 

 

Thanks

Peter Milchev
Telerik team
 answered on 15 Dec 2021
2 answers
7.5K+ views

Hello.

I'm trying to save files in DB, which should record the file as "BinaryData".

I'm using RadAsyncUpload, but when i upload the file i get the extension "System.IO.IOException: The process cannot access the file because it is being used by another process." and the file only gets loaded in the App_Data folder of my app, in an automatically created "RadUploadTemp" folder.

I've tried to disable the Path mentions in my SaveFile method, getting "Path not found error". Any of the available telerik demos is similar to my context. 

How do i solve this?


//my insert/update operations method
public void SaveFile(object sender, EventArgs e)
        {
            ListagemTimesheet model = new ListagemTimesheet();
            model.IDRecursoHumano = Convert.ToInt32(rdpInvestigadorE.Text);
            model.IDEstadoTimesheet = Convert.ToInt32(rcbEstado.SelectedValue);
            model.Observações = Obervaçoestxt.Text;
            model.AssinaturaTimesheet = txtAssinaturaTimesheet.Text;
            model.DataEnvio = DataEnvio.SelectedDate.Value;

            if (!string.IsNullOrEmpty(Ficheiro) && FileTipo != null)
            {
                model.Ficheiro = Path.GetFileNameWithoutExtension(Ficheiro);
                model.FileContent = fileBytes;
                model.FileTipo = Path.GetExtension(FileTipo);
            }
            if (!string.IsNullOrEmpty(FileID.Text) && Convert.ToInt32(FileID.Text) > 0)
            {
                model.ID = Convert.ToInt32(FileID.Text);
                listagembll.UpdateFile(model);
            }
            else
            {
                listagembll.InsertFile(model);
            }

//Ascx.Cs method

public void RadAsyncUpload1_FileUploaded(object sender, FileUploadedEventArgs e)
        {

            RadAsyncUpload1.Visible = false; //false
            var liItem = new HtmlGenericControl("li");
            Ficheiro = e.File.FileName; // sintaxe metodo
            FileTipo = e.File.ContentType;
            e.IsValid = true;
            e.File.InputStream.Position = 0;
            fileBytes = new byte[e.File.InputStream.Length];
            for (int totalBytesCopied = 0; totalBytesCopied < e.File.InputStream.Length; )
                totalBytesCopied += e.File.InputStream.Read(fileBytes, totalBytesCopied, Convert.ToInt32(e.File.InputStream.Length) - totalBytesCopied); //conversao para bytes
        }

//Ascx reference

<telerik:RadAsyncUpload ID="RadAsyncUpload1" runat="server" AllowedFileExtensions="xlsx,xlsm,xls,txt,pdf" EditFormColumnIndex="1" MultipleFileSelection="Disabled"  RenderMode="Lightweight" TargetFolder=""  OnFileUploaded="RadAsyncUpload1_FileUploaded" UploadedFilesRendering="BelowFileInput" >
                                        </telerik:RadAsyncUpload>
                                        <br />
                                        <span class="allowed-attachments">Formatos permitidos: <span class="allowed-attachments-list">pdf,xlsx,xlsm,xls,txt</span></span> &nbsp; </td>


 

Harlem98
Top achievements
Rank 1
Iron
Iron
Iron
 updated answer on 14 Dec 2021
1 answer
254 views

Hello

I'm trying to perform insert operation in a RadWindow. My scenario integrates the searchbox selected value, which should not be editable and automatically filled in insert, and for the rest, the normal empty fields, including the primary key.

I've already done the edit operation, with the following structure, but i cannot modify properly to the insert. Besides, when i push Insert button, i get the last assinged values, as the radwindow does not perform reload

Could you help me please?


 public void SaveFile(object sender, EventArgs e)
        {
            ListagemTimesheet model = new ListagemTimesheet();
           
            model.IDRH = Convert.ToInt32(rdpIE.Text);
            model.IDState = Convert.ToInt32(rcbEstado.SelectedValue);
            model.Obs = Obstxt.Text;
            model.Assin = txtAssin.Text;
            model.Date = Date.SelectedDate.Value;

            if (Objecto.ID > 0)
            {
                model.ID = Convert.ToInt32(FileID.Text);

                if (!string.IsNullOrEmpty(FileID.Text) && Convert.ToInt32(FileID.Text) > 0)
                {
                    model.ID = Convert.ToInt32(FileID.Text);
                    bll.UpdateFile(model);

                }
                else
                {
 
                }
            }
            else //Insert

//Command item events


                if (e.CommandName == "EditItem")
                {
                    
                    try
                    {
                        string script = "function f(){openRadWindow(); Sys.Application.remove_load(f);}Sys.Application.add_load(f);";
                        ScriptManager.RegisterStartupScript(Page, Page.GetType(), "key", script, true);
                        e.Canceled = true;

                        int idts= int.Parse(e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["ID"].ToString());
                        Dataclass ts= bll.GetFileByID(idts);
                        Editform.Object = ts;            
                        Editform.DataBind();
                        grid.Rebind();
                       
                      }


                    catch (System.Exception)
                    {
     
                    }

                    
                }

                    if (e.CommandName == "InsertItem")

//help

Doncho
Telerik team
 answered on 14 Dec 2021
1 answer
227 views

I would like to have a button with arrow image inside AutoCompleteBox (this control will be created in code behind), so after pressing it the dropdownlist with current text matching items would show up (if no text is present, then the first X number of items). I have the control already made in Winforms (using your Winforms components, attachment shows the winform's control look), so I was wondering if the same can be made in ASP.NET?

 

(btw: if you want to see the code of my Winform's control then you can see in this thread: https://www.telerik.com/forums/click-event-not-firing-for-autocompletesuggesthelper-popup-of-raddropdownlist )

Doncho
Telerik team
 answered on 14 Dec 2021
1 answer
854 views

Does the library "Telerik UI for ASP.NET AJAX" vulnerable toi the Log4j issue?

On specific, we use:

Telerik UI for ASP.NET AJAX design time  - Telerik.Web.Design - Telerik.Web.Design.dll - 2020.2.617.45
Telerik Device Detection for ASP.NET Ajax - Telerik.Web.Device.Detection - 2020.2.617.45 - Telerik.Web.Device.Detection.dll
Progress® Telerik® UI for ASP.NET AJAX - Telerik.Web.UI - 2020.2.617.45 - Telerik.Web.UI.dll
Telerik UI for ASP.NET AJAX Ajax Skins - Telerik.Web.UI.Skins - 2020.2.617.45 - Telerik.Web.UI.Skins.dll

 

 

 

 

Vessy
Telerik team
 answered on 14 Dec 2021
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?