Telerik Forums
UI for ASP.NET AJAX Forum
10 answers
681 views

I have a grid with a template column that contains values from two datafields.
How do I get the filtering to work on this column?

<telerik:GridTemplateColumn UniqueName="Name" HeaderText="Name" >
 <ItemTemplate>
   <asp:Label ID="lblFirstName" runat="server" Text='<%# Eval("FirstName") %>'></asp:Label> 
   <asp:Label ID="lblLastName" runat="server" Text='<%# Eval("LastName") %>'></asp:Label>
 </ItemTemplate>
</telerik:GridTemplateColumn>
Eyup
Telerik team
 answered on 29 May 2020
4 answers
216 views
I am trying to insert/edit items in the TreeList using a pop-up usercontrol.And when finish insert/update, user control can not close .Please tell me how to close Popup user control.Thank u .

Here is my code in User control :

<telerik:RadButton ID="btnInsert" runat="server" Text="Insert"   Width="75px"
                CommandName ="PerformInsert"
                Visible ="<%#DataItem is Telerik.Web.UI.TreeListInsertionObject %>"
                onclick="btnInsert_Click">
                <Icon PrimaryIconCssClass ="rbSave" />
        </telerik:RadButton>
        <telerik:RadButton ID="btnSave" runat="server" Text="Save"   Width="75px"
                CommandName ="Update"
                Visible ="<%#!(DataItem is Telerik.Web.UI.TreeListInsertionObject) %>"
                onclick="btnSave_Click">
              <Icon PrimaryIconCssClass ="rbSave" />
        </telerik:RadButton>
        <telerik:RadButton ID="btnCancel" runat="server" Text="Cancel"  Width="75px"
                CommandName ="Cancel"  CausesValidation="False">
                 <Icon PrimaryIconCssClass ="rbCancel" />
</telerik:RadButton>

Oscar
Top achievements
Rank 1
 answered on 28 May 2020
1 answer
200 views

When looking at the FireFox Developer it doesnt seem the value from the browser autocomplete is filling in the values. Even though the screen shows the value in box, the inspector does not show any value. Where is this value? I need to capture that value on the client-side markup. If i select the address list from the browser prefill, it fills in the controls correctly. Referencing screen shots:  I can see the "DG3123" in the inspector and the zip displays "59332", but the inspector shows the zip as "". So no value. If i click on the control, it received focus and fills in the zip value of "59332". Please advise how to workaround this issue. As stated, i need to capture this before moving to the next step in the wizard, as its making the validation value.

 

Please see my screen shots.

 

Thanks!

Attila Antal
Telerik team
 answered on 28 May 2020
1 answer
129 views

I'm using the following ClientDataSource to bind a radgrid. 

<telerik:RadClientDataSource runat="server" ID="clientDataSourceGrid">
    <ClientEvents OnCommand="dataSourceCommand" OnRequestStart="requestStart"  OnRequestEnd="requestEnd"  />
    <DataSource>
        <WebServiceDataSourceSettings>
            <Select Url="../../api/apd" RequestType="Get" />
            <Insert Url="../../api/apd" RequestType="Post" />
            <Update Url="../../api/apd" RequestType="Put" />
            <Delete Url="../../api/apd" RequestType="Delete" />
        </WebServiceDataSourceSettings>
    </DataSource>
    <Schema>
        <Model ID="APDId">
            <telerik:ClientDataSourceModelField FieldName="AM" DataType="String" />

 

The Web API action to do the update is as follows:

 

public void PutAPD(int id, APD apd)
  {
 
        // Do the update ....
 
        // How can I return a message in case something goes wrong in the update?
 
  }

My question is: how can I return a message from PutAPD back to the client? I want to be able to inform the user in case the update failed.

My 

 

                    


Eyup
Telerik team
 answered on 28 May 2020
1 answer
209 views

Hi,

i have a high subMenu (vertical) in my asp.net web page ; if this subMenu has more items than the height of screen (scrollbar...), when hovering the bottom items, sub items opening are placed in the middle of the screen and not in front of the hovering item.

I think the sub items do not show lower than the initial screen.

I have this problem in Edge and Chrome, not in FireFox nore IE.

Can you help me to fix this bug ?

Thanks in advance, kind regards.

Doncho
Telerik team
 answered on 28 May 2020
3 answers
132 views
Hide  Timeline views.
bassam
Top achievements
Rank 1
Veteran
 answered on 27 May 2020
2 answers
290 views

We have a need to be able to select from ~15,000 rows and need to use the RadGrid virtualization for a continuous grid instead of the "paging" mechanism.  We have encountered 2 issues that hopefully you can assist with. 

Issue 1:

When a user scrolls down in the grid - say row 5000, and they select a row, the code-behind does not receive the correct values that are displayed to the user but instead the value of the row as initially set - guessing since the grid doesn't really change, just the values. You can see this behavior in the sample code provided by setting a break in RadGrid1_ItemCommand and looking at the values coming into the method vs what is displayed to the user at that row.  

Issue 2:

The scroll position is not maintained even when setting  - ClientSettings-Scrolling-SaveScrollPosition="true".

Attached is a screen capture of the issues and code from captures to verify.

Is it possible to correct these issues or workaround???

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SimpleGridVirtual.aspx.cs" Inherits="UX.SimpleGridVirtual" %>
 
<!DOCTYPE html>
 
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
 
        <telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
        <telerik:RadSkinManager ID="RadSkinManager1" runat="server" ShowChooser="false" Skin="Silk" />
        <telerik:RadAjaxLoadingPanel runat="server" ID="RadAjaxLoadingPanel1"></telerik:RadAjaxLoadingPanel>
        <telerik:RadAjaxPanel runat="server" ID="RadAjaxPanel" LoadingPanelID="RadAjaxLoadingPanel1" CssClass="demo-container">
 
            <telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="true" AllowPaging="true" PageSize="10000" AllowMultiRowSelection="true"
                AllowSorting="true" OnNeedDataSource="RadGrid1_NeedDataSource" ClientSettings-Selecting-AllowRowSelect="true" OnItemCommand="RadGrid1_ItemCommand" ClientSettings-Scrolling-SaveScrollPosition="true">
                 
                <ClientSettings ReorderColumnsOnClient="true" AllowColumnsReorder="true" ColumnsReorderMethod="Reorder" EnablePostBackOnRowClick="true">
                    <Virtualization EnableVirtualization="true" InitiallyCachedItemsCount="2000" ItemsPerView="100" />
                    <Scrolling AllowScroll="true" UseStaticHeaders="true" ScrollHeight="500px" />
                    <Resizing AllowColumnResize="true" />
                </ClientSettings>
                 
                <MasterTableView>
                    <Columns>
                        <telerik:GridClientSelectColumn UniqueName="UserSelect" HeaderStyle-Width="100px"></telerik:GridClientSelectColumn>
                        <telerik:GridBoundColumn UniqueName="Column" HeaderText="Column" HeaderStyle-Width="300px" DataField="Column" Visible="true"></telerik:GridBoundColumn>
                        <telerik:GridBoundColumn UniqueName="Date" HeaderText="Date" HeaderStyle-Width="300px" DataField="Date"></telerik:GridBoundColumn>
                    </Columns>
                </MasterTableView>
             
            </telerik:RadGrid>
        <asp:ListBox Height="300px" Width="300px" runat="server" ID="RowClickedStatus">
 
        </asp:ListBox>
 
        </telerik:RadAjaxPanel>
 
    </form>
</body>
</html>
 
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
 
namespace UX
{
    public partial class SimpleGridVirtual : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
 
        }
 
        protected void RadGrid1_NeedDataSource(object sender, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
        {
            System.Diagnostics.Debug.WriteLine("Get DataSource");
            RadGrid1.DataSource = GetDataSource();
        }
 
        private DataTable GetDataSource()
        {
            if (Session["datasource"] == null)
            {
                DataTable dt = new DataTable();
                dt.Columns.Add("Column", typeof(string));
                dt.Columns.Add("Date", typeof(string));
                for (int i = 0; i < 10000; i++)
                {
                    dt.Rows.Add("Row " + i.ToString(), DateTime.Now.AddDays(i) + "_" + i.ToString());
                }
                Session["datasource"] = dt;
            }
            return Session["datasource"] as DataTable;
        }
 
        protected void RadGrid1_ItemCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e)
        {
            if ((string.Compare(e.CommandName, "RowClick", true) == 0) && (e.Item != null))
            {
                DataTable GridItems = Session["VirtualizationDataSource"] as DataTable;
                List<string> SelectedItems = (List<string>)Session["CurrentSelections"];
 
                string ColumnValue = e.Item.Cells[3].Text;
                RowClickedStatus.Items.Add(ColumnValue);
                System.Diagnostics.Debug.WriteLine("Got Value: " + ColumnValue);
                string DateValue = e.Item.Cells[4].Text;
            }
        }
    }
}

 

 

Van
Top achievements
Rank 1
Iron
Iron
 answered on 27 May 2020
2 answers
455 views

The code below works i the code behind but I need a rough equivalent doing this on the front end using js.

 

            RadWindow rw = new RadWindow();

          btn.Style.Add("position", "absolute");
            btn.Style.Add("bottom", "5px");
            btn.Style.Add("right", "10px");

 

         rw.ContentContainer.Controls.Add(btn);

 

 

 

Thanks in advance for any suggestions.

 

Doncho
Telerik team
 answered on 27 May 2020
8 answers
1.9K+ views

Hi, i've prepared a form using Rad controls and i need to use 3 controls to Upload files. I had some first problem to validate these controls, solved using hidden fields that I value when a file is uploaded.

So when I press the Submit button (RadButton) the page is actually validated, but if there are problems on some other fields than RadAsyncUpload, the result is that the upload control loses the correct information on display.

I'm using Ajax, Telerik UI R2 2019, the jquery version i see is v1.12.4, Page_ValidationVer = "125";

I've read many discussions, but there's something wrong in my case.

https://docs.telerik.com/devtools/aspnet-ajax/controls/button/how-to/radbutton-validation-and-client-side-event-handlers

 

I tried to intercept the validation in order to maybe implement something like this

https://www.telerik.com/forums/retain-uploaded-files-for-display-after-postback

but I can't, because if I try to call the function  Page_ClientValidate it always returns TRUE.

function Page_ClientValidate(validationGroup) {
    Page_InvalidControlToBeFocused = null;
    if (typeof(Page_Validators) == "undefined") {
        return true;
    }
    var i;
    for (i = 0; i < Page_Validators.length; i++) {
        ValidatorValidate(Page_Validators[i], validationGroup, null);
    }
    ValidatorUpdateIsValid();
    ValidationSummaryOnSubmit(validationGroup);
    Page_BlockSubmit = !Page_IsValid;
    return Page_IsValid;
}

 

Trying in debug i see that Page_Validators = undefined so the function exit with 'true' 

The form submit correctly and server-side i see Page.IsValid property values but I need to perform the submit only where all fields are compiled or the asyncupload controls mantains their state after validation.

 

Could there be confusion between client and server validation?

Do you have any ideas? Thanks

Cheah
Top achievements
Rank 1
Veteran
 answered on 27 May 2020
35 answers
1.8K+ views
Hello,

I can't set the hight to 100%, only the width.

My code:

 

<telerik:RadFileExplorer runat="server" ID="FileExplorer1" Width="100%" Height="100%"

 

 

OnClientItemSelected="OnClientItemSelected" style="display:block; float: none">

 

Vessy
Telerik team
 answered on 27 May 2020
Narrow your results
Selected tags
Tags
+? more
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?