Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
229 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
618 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
860 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.4K+ 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
243 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
214 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
849 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
1 answer
504 views
as far as I understand the tab colors are dictated by an image and can't be changed using css alone, you'll need to change the image, so how would I for example change it from the default black to a blue?
Vessy
Telerik team
 answered on 13 Dec 2021
1 answer
87 views

Hiya,

I have a grid with a template column that contains a RadColorPicker. I would like to read the color values in a postback.  However, using the code below, I'm only getting the values from the original data source.

ASPX:

<telerik:RadGrid ID="grdUser" runat="server" AllowMultiRowSelection="true" AutoGenerateColumns="false" ShowStatusBar="true"
            AllowSorting="True" AllowFilteringByColumn="true"
            OnItemDataBound="grdUser_ItemDataBound">
            <MasterTableView DataKeyNames="UserId, UserName, HexCode" CommandItemDisplay="None">
                <Columns>
                    <telerik:GridClientSelectColumn UniqueName="ClientSelectColumn" HeaderStyle-Width="40px"/>

                    <telerik:GridBoundColumn UniqueName="UserName" HeaderText="Name" DataField="UserName" /> 

                    <telerik:GridTemplateColumn DataField="HexCode" HeaderText="Route Colour" UniqueName="HexCode">
                        <EditItemTemplate>
                            <telerik:RadColorPicker ID="editColor" runat="server" SelectedColor='<%# Bind("HexCode") %>' />
                        </EditItemTemplate>
                         <ItemTemplate> 
                             <telerik:RadColorPicker id="RadColorPicker1" runat="server" ShowIcon="true" /> 
                         </ItemTemplate>
                    </telerik:GridTemplateColumn>
                </Columns>
            </MasterTableView>
            <ClientSettings>
                <Selecting AllowRowSelect="true" />
                <Scrolling AllowScroll="True" UseStaticHeaders="True" />
            </ClientSettings>
        </telerik:RadGrid>

        <telerik:RadButton ID="btnGo" runat="server" Text="Go"  />

C#:

 protected void Page_Load(object sender, EventArgs e)
    {
        if (!this.IsPostBack)
        {
            DataTable dataTable = new DataTable();
            dataTable.Columns.Add("UserId", typeof(long));
            dataTable.Columns.Add("UserName", typeof(string));
            dataTable.Columns.Add("HexCode", typeof(string));

            dataTable.Rows.Add(1, "Bob", "#2E8B57");
            dataTable.Rows.Add(2, "Tim", "#BA55D3");
            dataTable.Rows.Add(3, "Jim", "#FF8C00");
            dataTable.Rows.Add(4, "Rob", "#4682B4");
            dataTable.Rows.Add(5, "Dan", "#B22222");

            grdUser.DataSource = dataTable;
            grdUser.DataBind();
        }
        else
        {
            foreach (Telerik.Web.UI.GridDataItem user in grdUser.SelectedItems)
            {
                // Read new color values from the grid.
                string alteredColor = grdUser.MasterTableView.DataKeyValues[user.ItemIndex]["HexCode"].ToString();
            }
        }
    }

    protected void grdUser_ItemDataBound(object sender, GridItemEventArgs e)
    {
        GridDataItem item = e.Item as GridDataItem;

        if (item != null)
        {
            RadColorPicker rcpDeviceColour = e.Item.FindControl("RadColorPicker1") as RadColorPicker;

            if (rcpDeviceColour != null)
            {
                string hexCode = item.GetDataKeyValue("HexCode").ToString();
                rcpDeviceColour.SelectedColor = System.Drawing.ColorTranslator.FromHtml(hexCode);
            }
        }
    }

How do I read the updated color values in the grid during a postback?

Thanks in advance,

Matt

Matthew
Top achievements
Rank 1
Iron
Iron
 answered on 13 Dec 2021
1 answer
164 views

My current version  - Telerik.Web.UI, Version=2021.1.330.45

I am using RadComboBox control and property EnableCheckAllItemsCheckBox="true". Therefore "Check All" feature enabled.

And other properties are as below

            EnableLoadOnDemand = true;
            ShowToggleImage = true; 
            ShowDropDownOnTextboxClick = true;
            ShowMoreResultsBox = true;
            ItemsPerRequest = 10;
            EnableVirtualScrolling = true;

steps are as follows.

1.  check "Check All" checkbox. Then first loaded 10 records got checked.

2. Then loaded another set of items clicking arrow icon at the bottom of the record list.

3. Loaded next 10 records and now all together showing 20 records. At this stage all checkboxes are unchecked but still "Check All" checkbox        is checked.

4. Unchecked "Check All" check box and and checked again. Now it is checked only last loaded 10 records only instead of 20 records.

I tried to resolve this by following code. But not luck.

Highly appreciate your quick response since this is urgent for me.

Thank You,

Chandi  

 

Attila Antal
Telerik team
 updated answer on 13 Dec 2021
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?