Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
165 views
In Q3 2013 SP1, the OnClientClicking handler of the RadButton will not get called after using the keyboard (enter key or spacebar) to activate the RadButton. 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<head runat="server">
    <title></title>
    <telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
        <script type="text/javascript">
            function clickHandler(sender, args)
            {
                args.set_cancel(true);
            }
        </script>
    </telerik:RadScriptBlock>
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server"></telerik:RadScriptManager>
    <div>
        <telerik:RadButton ID="btnTest" runat="server" Text="Test Me" OnClientClicking="clickHandler"></telerik:RadButton>
    </div>
    </form>
</body>
</html>


The issue seems to have something to do with the set_cancel() call; if the button is changed to "AutoPostBack=false" and the set_cancel() call is removed, the behavior returns to (mostly) normal. In that case, things work as expected when the enter key activates the button, but the spacebar still causes erratic behavior.

Is there a different way to preserve OnClientClicking behavior with keyboard activation of RadButtons or is this a bug?
Nikolay
Telerik team
 answered on 26 Dec 2013
3 answers
136 views
Batch mode is really very useful.We love it so much althrough it has many limits.
The grid enables scrolling.when I apply batch mode in the Detail tables ,it works fine.we can scroll horizontally and vertically.
Unfortunately,after I apply batch mode in both Master and Detail table, the grid seems like applying the UseStaticHeaders property.Scroll bars are disappared.I think you guys konwing what I'm talking about. 
I wish some could help me ,otherwise I will not use the batch mode any more.
Here is the key settings.
thx in advance.
 
        <ClientSettings>
            <Scrolling AllowScroll="True" ScrollHeight="600px" UseStaticHeaders="false" />
        </ClientSettings>
 
<MasterTableView DataKeyNames="Id,OrderId,SourceAreaId" EditMode="Batch" CommandItemDisplay="Top">
 
<telerik:GridTableView runat="server" Name="OrderDetailsOfArea" EditMode="Batch" CommandItemDisplay="Bottom" DataKeyNames="Id" >
Vasil
Telerik team
 answered on 26 Dec 2013
3 answers
126 views
In Visual Studio 2013 Telerik RadGrid shows Detail Table empty after the Row Expand in
Both version 2012.2.724.40 and Version 2013.3.1114.45


for  Visual Studio 2012 Telerik RadGrid shows information in the detail table within the grid  after the Row Expand in
Both version 2012.2.724.40, but Empty in Version 2013.3.1114.45


any idea about this issue?


Vasil
Telerik team
 answered on 26 Dec 2013
1 answer
114 views
From a couple of things I'd seen I gathered that by building a dataset, populating it with the master table and any needed related tables, then setting the proper data relationships within the dataset that RadGrid would automatically create drop down columns for foreign key relationships that I had defined.

I haven't been able to get this to work to date, or find an example that matches this particular scenario as I'm dynamically defining all that in code.  Everything I see that does anything close just has fixed columns in markup.  But, this will connect to different tables rather than the same one all the time.

Is this something that can be done?  Or do we have to explicitly build each column and add them to the grid?

Shinu
Top achievements
Rank 2
 answered on 26 Dec 2013
1 answer
84 views
I am using RadGrid with Client-Side Binding (WCF Data Service), but Filtering and Sorting from the "Header Context Menu" don't work.
Any possible solution ?  
Tarek
Top achievements
Rank 1
 answered on 26 Dec 2013
1 answer
117 views
Hi,
  I have a requirement to upload multiple files, when i have files which having file names are very small. In this case the progress bars comes side by side instead of in a row. how can i avoid that.

Thanks,
Jagadeeswararao Chappa.
Princy
Top achievements
Rank 2
 answered on 26 Dec 2013
1 answer
285 views

Hello all,










I have a little problem: I have a modal popup that opens whenever the user click radbutton..I'm trying to open the modal popup from the code behind if the user click on the button how can I check if the user click on the button from the code behind?







(I don't want to use JS front code to open the modal popup)











*************code behind***********







 Protected Sub GenerateLinks()















        If Not String.IsNullOrEmpty(btnAddNewPerson.?????) Then







            ' ''Open RadWindow







            Dim script As String = "function f(){$find(""" + modalPopup.ClientID + """).show(); Sys.Application.remove_load(f);}Sys.Application.add_load(f);"







            ScriptManager.RegisterStartupScript(Page, Page.GetType(), "key", script, True)







            Exit Sub







        End If







End Sub















***********aspx code***********







 <telerik:RadButton ID="btnAddNewPerson" runat="server" Visible="false"  ClientIDMode="Static" Text="Add Person" AutoPostBack="false" OnClientClicking="OnClientClicking"/>







                                    <Icon PrimaryIconCssClass="rbAdd" PrimaryIconLeft="4" PrimaryIconTop="4" />







                                </telerik:RadButton>















******JS function*********















 function OnClientClicking(button, args) {







                window.location = button.get_navigateUrl();







                args.set_cancel(true);







            }
















Princy
Top achievements
Rank 2
 answered on 26 Dec 2013
1 answer
101 views
Is there a way to set the color of the bars based on the text in a textbox?
Shinu
Top achievements
Rank 2
 answered on 26 Dec 2013
1 answer
243 views
Hi. I have a radgrid. It has DetailsTable in MasterTableView. Iwant to load data to detail tables dynamically, but I can not.
I wrote code like below.

 
grdItemRules.DataSource = rules;
 grdItemRules.DataBind();
 
foreach (GridDataItem item in grdItemRules.MasterTableView.Items)
{
          GridTableView tableView = (GridTableView)item.ChildItem.NestedTableViews[0];
 
          tableView.DataSource = rules[item.ItemIndex].RuleItems;
          tableView.DataBind();
}
My code block is like above. Can anyone help me about this? Thanks in advance.
Eyup
Telerik team
 answered on 25 Dec 2013
1 answer
168 views
Hello,

I want to use a hierarchical radgrid using self-referencing on the masterview and a detail view at the same time. Is it possible ?
Here the source code of my page 
<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/OEECalcul/general2.Master" CodeBehind="TFGroupsProductsDetails.aspx.vb" Inherits=".TFGroupsProductsDetails" %>
<%@ Register Src="ctrl/img_status.ascx" TagName="imgStatus" TagPrefix="uc1" %>
<%@ Reference Control="~/OEECalcul/ctrl/img_status.ascx" %>
<asp:Content ID="Content1" ContentPlaceHolderID="OEEDirectContent" runat="server">
    <telerik:RadGrid ID="rGrid" runat="server" AllowFilteringByColumn="True" AllowPaging="True" AllowSorting="True" AutoGenerateDeleteColumn="True" AutoGenerateEditColumn="True" CellSpacing="0" Culture="fr-FR" GridLines="None" ShowGroupPanel="True" AutoGenerateColumns="False">
        <MasterTableView AllowSorting="true" DataKeyNames="id_groups_products, id_parent" Width="100%">
            <Columns>
                <telerik:GridTemplateColumn HeaderText="Status">
                    <ItemTemplate>
                        <uc1:imgStatus ID="img_status1" runat="server" Status='<%# Eval("id_status")%>' />
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridBoundColumn HeaderText="Nom" datafield="name" />
                <telerik:GridMaskedColumn DataField="id_groups_products" UniqueName="id_groups_products" DataType="System.Guid" />
            </Columns>
            <SelfHierarchySettings ParentKeyName="id_parent" KeyName="id_groups_products" />
            <DetailTables>
                <telerik:GridTableView Caption="Produits associés" runat="server" DataKeyNames="id_product">
                    <Columns>
                        <telerik:GridTemplateColumn HeaderText="Status">
                            <ItemTemplate>
                                <uc1:imgStatus ID="img_status1" runat="server" Status='<%# Eval("id_status")%>' />
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridBoundColumn HeaderText="Nom" datafield="name" />
                        <telerik:GridMaskedColumn DataType="System.Guid" DataField="id_product" UniqueName="id_product" />
                    </Columns>
                    <ParentTableRelation>
                        <telerik:GridRelationFields MasterKeyField="id_groups_products" DetailKeyField="id_groups_products" />
                    </ParentTableRelation>
                </telerik:GridTableView>
            </DetailTables>
        </MasterTableView>
        <ClientSettings AllowDragToGroup="True">
        </ClientSettings>
    </telerik:RadGrid>
</asp:Content>

and the code behind :
I
Imports System.Data.SqlClient
Imports Telerik.Web.UI
 
Public Class TFGroupsProductsDetails
    Inherits System.Web.UI.Page
 
    Private Function GetDataTable() As DataTable
        Dim c As New SqlConnection(GetConnectionString(Session("DbName")))
        c.Open()
        Dim cmd As SqlCommand = c.CreateCommand
        cmd.CommandText = "create table #tempGP " & _
            "(id_groups_products uniqueidentifier, " & _
            "name nvarchar(50), " & _
            "descript nvarchar(max), " & _
            "id_parent uniqueidentifier, " & _
            "num_order int, " & _
            "id_status int)"
 
        cmd.ExecuteNonQuery()
        cmd = c.CreateCommand
        cmd.CommandText = "insert #tempGP select id_groups_products, name, descript, id_parent, num_order, id_status from groups_products"
        cmd.ExecuteNonQuery()
 
        Dim adapter As New SqlDataAdapter
        adapter.SelectCommand = New SqlCommand("select id_groups_products, name, descript, id_parent, num_order, id_status from groups_products", c)
        Dim myDataTable As New DataTable
        Try
            adapter.Fill(myDataTable)
        Finally
            c.Close()
        End Try
 
        Return myDataTable
    End Function
 
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If rGrid.EnableLinqExpressions Then
            rGrid.MasterTableView.FilterExpression = "it[""id_parent""] = Convert.DBNull"
        Else
            rGrid.MasterTableView.FilterExpression = "id_parent IS NULL"
        End If
 
    End Sub
 
    Private Sub rGrid_DetailTableDataBind(sender As Object, e As Telerik.Web.UI.GridDetailTableDataBindEventArgs) Handles rGrid.DetailTableDataBind
        Dim parentItem As GridDataItem = CType(e.DetailTableView.ParentItem, GridDataItem)
        If parentItem.Edit Then
            Return
        End If
 
        Dim c As New SqlConnection(GetConnectionString(Session("DbName")))
        c.Open()
        Dim adapter As New SqlDataAdapter
        adapter.SelectCommand = New SqlCommand("select id_product, name, descript, id_groups_products, num_order, id_status from products where id_groups_products='" + Guid.Parse(parentItem("id_groups_products").Text).ToString + "'", c)
        Dim myDataTable As New DataTable
        Try
            adapter.Fill(myDataTable)
        Finally
            c.Close()
        End Try
 
        e.DetailTableView.DataSource = myDataTable
    End Sub
 
    Private Sub rGrid_NeedDataSource(sender As Object, e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles rGrid.NeedDataSource
        rGrid.DataSource = GetDataTable()
    End Sub
 
End Class

i succes to get first level, but i get an issue each time a want to expand a item containing details. 

[EvaluateException: Impossible de trouver la colonne [id_parent].]
   System.Data.NameNode.Bind(DataTable table, List`1 list) +1283261
   System.Data.BinaryNode.Bind(DataTable table, List`1 list) +34
   System.Data.UnaryNode.Bind(DataTable table, List`1 list) +29
   System.Data.UnaryNode.Bind(DataTable table, List`1 list) +29
   System.Data.DataExpression.Bind(DataTable table) +84
   System.Data.DataExpression..ctor(DataTable table, String expression, Type type) +5314983
   System.Data.DataView.set_RowFilter(String value) +141
   System.Data.LinqDataView.set_RowFilter(String value) +46
   Telerik.Web.UI.GridEnumerableFromDataView.PerformTransformation() +500
   Telerik.Web.UI.GridEnumerableFromDataView.TransformEnumerable() +18
   Telerik.Web.UI.GridTableView.GetEnumerator(Boolean useDataSource, GridEnumerableBase resolvedDataSource, ArrayList dataKeysArray, Boolean shouldClearDataKeys) +131
   Telerik.Web.UI.GridTableView.CreateControlHierarchy(Boolean useDataSource) +1142
   Telerik.Web.UI.GridTableView.CreateChildControls(IEnumerable dataSource, Boolean useDataSource) +816
   System.Web.UI.WebControls.CompositeDataBoundControl.PerformDataBinding(IEnumerable data) +67
   System.Web.UI.WebControls.DataBoundControl.OnDataSourceViewSelectCallback(IEnumerable data) +123
   System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +33
   System.Web.UI.WebControls.DataBoundControl.PerformSelect() +138
   Telerik.Web.UI.GridTableView.PerformSelect() +16
   System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +30
   Telerik.Web.UI.GridTableView.DataBind() +274
   Telerik.Web.UI.GridDataItem.OnExpand() +348
   Telerik.Web.UI.GridItem.set_Expanded(Boolean value) +140
   Telerik.Web.UI.GridExpandCommandEventArgs.ExecuteCommand(Object source) +38
   Telerik.Web.UI.RadGrid.OnBubbleEvent(Object source, EventArgs e) +91
   System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37
   Telerik.Web.UI.GridItem.OnBubbleEvent(Object source, EventArgs e) +87
   System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37
   System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e) +114
   System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +252
   System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +35
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1724

Thanks for your help

regards
Eyup
Telerik team
 answered on 25 Dec 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?