Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
171 views
Hi! I'm working on a project using radgrid, radajaxmanager, radcontextmenu and I've encountered a problem which i cant seem to figure out. The app is ment for tablets so I'm using jquery mobile's taphold event. On taphold i'm showing a radcontextmenu. On taphold I simulate a click on the row (i have a mouse tracking event that sends coordinates of the row I want clicked) so i can take the index number of the row and write it to a hidden field which I use in codebehind to open a radwindow with html query data(based on the data in the row). 

The problem is that if I have radajaxmanager enabled that functionality works only the first time. On the second time I get a javascript error that the object is null. I tried alot of things, so in the end I disabled radajaxmanager and found out that everything works out if it's disabled. But ofcourse I like your ajaxmanager so I'd like to use it. So i'm coming to you, the guys that know radajaxmanager best.

And now lets look at the code:

This is my hidden field and my radgrid markup.
<input type="hidden" id="radGridClickedRowIndex" name="radGridClickedRowIndex" />
            <telerik:RadGrid ID="RadGrid_PregledPovprasevanj" runat="server" AllowSorting="True"
                AllowPaging="True" PageSize="16" ShowStatusBar="True" AllowFilteringByColumn='<%# If(IsNothing(Session("filterGumb")), "false", Session("filterGumb"))%>'
                GridLines="None" Height="100%" OnPreRender="RadGrid_PregledPovprasevanj_PreRender" GroupingEnabled="false">
                <ExportSettings FileName="Izvoz_Povprasevanja">
                    <Pdf PageTitle="Povprasevanja" PageWidth="" />
                </ExportSettings>
                <MasterTableView DataKeyNames="IDPovprasevanja"
                    AllowMultiColumnSorting="true" HierarchyLoadMode="Client" ExpandCollapseColumn-Visible="false">

This is my radajaxmanager

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" DefaultLoadingPanelID="RadAjaxLoadingPanel1" OnAjaxRequest="RadAjaxManager1_AjaxRequest" EnableAJAX="false">
 
<telerik:AjaxSetting AjaxControlID="RadGrid_PregledPovprasevanj">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadGrid_PregledPovprasevanj" LoadingPanelID="RadAjaxLoadingPanel1"></telerik:AjaxUpdatedControl>
                    <telerik:AjaxUpdatedControl ControlID="RadMenu1"></telerik:AjaxUpdatedControl>
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="RadMenu1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadMenu1"></telerik:AjaxUpdatedControl>
                    <telerik:AjaxUpdatedControl ControlID="RadGrid_PregledPovprasevanj"></telerik:AjaxUpdatedControl>
                    <telerik:AjaxUpdatedControl ControlID="RadWindowManager_DataBrowsers"></telerik:AjaxUpdatedControl>
                    <telerik:AjaxUpdatedControl ControlID="rw_kontakti"></telerik:AjaxUpdatedControl>
                </UpdatedControls>
            </telerik:AjaxSetting>

These are the client settings for radgrid

<ClientSettings AllowDragToGroup="true" AllowColumnsReorder="True" ReorderColumnsOnClient="True"
                    ColumnsReorderMethod="Reorder">
                    <Scrolling />
                    <ClientEvents OnRowClick="RowContextMenu" />
                    <Selecting AllowRowSelect="true" />
                    <Resizing />
                </ClientSettings>

This is the javascript line that becomes null after only one use if radajaxmanager is on

var index = eventArgs.get_itemIndexHierarchical();


This is the javascript code that handles the taphold and ajaxstart-end

$(document).mousemove(function (e) {
                window.x = e.pageX;
                window.y = e.pageY;
                //console.log(window.x);
            });
 
            $(window).load(function () {
 
            });
            $(document).ready(function () {
                var menu = $find("<%=RadMenu1.ClientID %>")
                $(function () {
                    $("tr.rgRow").bind("taphold", tapholdHandler);
                    $("tr.rgAltRow").bind("taphold", tapholdHandler);
 
                    function tapholdHandler(e) {
                        $(document.elementFromPoint(x, y)).click();
                        menu.showAt(x, y)
                    }
                });
            });
            $(window).resize(function () {
            });
 
            function RowContextMenu(sender, eventArgs) {
                var evt = eventArgs.get_domEvent();
 
                if (evt.target.tagName == "INPUT" || evt.target.tagName == "A") {
                    return;
                }
 
                var index = eventArgs.get_itemIndexHierarchical(); // THIS IS WHAT IS NULL AFTER THE FIRST TIME
                document.getElementById("radGridClickedRowIndex").value = index;
            }
 
            var AjaxIsActive = false;
            function RequestStart(sender, args) {
                if (!AjaxIsActive) {
                    AjaxIsActive = true;
                }
                else {
                    alert((typeof ActiveAJAXMessage === 'undefined') ? 'Wait for ajax to finish' : ActiveAJAXMessage); return false;
                }
                document.body.style.cursor = "wait";
                //*************************************************************************
                if (args.get_eventTarget().indexOf("ExportToExcelButton") >= 0 ||
                    args.get_eventTarget().indexOf("ExportToWordButton") >= 0 ||
                    args.get_eventTarget().indexOf("ExportToPdfButton") >= 0 ||
                    args.get_eventTarget().indexOf("ExportToCsvButton") >= 0) {
                    args.set_enableAjax(false);
                    ResponseEnd();
                }
                if (args.get_eventTarget().indexOf("btn_Dok_PrikaziDok") >= 0) {
                    args.set_enableAjax(false);
                    ResponseEnd();
                }
            }
            function ResponseEnd(sender, args) {
                AjaxIsActive = false;
                document.body.style.cursor = "default";
            }


EDIT: Forgot to add my RadAjaxManager onAjaxRequest:

Protected Sub RadAjaxManager1_AjaxRequest(ByVal sender As Object, ByVal e As AjaxRequestEventArgs) Handles RadAjaxManager1.AjaxRequest
       If e.Argument = "Rebind" Then
           RadGrid_PregledPovprasevanj.MasterTableView.SortExpressions.Clear()
           RadGrid_PregledPovprasevanj.MasterTableView.GroupByExpressions.Clear()
           RadGrid_PregledPovprasevanj.Rebind()
       ElseIf e.Argument = "RebindAndNavigate" Then
           RadGrid_PregledPovprasevanj.MasterTableView.SortExpressions.Clear()
           RadGrid_PregledPovprasevanj.MasterTableView.GroupByExpressions.Clear()
           RadGrid_PregledPovprasevanj.MasterTableView.CurrentPageIndex = RadGrid_PregledPovprasevanj.MasterTableView.PageCount - 1
           RadGrid_PregledPovprasevanj.Rebind()
       End If
   End Sub


Luka
Top achievements
Rank 1
 answered on 22 Nov 2013
4 answers
115 views

I'm getting a different styling on checkboxes with 2013.3 SP1.   Take a look at the attached screenshots, one from version 2013.3.1015 and the other from 2013.3.1114.  These are both IE 8, Windows XP Pro.  Firefox does not have this difference.  In FF, the 1114 version looks the same as the 1015 version  Here is a boiled down version of the ASPX page with RadGrid, single column, checkbox in header. 

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TestCheckbox.aspx.cs" Inherits="TestCheckbox" %>
  
<!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>
</head>
<body>
    <form id="form1" runat="server">
      
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
            <Services>
                <asp:ServiceReference path="~/WS/wsIHExplorer.asmx" />
            </Services>
        </telerik:RadScriptManager>
          
        <telerik:RadSkinManager ID="RadSkinManager1" runat="server" Skin="Default" ShowChooser="false" />
  
        <telerik:RadAjaxLoadingPanel runat="server" ID="RadAjaxLoadingPanel1" />
      
        <telerik:RadGrid ID="RadGrid1" runat="server"
            AutoGenerateColumns="false" 
            Width="100%"
            Height="100%"
            BorderWidth="0px" 
            AllowMultiRowSelection="true"
        >
            <PagerStyle Mode="NextPrevAndNumeric" AlwaysVisible="true" />
            <MasterTableView 
                    TableLayout="Fixed" 
                    AutoGenerateColumns="false"  
                    PageSize="10" 
                    AllowPaging="true" 
                    AllowSorting="true"
                    AllowNaturalSort="false" 
            >
                <Columns>
                    <telerik:GridTemplateColumn UniqueName="Selection" HeaderStyle-Width="60px" HeaderStyle-HorizontalAlign="Center">
                        <HeaderTemplate>
                            <asp:CheckBox ID="chkSelectionHeader" runat="server" />
                        </HeaderTemplate>
                        <ClientItemTemplate>
                            <table cellspacing="0" cellpadding="0" width="100%">
                                <tr>
                                    <td align="center"><input id="chkSelection" type="checkbox" /></td>
                                </tr>
                            </table>
                        </ClientItemTemplate>
                        <ItemStyle HorizontalAlign="Center" />
                    </telerik:GridTemplateColumn>
                </Columns>
                <NoRecordsTemplate>
                    <div>
                           
                    </div>
                </NoRecordsTemplate>
            </MasterTableView>
            <ClientSettings>
                <ClientEvents 
                    OnCommand="function () {}"
                />
                <Selecting AllowRowSelect="true" UseClientSelectColumnOnly="true" />
                <Scrolling AllowScroll="true" UseStaticHeaders="true" />
                <DataBinding ShowEmptyRowsOnLoad="false" />
            </ClientSettings>
        </telerik:RadGrid>
    </form>
</body>
</html>
Konstantin Dikov
Telerik team
 answered on 22 Nov 2013
1 answer
191 views
I have a column in RadGrid with multiple choice field and I need to group that column.

in that column have multiple value.
Konstantin Dikov
Telerik team
 answered on 22 Nov 2013
3 answers
118 views
I am trying to have a date aggregate in the grid and use the Max date as the aggregate. I keep getting an error in the PivotGrid and my SQL output is just a standard date field. Is this possible to achieve?

Thanks.

<telerik:PivotGridAggregateField DataField="MyDate" Aggregate="Max" Caption="Mydate" />
Milena
Telerik team
 answered on 22 Nov 2013
1 answer
404 views
Hi,

we are using latest version of RadGrid. We used radgrid default skin and modified the colors of rgRow and rgAltRow to suit our needs. It is working perfectly fine.

On one of the pages, when page loads, grid gets loaded. When user selects one of the item in dropdown list, in code we loop thru grid rows and based on certain conditions, we set row visible property to true or false. That means we are hiding some of the rows. In this scenario, rgrow or altrow color doesn't work. If the hidden row is rgRow, then rgaltrow color shows up for 2 rows and vice versa. So, what I want is, check for row (rgrow or altrow) and then make the next row the other. If rgrow is hidden, next row is rgAltrow. But make it as rgRow so alternate colors and rest are applied.

I appreciate your response.
Thanks,
Prathiba
Venelin
Telerik team
 answered on 22 Nov 2013
4 answers
170 views

I upgraded my asp.net projects to Version 2013.3.1114.40 using the Upgrade Wizard.   After upgrade some controls looks different in IE.  I see difference in RadGrid command buttons, check list control, radio button list control.  I have attached pictures before and after upgrade.
Eyup
Telerik team
 answered on 22 Nov 2013
6 answers
297 views
i have custom control with radgrid inside edit radgrid template.
none of the updates/insert/deletes in custom control not working. could you explain why and how to fix it
Konstantin Dikov
Telerik team
 answered on 22 Nov 2013
3 answers
253 views
I've noticed the behaviour, for example, of a RadAutoCompleteBox when using WebServiceSettings, that occasionally the responses from the server do not return in the same order they were requested by the client, which makes for confusing the user as entries displayed in the drop-down do not always make sense according to what has been typed.

This raises two questions:

  1. Is there a delay property on RadAutoCompleteBox/RadSearchBox etc to delay the client request by n milliseconds until the user has stopped typing, instead of firing back several requests as the user types something?
  2. Can the RadAutoCompleteBox/RadSearchBox etc (e.g. via time-stamping client requests to the server or other way) always ensure that responses from the server are ignored unless the response was the last one to be made?

Hope this makes sense!
Nencho
Telerik team
 answered on 22 Nov 2013
3 answers
161 views
I have a RadGrid...
 
<telerik:RadGrid ID="RadGrid_1" runat="server" DataSourceID="EntityDataSource_1"
CellSpacing="0" GridLines="None"
AllowPaging="True" AllowSorting="True" AllowFilteringByColumn="True"
AllowAutomaticDeletes="True" AllowAutomaticInserts="True"
AllowAutomaticUpdates="True" Width="970px">

Im using the EditFormTemplate to show a table with various controls. some are simple text boxes others (dropdownlists) are bound to a different datasource to get predefined values form the DB. 

Everything is working well, I can display a list of records, page, sort, filter, and edit a single record without a problem. 
however, when I try to insert a new record i get a YSOD sayiing the selected value is not in the datasource 
. in the case of the ddl the initial selected value would be "" and since that value does not exist in the datasource I can see why the error is thrown. I have mitigated this by adding in a bank listitem and appending databound items but this seems like a workaround and not a solution.

In the case of a telerik:RadDateInput...
<telerik:RadDateInput ID="RadDateInput44" runat="server" SelectedDate='<%# Bind("effectivedate")%>'   />

 im setting the selected date to a value from the radgrids datasource, again all of the features work until i try to insert a new record.  Because the control is bound the selecteddate will be "" which cant be converted to a real date so i get a {"Specified cast is not valid."} exception.

How can this situation avoided on the insert and still have data bound controls on the edit/update
i was thinking of some kind of conditional binding expression but im not familiar with how to do that

Thanks, Scott


Princy
Top achievements
Rank 2
 answered on 22 Nov 2013
9 answers
350 views
  1. Generally, the disabled text is far too pale; darken it.
  2. In RadMenu, the border used for the hovered over item is indistinct; cnsider something else (a colour change?)
  3. In RadMenu, the upper and lower border used for the selected item gets lost background; consider a better method of highlighting the item.
  4. In RadGrid, the borders of the Pager buttons are too pale; consider using a darker colour.
  5. In RadToolBar, the icons seem to ride higher in Metro than other skins (see ToolbarIcons-*.png)
  6. In RadTreeView the expand node icon is too faint; consider making it darker.
Magdalena
Telerik team
 answered on 22 Nov 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?