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

Hi all

I have a radgrid with 1 detail table.

The master table retrieves data using a SQLDataSource ,a stored procedure and session value as a parameter - this works fine.

The detail table also uses a SQLDataSource and a stored procedure but the parameter for this is the key field from the master table and not a session field.

How do I go about grabbing the key field from the master and pass it to my stored procedure?

Any help greatly apprciated.

Geoff
Top achievements
Rank 1
Iron
 answered on 13 Sep 2023
1 answer
28 views

Hello

i'm stuck with a simple example.

I have a RadGrid with multiple column avec ExcelFilter activated.

When in a column, you have data like 'test AND test' the Filter got no FilterExpression when you select this particular line in  the filter with a tickbox.

If you use the Filter fonction normally (Contain) it work.

 

Here is a simple exemple.

Default.aspx :


<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <telerik:RadStyleSheetManager id="RadStyleSheetManager1" runat="server" />
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
        <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" />
        </Scripts>
    </telerik:RadScriptManager>
    <div>
        <telerik:RadGrid ID="GridFile" runat="server"         
            OnNeedDataSource="ContextGrid_NeedDataSource"
            AllowSorting="true"
            AllowFilteringByColumn="True"
            FilterType="HeaderContext"
            EnableHeaderContextMenu="true" 
            EnableHeaderContextFilterMenu="true"
            OnFilterCheckListItemsRequested="RadGrid1_FilterCheckListItemsRequested"  
            FilterMenu-EnableRoundedCorners="false"
            >
             <MasterTableView AutoGenerateColumns="false" TableLayout="Auto"> 
                <Columns>
                    <telerik:GridBoundColumn UniqueName="Creation" DataField="Creation" HeaderText="Creation"   FilterCheckListEnableLoadOnDemand="true"/>
                    <telerik:GridBoundColumn UniqueName="Name" DataField="Name" HeaderText="Name" FilterCheckListEnableLoadOnDemand="true"/>
                 </Columns>
            </MasterTableView>
        </telerik:RadGrid>
    </div>
    </form>
</body>
</html>


And Defaults.aspx.cs 


using System.Data;
using Telerik.Web.UI;


public partial class Default : System.Web.UI.Page 
{
    
    protected void ContextGrid_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
    {
        DataTable table = new DataTable();

        GridFile.DataSource = getTable();
    }


    protected void RadGrid1_FilterCheckListItemsRequested(object sender, GridFilterCheckListItemsRequestedEventArgs e)
    {
        string DataField = (e.Column as IGridDataColumn).GetActiveDataField();
        DataTable table = getTable();

        table.DefaultView.Sort = DataField + " asc";

        e.ListBox.DataSource = table.DefaultView.ToTable(true, DataField);
        e.ListBox.DataKeyField = DataField;
        e.ListBox.DataTextField = DataField;
        e.ListBox.DataValueField = DataField;
        e.ListBox.DataBind();
    }

    protected DataTable getTable()
    {
        DataTable table = new DataTable();
        table.Columns.Add("Creation", typeof(string));
        table.Columns.Add("Name", typeof(string));

        int i = 0;
        for (i=0; i < 10; i++)
        {

            table.Rows.Add(
                "Name " + i,
                i + " The AND a test"
                ) ;
        }
        return table;
    }

}

 

Selection and Error in the 2 captures.

Works with OR also.

Any Clues ?

Thinks it's the same error like the quote.

 

Thanks a lot

Benjamin

 

Doncho
Telerik team
 answered on 12 Sep 2023
1 answer
15 views

Hello,

RadDateRangePicker is not working for me. The buttons do not display and of course no pop calendar as well. 

Other pickers work fine. Any idea what I am missing here

Thanks

Gil 

Rumen
Telerik team
 answered on 12 Sep 2023
0 answers
52 views

Please see the attached picture. I have a Grid with multi column headers. How do I access header cells where red arrows and green arrow are pointing at respectively?

Accessing header cells is happening in RadGrid1_OnPreRender().

BTW, how to visually indicate filtering for grid with multi column header ? I tried this code in: https://docs.telerik.com/devtools/aspnet-ajax/knowledge-base/grid-visually-indicate-filtered-columns-in-excel-like-filtering

It works fine with common grid, but for grid with multi colum headers, it has bugs and cannot show properly.

Thank you!

yuki
Top achievements
Rank 2
Iron
Iron
Iron
 updated question on 12 Sep 2023
0 answers
16 views

I love the RadSpreadsheet control.  It works great having the toolbar to open files, save files etc.

But I want to run some code on a button press on the page that does some specific validation, then 

taking each row and import into a database.

 

So I use this control to open xls files for user to view, make changes etc.

I then run some custom code that checks (Rows / Columns data) for custom rules

Then I want to take the end result and import that into a database.

 

Should I be using a Grid Control to do this as it seems impossible to get the worksheet from the RadSpreadSheet control when we use the open toolbar.

Roger
Top achievements
Rank 2
Iron
Iron
Iron
 asked on 05 Sep 2023
0 answers
16 views

I would like to make long text wrap when using checkboxes. As per the attached image, I would prefer the left margin of the text to align with the green line.

I have attempted to use the sample shown in this article (https://www.telerik.com/forums/long-text-in-radlistbox)  but nothing worked.

Could you please advise the best way to make this change?

Adam
Top achievements
Rank 1
 asked on 04 Sep 2023
0 answers
17 views

I'm using the following code to create multi-level context menus in a RadEditor control, but I can't get the Text property of the tool to display instead of the Name property. 

 


<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="RadEditorForm.aspx.cs" Inherits="RadEditorForm" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <telerik:RadStyleSheetManager id="RadStyleSheetManager1" runat="server" />
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
        <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" />
        </Scripts>
    </telerik:RadScriptManager>
    <script type="text/javascript">
        //Put your JavaScript code here.
    </script>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
    </telerik:RadAjaxManager>
    <div>
        <telerik:RadEditor ID="RadEditor1" runat="server" ToolsFile="RadEditorForm_ToolsFile.xml">
            <ContextMenus>
                <telerik:EditorContextMenu TagName="P">
                    <telerik:EditorTool Name="JustifyLeft"></telerik:EditorTool>
                    <telerik:EditorTool Name="JustifyCenter"></telerik:EditorTool>
                    <telerik:EditorTool Name="JustifyRight"></telerik:EditorTool>
                    <telerik:EditorTool Name="JustifyFull"></telerik:EditorTool>
                </telerik:EditorContextMenu>
                <telerik:EditorContextMenu TagName="BODY">                                    
                    <telerik:EditorTool Name="JustifyLeft"></telerik:EditorTool>
                    <telerik:EditorTool Name="JustifyCenter"></telerik:EditorTool>
                    <telerik:EditorTool Name="JustifyRight"></telerik:EditorTool>
                    <telerik:EditorTool Name="JustifyFull"></telerik:EditorTool>                                                        
                </telerik:EditorContextMenu>
            </ContextMenus>
        </telerik:RadEditor>
    </div>
    </form>
</body>
</html>


using System;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using System.Data;
using System.Configuration;
using System.Web.Security;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Telerik.Web.UI;

public partial class RadEditorForm : System.Web.UI.Page 
{
    protected void Page_Load(object sender, EventArgs e)
    {
        EditorContextMenuTool dataMenu = new EditorContextMenuTool("Data");
        dataMenu.Text = "Data X";
        System.Text.StringBuilder sb = new System.Text.StringBuilder();
        for (int l1 = 0;l1 < 5;l1++)
        {
            EditorContextMenuTool subDataMenu = new EditorContextMenuTool();
            subDataMenu.Name = string.Concat("L",l1,"_Menu");
            subDataMenu.Text = string.Concat("Level 1 Menu Item ",l1);
            subDataMenu.ShowText = true;
            subDataMenu.ShowIcon = false;            
            for (int l2 = 0; l2 < 5; l2++)
            {
                EditorTool tool = new EditorTool();
                tool.Name = string.Concat("L",l1,"_Menu_",l2);
                tool.Text = string.Concat("Level ",l1,"-Menu Item ",l2);
                tool.ShowText = true;
                tool.ShowIcon = false;
                subDataMenu.Tools.Add(tool);
                sb.Append("Telerik.Web.UI.Editor.CommandList[\"" + tool.Name + "\"] = function (commandName, editor, oTool) {debugger;editor.pasteHtml(\"<var>" + tool.Text + "</var>\");}");
                sb.AppendLine();
            }
            dataMenu.Tools.Add(subDataMenu);
        }        
        RadEditor1.ContextMenus.FindByTagName("P").Tools.Add(dataMenu);
        RadEditor1.ContextMenus.FindByTagName("BODY").Tools.Add(dataMenu);
        ScriptManager.RegisterStartupScript(Page, Page.GetType(), "contextMenuHandlerScript", sb.ToString(), true);
    }
}

Jamex
Top achievements
Rank 1
 asked on 01 Sep 2023
1 answer
26 views

Hello
  In the ListView, I need to divide the data into 4 groups (GroupItemCount=4)

and the header of each group should have a column name like the needed.png picture

 

But no matter how hard I tried, I couldn't set the listview so that the names of the columns in each group are displayed, and the output is like the picture show.png

Help me please


Attila Antal
Telerik team
 answered on 31 Aug 2023
1 answer
31 views

We currently have a telerik datepicker (and timepicker) displayed inside a bootstrap modal, and while it works (mostly) fine, I've discovered that accessibility keyboard controls (enabled via setting EnableAriaSupport and EnableKeyboardNavigation to True) do not work. The controls work fine in context of a datepicker outside of these modals.

Upon further investigation, it seems as though the telerik process is adding a new div to the dom when we open the datepicker calendar, which presumably is firing some low-level bootstrap event or process that I'm unaware of to force focus back to the modal... and in this case away from the datepicker that's appearing over it.

Does anyone know of a way to prioritize keyboard control focus to remain on the added datepicker calendar that appears instead of reverting back to the top of the modal?

Things I've tried include:

  • Setting the modal's data-keyboard and data-focus properties to false (which did nothing except disabling people to press escape to close the modal)
  • setting the date-picker's z-index arbitrarily high (despite it already rendering on top of the modal to begin with
  • setting some properties for bootstrap-adjacent things in the off chance that they might work (such as Vue.JS). These, predictably, did nothing.
  • fiddled with some raw JS events that might have impacted the process. These did not get hit upon loading the datepicker when test breakpoints were added to them
  • setting a hidden field on the datepicker's sub-controls with the ID "hasControlOnModal" to True. This was preexisting code from the 2009 version of the datepicker that I'm currently trying to get away from, and doesn't seem to do anything as far as I can tell.
  • confirming in VB code that the controls in and out of the modal are built the same way (they run through the same code)
  • Tried to catch the calendar opening and manually force focus in JS via the OnPopupOpening event (this doesn't work as the documentation points out this event is just BEFORE the calendar loads into the dom... I need it to be there so I can use jquery's .focus() on it.

It's worth noting that I do not have the option to swap away from the current way we build modals and use a telerik modal at this time.

The datepicker, opened with keyboard controls, as it appears outside the modal (note the black box around the calendar, denoting that the control is in-focus of the keyboard and is usable via arrow key navigation:

The modal with a datepicker attached to it. The focus is on the invisible "title" of the modal, which announces to screen readers that there's a modal open. hitting "tab" here shifts the focus to the "close" button.

Tabbing down to the datepicker works as intended, and upon hitting "enter" on the open calendar button, you're presented with this screen:

Notice that the calendar does not have the focused black box around it, as the focus has shifted back to the top of the bootstrap modal. Keyboard controls do not work. Hitting "tab" from here will once again move the focus to the modal's "close" button. There is no way for me to tab into the calendar control.

 

Ben
Top achievements
Rank 1
Iron
 answered on 30 Aug 2023
0 answers
6 views

Is it possible to display a custom text instead of date as in the picture attached? I would like to have a custom text there and date and time in the tooltip when user hovers over this text / point in the timeline.

Ines
Top achievements
Rank 1
 asked on 30 Aug 2023
Narrow your results
Selected tags
Tags
+? more
Top users last month
Bernd
Top achievements
Rank 5
Bronze
Bronze
Iron
kva
Top achievements
Rank 2
Iron
Iron
Iron
Jay
Top achievements
Rank 2
Iron
Iron
Veteran
Mark
Top achievements
Rank 3
Iron
Iron
Iron
Ruchika
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Bernd
Top achievements
Rank 5
Bronze
Bronze
Iron
kva
Top achievements
Rank 2
Iron
Iron
Iron
Jay
Top achievements
Rank 2
Iron
Iron
Veteran
Mark
Top achievements
Rank 3
Iron
Iron
Iron
Ruchika
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?