Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
173 views

I am trying to replicate the look and feel of an existing web app and need to have a menu in a grid command row that includes a dropdownlist. I have added the menu but the dropdown list is being hidden by the grid. I've tried changing the z-index but cannot get the list to appear in front of the grid.

<telerik:RadGrid ID="rgDiscounts" runat="server" Width="100%" RenderMode="Lightweight"
    AllowSorting="true" AllowMultiRowSelection="true" Skin="Max2017" EnableEmbeddedSkins="false"
    OnNeedDataSource="rgDiscounts_NeedDataSource" OnItemCreated="rgDiscounts_ItemCreated" OnItemDataBound="rgDiscounts_ItemDataBound"
    OnUpdateCommand="rgDiscounts_UpdateCommand" OnInsertCommand="rgDiscounts_InsertCommand" OnDeleteCommand="rgDiscounts_DeleteCommand"
    OnPreRender="rgDiscounts_PreRender" OnItemCommand="rgDiscounts_ItemCommand">
 
    <MasterTableView DataKeyNames="Discount_Id" ClientDataKeyNames="Discount_Id" AllowMultiColumnSorting="true" AutoGenerateColumns="false" CommandItemDisplay="Top" >
 
        <CommandItemTemplate>
            <telerik:RadMenu ID="rmDiscounts" runat="server" Width="100%" ShowToggleHandle="true" BorderStyle="none"
                EnableRoundedCorners="true" EnableShadows="true" Skin="Max2017" EnableEmbeddedSkins="false"
                OnClientItemClicking="OnClientItemClicking" OnClientItemClicked="onDiscountsClientItemClicked" OnItemClick="rmDiscounts_ItemClick">
                <Items>
                    <telerik:RadMenuItem Text="Add" BorderStyle="None" />
                    <telerik:RadMenuItem Text="Delete" BorderStyle="None" />
                    <telerik:RadMenuItem Text="Items" BorderStyle="None" style="z-index: 9999;" >
                        <GroupSettings ExpandDirection="Down" Width="200px" />
                        <Items>
                            <telerik:RadMenuItem Text="Add Product Provider"></telerik:RadMenuItem>
                            <telerik:RadMenuItem Text="Add Product Group"></telerik:RadMenuItem>
                            <telerik:RadMenuItem Text="Add Product Group Type"></telerik:RadMenuItem>                                   
                        </Items>                               
                    </telerik:RadMenuItem>
                    <telerik:RadMenuItem BorderStyle="None" ImageUrl="Images/Ico_Refresh_18x18_blk.png" />
                </Items>                       
            </telerik:RadMenu>
        </CommandItemTemplate>
 
        <Columns>
 
          ......................................
 
        </Columns>
 
    </MasterTableView>
 
    <ClientSettings AllowKeyboardNavigation="true" EnablePostBackOnRowClick="true">
        <Selecting AllowRowSelect="true" UseClientSelectColumnOnly="true" />
        <Scrolling AllowScroll="true" UseStaticHeaders="true" ScrollHeight="100%" />
        <ClientEvents OnGridCreated="GridCreated" OnRowClick="GridRowClicked" />
    </ClientSettings>
 
</telerik:RadGrid>

 

Kyle

Eyup
Telerik team
 answered on 29 Mar 2017
1 answer
139 views

I used to have a page with a JQuery Autocomplete. It used 2 textboxes, one for the text search, and one for the returned value.

It was setup like this

//AutoComplete functions
        $(document).ready(function () {
 
            $(function () {
                initializer();
            });
 
            var prmInstance = Sys.WebForms.PageRequestManager.getInstance();
            prmInstance.add_endRequest(function () {
 
                initializer();
 
            });
 
            jQuery(function ($) {
 
                $('#<%=txtPBId.ClientID%>').change(function (e) {
                    var val = $(this).val();
                    if (val == '')
                        $('#<%=hdnPBId.ClientID%>').val("");
                });
 
            });
 
            // Setup AutoComplete
            function initializer() {
 
                $('#<%=txtPBId.ClientID%>').autocomplete({
                    cacheLength: 1,
                    source: function (request, response) {
                        $.ajax({
                            url: "../WS/AutoComplete.aspx",
                            dataType: "json",
                            data: {
                                term: request.term,
                                ref: 1,
                                random: new Date().getTime()
                            },
                            success: function (data) {
                                response(data);
                                $('#<%=hdnPBId.ClientID%>').val("");
                            },
                            error: function (model, error) {
                                $('#<%=hdnPBId.ClientID%>').val("");
                                //alert("No code found.");
                            }
 
                        });
                    },
                    select: function (event, ui) {
                        $('#<%=hdnPBId.ClientID%>').val(ui.item.idval);
                    }
                });
 
            }
 
        });

 

I now want to use a RadGrid with InPlace Editing. Is there any way of tying a GridAutoCompleteColumn to the above?

I can't use Datasources/Tablenames etc.

Ben
Top achievements
Rank 1
 answered on 29 Mar 2017
2 answers
603 views
I try to pick color from RadColorPicker on IE6 .When the code behind get color from RadColorPicker.SelectedColor this properties sometime RadColorPicker return value color code(ffffffff) and sometime are return color names(White).
How I can force RadColorPicker to just return color code like ffffffff?
Ramesh
Top achievements
Rank 1
 answered on 29 Mar 2017
1 answer
598 views

Hello,

I have a Radgrid with many columns, and without paging.

My users needs to (and can) scroll horizontally to read all the fields. But only by using the horizontal scrolling at the bottom of the grid, which is not convenient when the Grid has 100 rows or more. (If you want to read the first row, you need to scroll down the page, scroll right the grid, scroll up the page again).

I tried to use the ScrollHeight attribute but nothing happens. I also tried to add a height to my RadGrid, the grid itself respect the height but the rows don't (and overflow on the grids below).

I create my grid from the code behind so here is the code where it happens.

Can you help me ?

Thank you !

RadGrid grid = new RadGrid();
grid.ID = gridID;
grid.DataSourceID = dataSourceID;
grid.AllowMultiRowSelection = true;
grid.AllowPaging = false;
grid.ColumnCreated += Grid_ColumnCreated;
grid.BatchEditCommand += Grid_BatchEditCommand;
grid.AllowAutomaticUpdates = true;
grid.AllowAutomaticDeletes = true;
grid.AllowAutomaticInserts = false;
grid.AutoGenerateColumns = true;
//grid.Height = Unit.Pixel(300);
 
/* Client Settings */
grid.ClientSettings.Selecting.AllowRowSelect = true;
grid.ClientSettings.Selecting.UseClientSelectColumnOnly = true;
grid.ClientSettings.Scrolling.AllowScroll = true;
grid.ClientSettings.Scrolling.UseStaticHeaders = false;
grid.ClientSettings.Scrolling.ScrollHeight = Unit.Pixel(200);
grid.ClientSettings.ClientEvents.OnGridCreated = "SetupButtons";
grid.ClientSettings.ClientEvents.OnKeyPress = "GridKeyPress";
grid.ClientSettings.ClientEvents.OnCommand = "OnGridCommand";
 
/* HeaderStyle */
grid.HeaderStyle.HorizontalAlign = HorizontalAlign.Center;
grid.HeaderStyle.BorderWidth = 1;
 
/* MasterTableView */
grid.MasterTableView.CommandItemDisplay = GridCommandItemDisplay.Top;
grid.MasterTableView.TableLayout = GridTableLayout.Fixed;
grid.MasterTableView.DataKeyNames = new string[] { dataKey };
grid.MasterTableView.EditMode = GridEditMode.Batch;
grid.MasterTableView.BatchEditingSettings.EditType = GridBatchEditingType.Cell;
 
/* CommandItemSettings */
grid.MasterTableView.CommandItemSettings.ShowAddNewRecordButton = false;
grid.MasterTableView.CommandItemSettings.ShowRefreshButton = true;
grid.MasterTableView.CommandItemSettings.ShowCancelChangesButton = true;
grid.MasterTableView.CommandItemSettings.ShowSaveChangesButton = true;
 
 
/* Actions Columns */
GridClientSelectColumn selectColumn = new GridClientSelectColumn();
selectColumn.UniqueName = "ClientSelectColumn";
selectColumn.HeaderStyle.Width = Unit.Pixel(50);
grid.Columns.Add(selectColumn);
 
GridClientDeleteColumn deleteColumn = new GridClientDeleteColumn();
deleteColumn.UniqueName = "ClientDeleteColumn";
deleteColumn.HeaderStyle.Width = Unit.Pixel(50);
grid.Columns.Add(deleteColumn);
 
/* ADDING EVERYTHING ON THE PAGE */
Grids.Controls.Add(info); //info is a RadLabel
Grids.Controls.Add(grid);
RadAjaxManager1.AjaxSettings.AddAjaxSetting(grid, info, RadAjaxLoadingPanel);
RadAjaxManager1.AjaxSettings.AddAjaxSetting(grid, grid, RadAjaxLoadingPanel);
 
 
protected void Grid_ColumnCreated(object sender, Telerik.Web.UI.GridColumnCreatedEventArgs e)
{
    if (e.Column is GridBoundColumn)
    {
        GridBoundColumn column = (GridBoundColumn)e.Column;
        if (isHidden)
        {
            column.Display = false;
            column.ReadOnly = true;
        }
        else
        {
            if (isReadOnly)
            {
                column.ReadOnly = true;
            }
 
            //Change column header
            column.HeaderText = text;
            column.HeaderStyle.Width = Unit.Pixel(size);
            column.HeaderTooltip = tooltip;
        }
    }
}
Guilhem
Top achievements
Rank 1
 answered on 29 Mar 2017
0 answers
109 views

I currently have a RadGrid in the drop down of a RadComboBox. 

http://docs.telerik.com/devtools/aspnet-ajax/controls/grid/how-to/load-on-demand-radgrid-in-radcombobox

I turned on the filtering of the columns and hid the button because I need the grid to filter on keyress so using java to assist with this.

function Filter(colName, filtertxt) {
                        var filterTxt = document.getElementById(filtertxt);
                        var MasterTable = $find("<%= ddlProductClass.Items[0].FindControl("grdProductClass").ClientID %>").get_masterTableView();
    
                        var hidden = document.getElementById('<%= Hidden1.ClientID %>');
                        hidden.value = colName;
                        if (filterTxt.value.length > 0) {
                            MasterTable.filter(colName, filterTxt.value, Telerik.Web.UI.GridFilterFunction.StartsWith);
                        }
                        else
                        {
                            MasterTable.filter(colName, filterTxt.value, Telerik.Web.UI.GridFilterFunction.NoFilter);
                        }
                    }
                    function FocusFilter(filter) {
                        var input = document.getElementById(filter);
                        if (input.createTextRange) {
                            var FieldRange = input.createTextRange();
                            FieldRange.moveStart('character', input.value.length);
                            FieldRange.select();
                        }
                    } 

 

code found from another sample.  My issue is when I start typing in the filter box I get 1 or 2 characters in and the page acts like it does a post back (flickers) and combobox drop down closes.  If I open the drop down my records are filtered based on what I typed in. 

 

Any suggestions?

Duncan
Top achievements
Rank 1
 asked on 29 Mar 2017
2 answers
233 views
Hi,

I am looking into couple of forums which talks about filter setting, filter expressions, however, solution which I am looking for is not available.

Problem:
1.I have multiple columns on my grid. One of them is Hyperlink column e.g. Employee Name
2. Now I am filtering on particular column, e.g. Department and storing that value into session, as I can click on employee name hyperlink to redirect to employee profile page.
Session["FILTER_EXPRESSION"] = reportingGrid.MasterTableView.FilterExpression;

3. Now when I again visiting to grid page, I am using following line of code:
reportingGrid.MasterTableView.FilterExpression = Session["FILTER_EXPRESSION"].ToString();

4. This is filtering properly but, filter text boxes are black, which suppose to load with filter expression value.

5.I got following line of code which is used to show filter value into textbox.
GridColumn gc = reportingGrid.MasterTableView.GetColumnSafe("DepartmentName");
               gc.CurrentFilterFunction = GridKnownFunction.Contains;
               gc.CurrentFilterValue = "Finance";

 but I dont want to use this. I want to read the string which is stored in session and load values. Because this is used when you know on which column filter is applied. But in my case, in session variable I dont know, on how many columns filter applied and what is their respective values.

I will really appreciate your help.
Avinash
Dev Cesar Augusto
Top achievements
Rank 1
 answered on 28 Mar 2017
3 answers
222 views

Hi, thanks in advance for any help.

I have a page with a RadGrid and it has declared the "OnItemCommand" attribute. On a switch I have the "RowClick" case, where I take in consideration the main ID of the row and then I present details of that element in a bunch of textboxes.

What I need to do is to block UI when the user clicks on the Row while the information is loading. I know that Grid has its own loading Image but everything is still enabled when loading. I need to block because the rows in the gridview have buttons for actions like "view", "edit", "delete" (image buttons with "OnClientClicked" methods defined that open RadWindows as popups).

I am using jquery.blockUI, I am calling it on the codebehind at the "RowClick" case and unBlocking it once all the info is loaded at the end of "Page_Load" but the BlockUI is appearing after the grid loading animation is completed and I want them to happen at the same time.

 

protected void MainGridView_OnItemCommand(object sender, GridCommandEventArgs e)
{

     switch (e.CommandName)

     { 

          case "RowClick":                    

          Page page = HttpContext.Current.Handler as Page;

          ScriptManager.RegisterStartupScript(page, page.GetType(), "err_msg", "blockUI();", true);  // "blockUI" function has only a call to $.blockUI()

          fill_Details(MainGridView.SelectedValue);

          break;

          case "x":

           ....

           ....

       }

}

 

So, basically what I need is to be able to execute a javascript function at the same time that the loading image appears on the grid so I can disable any other action while loading is still in progress. 

 

Any comment, suggestion or hint will be highly appreciated.

 

Thanks & Regards

Oscar

 

Oscar Emiliano
Top achievements
Rank 1
 answered on 28 Mar 2017
9 answers
443 views
Hello,
 I have a ASP.NET Master page set up, with RadScriptManager as follows:
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server"
            OnAsyncPostBackError="RadScriptManager1_AsyncPostBackError"
            AsyncPostBackTimeout="180" CompositeScript-ScriptMode="Release" OutputCompression="AutoDetect" CdnSettings-TelerikCdn="Enabled"
            ScriptMode="Release">
            <Scripts>
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
                <asp:ScriptReference Assembly="System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
                    Name="MicrosoftAjax.js" Path="https://ajax.aspnetcdn.com/ajax/4.0/1/MicrosoftAjax.js" />
            </Scripts>
        </telerik:RadScriptManager>

On running the Google PageSpeed tool, I get the recommendation to "Defer parsing of javascript during initial page load".

1.2MiB of JavaScript is parsed during initial page load. Defer parsing JavaScript to reduce blocking of page rendering.
What is the recommended way to accomplish this? Techniques shown in other sites seem to involve dynamically creating a script element when the page has loaded etc. But how do  I do this with the script manager?

Thanks in advance,


Marin Bratanov
Telerik team
 answered on 28 Mar 2017
3 answers
407 views

I have a WinForms "host" application, that contains a WebBrowser control: https://msdn.microsoft.com/en-us/library/w290k23d(v=vs.110).aspx

In this WebBrowser control I run a Web application built using "Telerik UI for ASP.NET AJAX". This works fine most of the time.

Problem occurs, when the Web application opens a RadWindow, and this RadWindow displays a WebForm from my application. Most of the time it takes 3-6 seconds from the user clicks the button to open the window until the window is displayed - and sometimes it takes addtitionally 3-5 seconds, until page inside RadWindow is loaded. The WebForm inside the RadWindow is very simple - it normally takes a fraction of a second to open.

No problem when the WebForm is opened in a popup window (using window.open) instead of inside RadWindow.

No problem when using WebDev (the development web server that comes with Visual Studio) - problem "only" occurs when the web application runs under IIS.

I turned on Fiddler to see what happened. When I start "Capture" in Fiddler, my problem goes away (when running against local IIS - running Fiddler did not make any difference when running against an IIS on a remote machine). Maybe my problem is related to the discussion in: http://stackoverflow.com/questions/10428113/why-http-request-with-fiddler-is-blazing-fast ?

My web application is built using Telerik.Web.UI.dll Version: 2014.2.724.45. I have a small demo web application, that illustrates this problem (and I have a simple test "host" application containing a WebBrowser control).

I made a copy of the web application, and updated to Telerik.Web.UI.dll Version: 2017.1.228.45 . This did not make any difference either.

I know that RadWindow internally uses an iframe tag to display the contents.Therefore, in my demo web application, I have an option to display the webform in an iframe on the page. This works fine all the time (no delays when running in a WebBrowser control). But I saw a different problem: when I add an iframe tag to the the page that contains the RadWindowManager, RadWindow does not work anymore (calling radopen() throws JavaScript exception).

If needed, I can supply the applications illustrating the problem.

Marin Bratanov
Telerik team
 answered on 28 Mar 2017
3 answers
195 views

Hi,

I need to change (c#) the default editor for a column (texdbox) to a dropdownlist or other when I autogenerate column. (depend on constraint->SQLConstraint.png)

OnNeedDataSource -> RadGridEdit.Source = a dataTable;

RadGridEdit_PreRender -> Display_mode_column(true);

foreach (GridColumn col in RadGridEdit.MasterTableView.AutoGeneratedColumns)
{

    [....]

    if((string)rows[0][4] == "DROPDOWN" && sender != null){
    foreach (GridDataItem dataItem in RadGridEdit.MasterTableView.Items)
    {

      DropDownList ddl = new DropDownList();
      ddl.ID = "DDL_" + col.UniqueName; 
      ddl.DataSource = dataDefinition.Tables[1];
      ddl.DataTextField = "ListValueLabel";
      ddl.DataValueField = "ListValueLabel";
      ddl.ControlStyle.Width = Unit.Percentage(100);
      ddl.DataBind();
      dataItem[col.UniqueName].Controls.Add(ddl);

     }

}

This don't work, I get my showed data with a dropDown and if I click on the row, I still got this TextBox in edit mode (BatchEditYoloMode.png).

So, How can I change this edit textbox into a dropdown (timepicker , ....). (GetBatchColumnEditor?)

Bouyez
Top achievements
Rank 1
 answered on 28 Mar 2017
Narrow your results
Selected tags
Tags
+? more
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?