Telerik Forums
UI for ASP.NET AJAX Forum
6 answers
160 views
Hi,
I have added some custom header menus (e.g Export to CSV) to my RadGrid. They work fine with the MasterTable.

But when I right click on Detail Table header, same menus are displayed as master table.

I want to hide my custom menu when user right clicks Detail Table header.

I tried to check in HeaderContextMenu.OnClientShowing client event, but I am not able to get any property to confirm if it is Master Table or Detail Table.

Is there a way to Identify if header menu is being displayed for Master Table or Detail Table?

Thanks!!
Princy
Top achievements
Rank 2
 answered on 18 Jul 2014
1 answer
194 views
I have a RadButton that looks like this

<telerik:RadButton ID="btnCancelRegistration" runat="server" Width="691px" Height="144px"
                     SingleClick="False" NavigateUrl="<%$Resources:, btnCancelRegistrationResource1.NavigateUrl %>" ButtonType="LinkButton" Target="_blank" Text="Moved On?" AutoPostBack="False">
                     <Icon PrimaryIconCssClass="<%$Resources:, btnCancelRegistrationResource1.PrimaryIconClass %>" PrimaryIconWidth="700px" PrimaryIconHeight="150px" PrimaryIconLeft="0" PrimaryIconTop="0" />
                 </telerik:RadButton>


The button does bring up the specified URL, but it does not bring up a new page (as the Target="_blank" would indicate). Tested on Opera 24 and Firefox 33. Using .NET 4.5 / Rad 2014.2.618.45
Princy
Top achievements
Rank 2
 answered on 18 Jul 2014
6 answers
190 views
Hi,

I’m trying to program the context menu (client side) to
display different  menus based upon the
node that is clicked on.

So far I have managed to get the system to work out which
node its on:
 

            
var NodeType = args._node.get_attributes().getAttribute("type1");
 
if (NodeType == "position") {
     
}
else if (NodeType == "serial") {
}

 

But I’m having no success is determining how to change the
context menu – Any suggestions (I’m very new to javascript)

Shinu
Top achievements
Rank 2
 answered on 18 Jul 2014
10 answers
2.2K+ views
Is they some RadGrid equivalent for ASP.Net GridView's OnRowDataBound event?
Please point me to some examples.


Thanks
Asad
Jeremy
Top achievements
Rank 1
 answered on 18 Jul 2014
0 answers
85 views
Hello there,

im using radeditors to update news content. when i click in the radgrid on some row, it opens a jquery dialog and sets two radeditor using set_html(Preview and Content).

This works perfect in google chrome but not on IE and FF. the html field has the content, but the design field dont and i cant even type on it.

here's the code:
var varTitle = eventArgs.getDataKeyValue("title");
var varInitialDate = eventArgs.getDataKeyValue("initial");
var varEndDate = eventArgs.getDataKeyValue("end");
var varPreview = eventArgs.getDataKeyValue("prev");
var varContent = eventArgs.getDataKeyValue("content");
 *** Opens the dialog ***
$find('<%= Title.ClientID%>').set_value(varTitle);
$find('<%= ID.ClientID%>').get_textBox().control.set_value(varInitialDate);
$find('<%= ED.ClientID%>').get_textBox().control.set_value(varEndDate);
$find('<%= Preview.ClientID%>').set_html(varPreview);
$find('<%= Content.ClientID%>').set_html(varContent);

any ideas on what the problem is?

thanks





MikeS
Top achievements
Rank 1
 asked on 17 Jul 2014
3 answers
307 views
I can create different controls per column depending on data from code behind and it works.  

I want to create different controls per each row in code behind.
example:

                   <EditMode>
                    ColumnA             ColumnB
                    Row I:   RadComboBox         RadComboBox
                    Row II:  RadNumericTextBox   RadNumericTextBox
                    Row III: CheckBox            CheckBox
...

The problem is the Rad-grid Batch mode only have one Control in one Edit-template for each column, that means all the rows have the same Edit-template and control.

this I can do:


                ColumnA (RadComboBox)     ColumnB(RadNumericTextBox)
                Row I:   RadComboBox               RadNumericTextBox
                Row II:  RadComboBox               RadNumericTextBox
                Row III: RadComboBox               RadNumericTextBox

Is it possible to have Multiple Edit-templates per column or what is my alternatives? 
Konstantin Dikov
Telerik team
 answered on 17 Jul 2014
17 answers
303 views
Hi I want to print radgrid but its not working when using on a usercontrol and then on master page.

please help.

I using the following code in my user control.

<%@ Control Language="C#" AutoEventWireup="true" CodeFile="printTestRadgrid.ascx.cs" Inherits="WebUserControls_Employees_printTestRadgrid" %>
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
<script type="text/javascript">
        function PrintRadGrid() {
 
            debugger;
            var previewWnd = window.open('about:blank', '', '', false);
            var sh = '<%= Page.ClientScript.GetWebResourceUrl(radGrid1.GetType(),"Telerik.WebControls.RadControls.Grid.Skins.Default.Styles.css") %>';
            sh = sh.replace("&t", "&t");
            var styleStr = "<html><head><link href = '" + sh + "' rel='stylesheet' type='text/css'></link>";
            var htmlcontent = styleStr + "<body>" + window["radGrid1"].Control.innerHTML + "</body></html>";
            htmlcontent = htmlcontent.replace(/<script .*?>(.|\n)*?<\/script>/gi, "")
            previewWnd.document.open();
            previewWnd.document.write(htmlcontent);
            previewWnd.document.close();
            previewWnd.print();
            previewWnd.close();
        }
    </script>
    </telerik:RadCodeBlock>
     
     <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server">
    <div class="wrapper">
        <div class="topBar">
            <p class="headingText">
                <asp:LinkButton ID="LinkButton1" runat="server" type="button" Text="[ Print Grid ]"
                      Font-Underline="false" ForeColor="Black" OnClick="LinkButton1_Click" /></p>
            This code-library demonstrates how to print RadGrid without surrounding content<br />
        </div>
        <telerik:RadGrid ID="radGrid1" runat="server" DataSourceID="SqlDataSource1" Style="margin: 20px;"
            AllowPaging="True" AllowSorting="True" AllowFilteringByColumn="True" GridLines="None">
        </telerik:RadGrid>
    </div>
    </telerik:RadAjaxPanel>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:mobily_alexmarConnectionString %>"
         
    SelectCommand="SELECT [EmployeeID], [EmployeeNumber], [EmployeeStatus], [EmployeeName], [EmployeeNameArabic], [FatherName], [Gender], [MeritalStatus], [DateOfBirth], [Email], [PrimaryMobile], [SecondaryMobile], [CurrentAddress] FROM [tbl_Employee]">
    </asp:SqlDataSource>



and in the code behind

 foreach (GridItem item in radGrid1.MasterTableView.GetItems(new GridItemType[] { GridItemType.Pager, GridItemType.FilteringItem }))
            item.Display = false;
  RadAjaxPanel1.ResponseScripts.Add("PrintRadGrid('" + radGrid1.ClientID + "')");

please tell me soon
Thanks.


Also when i use radgrid inside a fieldset the ragrid loses its scrolling property and there will b no scrolling for radgrid.

     
Kostadin
Telerik team
 answered on 17 Jul 2014
5 answers
144 views
Hello,

In my opinion, the keyboard support demo (Grid - Keyboard Support) shows some odd behaviour in combination with the mouse vs. keyboard selection. The keyboard only fully works when you follow a specific selection pattern.

First the expected behaviour using keyboard selection on the second row:
a.1) Open the demo from the link http://demos.telerik.com/aspnet-ajax/grid/examples/accessibility-and-internationalization/keyboard-support/defaultcs.aspx.
a.2) Select the first row with the mouse.
a.3) Press the down arrow to select the second row.
a.4) Press Enter and the row goes into edit mode. Pressing Escape cancels the edit mode. Great!

Now the same selection, but using the mouse:
b.1) Open the demo in a new browser page.
b.2) Select the second row by clicking clicking on the Contact Name cell.
b.3) Try to start edit mode by pressing Enter. Nothing happens. This is confusing for our users. It worked before?
b.4) Okay, so a small bug. Press the Pencil icon to go into edit mode.
b.5) Press Escape to cancel edit mode. Notice that nothing happen.
b.6) Pressing Enter does work. However, Enter does not work when you start editing after immediatelly pressing the Pencil icon.

I would like to have full keyboard support when using the mouse. The keyboard should work all the time, without telling the user to first use the arrow keys to get the grid into the proper editing mode.

Is this expected behaviour? I noticed the grid has a different mode when I use the arrow keys. Is there some setting I can use?

Best regards,

Marcel

http://demos.telerik.com/aspnet-ajax/grid/examples/accessibility-and-internationalization/keyboard-support/defaultcs.aspx
Viktor Tachev
Telerik team
 answered on 17 Jul 2014
1 answer
134 views
Hello,

I am currently working on a project with a RadSearchBox .


VB.NET:
01.Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
02.    Dim User_Report As New DataTable
03.    Session("User_Report") = GenTreeData(User_Report)
04. 
05.    RadSearchBox1.DataTextField = "Name"
06.    RadSearchBox1.DataValueField = "ID"
07.    RadSearchBox1.DataSource = CType(Session("User_Report"), DataTable)
08.    RadSearchBox1.DataBind()
09. 
10.End Sub
11. 
12.Private Function GenTreeData(User_Report As DataTable) As DataTable
13. 
14.    User_Report.Columns.Add("Section")
15.    User_Report.Columns.Add("ID")
16.    User_Report.Columns.Add("Parent_ID")
17.    User_Report.Columns.Add("Description")
18.    User_Report.Columns.Add("Name")
19. 
20.    User_Report.Rows.Add("1", "101_1", "-1-1", "dedcrip", "xxxxxxx")
21.    User_Report.Rows.Add("1", "101_2", "-1-1", "dedcrip", "vvvvv")
22.    User_Report.Rows.Add("-1", "102_1", "-1-1", "dedcrip", "ccc")
23.    User_Report.Rows.Add("1", "-2-2", Nothing, Nothing, "ddd")
24.    User_Report.Rows.Add("1", "-3-3", "-1-1", Nothing, "ddd")
25.    User_Report.Rows.Add("1", "102_2", "-2-2", "dedcrip", "hhhhh")
26.    User_Report.Rows.Add("2", "101_3", "-2-2", "dedcrip", "lll")
27.    User_Report.Rows.Add("2", "-1-1", Nothing, Nothing, "ooooo")
28.    User_Report.Rows.Add("1", "101_4", "-3-3", "dedcrip", "zzzzz")
29.    User_Report.Rows.Add("1", "102_3", "-3-3", "dedcrip", "zzzzz")
30.    User_Report.Rows.Add("1", "102_4", "-3-3", "dedcrip", "zzzzz")
31.    User_Report.Rows.Add("1", "102_5", "-1-1", "dedcrip", "zzzzz")
32.    Return User_Report
33.End Function


ASPX:
<telerik:RadSearchBox ID="RadSearchBox1" runat="server" EmptyMessage="search" EnableAutoComplete="true">
                                <DropDownSettings Height="550px" Width="400px">
                                    <ItemTemplate>
                                        <div class="search-report-box">
                                            <span id="serach-report-name"><%# DataBinder.Eval(Container.DataItem, "Name")%></span><br />
                                            <span id="search-report-category"><%# DataBinder.Eval(Container.DataItem, "Description")%></span>
                                        </div>
                                    </ItemTemplate>
                                </DropDownSettings>
                            </telerik:RadSearchBox>

How can I prevent the RadSearchBox from displaying items
whose description is empty?

I’ll be glad for help,

Daniel.
Boyan Dimitrov
Telerik team
 answered on 17 Jul 2014
3 answers
156 views
Hello,

I am currently working on a project with a RadGrid that has a DetailView.

I need to do only a custom filter on the MasterTableView,
I need to do only a default RadGrid filter on the DetailView.

 
Thanks,

Daniel
Daniel
Top achievements
Rank 1
 answered on 17 Jul 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?