Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
312 views
 when I use onclientclose = "Close" that time,
 it closes without postback which what I want, BUT, when page postbacks later if any click event,
 I see that Radwindow back like I never closed it.
.I have also put .visibleonpageload = false on page load
 on code behind and that seems to be working fine, but not sure if
 this is a proper way to
 handle this or not since I was actually had that on the client side too..
. What I need to do? any idea?
 

<
telerik:RadWindowManager Behaviors="Close, Move, Resize,Maximize" ID="RadWindowManager"
        DestroyOnClose="true" runat="server" IconUrl="http://www.telerik.com/favicon.ico"
        Modal="true">
        <Windows>
 <telerik:RadWindow ID="winConfirmDelete" VisibleOnPageLoad="false" runat="server"
                Title="Confirm Delete" VisibleStatusbar="false" CssClass="radWindow" Width="300"
                Height="175" Skin="Windows7" onclientclose="Close">
                <ContentTemplate>
                    <table width="100%" cellpadding="0" cellspacing="0">
                        <tr>
                            <td colspan="2">
                                <br />
                                <p style="text-align: center">
                                    <asp:Label ID="lblConfirmResult" runat="server" CssClass="validationWarning" Text="Are you sure you want to delete this?" /></p>
                                <p style="text-align: center">
                                    <telerik:RadButton ID="btnConfirmDelete" runat="server" Text="Delete" OnClick="btnConfirmDelete_Click" />
                                    <telerik:RadButton ID="btnConfirmCancel" runat="server" Text="Cancel" OnClick="btnConfirmCancel_Click" />
                                </p>
                            </td>
                        </tr>
                    </table>
                </ContentTemplate>
            </telerik:RadWindow>
  </Windows>
    </telerik:RadWindowManager>
 
// have these inside the javascript stuff..
 

   //close without postback.         
   function Close(sender, eventArgs) {
 
                sender.close();
        }
Steve
Top achievements
Rank 1
 answered on 22 Nov 2013
2 answers
200 views
Hi I am using the raddock and when a user clicks the close button it fires a server side method which marks the selected raddock item as deleted. Thing is I want to ask the ask if they are sure before doing so.

I wrote this piece the js below which fire ok but the server side event is hit whether the user selects yes or no.

Any help would be appreciated.

Thanks,

Dave J.

function OnClientCommand(sender, args) {
    if(args.Command.get_name() == "Close")
    {
       var r = confirm("Are you sure you want to delete this Form Field?");
       if (r == true) {
          return true;
       }
       else {
          return false;
       }
    }
}
Dave
Top achievements
Rank 1
 answered on 22 Nov 2013
0 answers
337 views
Hi,

I am using classic asp for a project.
A form with two dropdown (state and city) select and other text inputs.
I want to populate the second dropdown from database (using storeprocedure) on changing the value of first dropdown.
I am calling form.Submit() on change of state dropdown. this call populating the city dropdown by using the Request.Form("State").

But this form.Submit() call is clearing all the text inputs value.

I want to create this kind of dependent dropdown that should not clear the input text value.
Help me to achieve this.

<select name="State" onChange="this.form.action = '<%=Request.ServerVariables("Script_Name")%>'; this.form.submit();">
                    <option <%if Trim(Request.Form("EventState"))="" then Response.Write "selected" end if%> value="">          </option>
                    <option <%if Trim(Request.Form("EventState"))="AL" then Response.Write "selected" end if%> value="AL">Alabama</option>
                    <option <%if Trim(Request.Form("EventState"))="AZ" then Response.Write "selected" end if%> value="AZ">Arizona</option>
</select>


Thanking you,
AGM Raja
Agm
Top achievements
Rank 1
 asked on 22 Nov 2013
3 answers
131 views
I'm trying to add a tooltip for my custom column - here is the code:

void Grid_ItemDataBound(object sender, GridItemEventArgs e)         
{
    foreach (GridColumn column in RadFileExplorer1.Grid.MasterTableView.RenderColumns)                 
    {                     
        if ((column is GridTemplateColumn) && (column.HeaderText.Equals("Document Title")))                     
        {                         
            if (e.Item is GridDataItem)                         
            {                             
                GridDataItem gridItem = e.Item as GridDataItem;                             
                string text = gridItem[column.UniqueName].Text;  
                
                //this line will show a tooltip
                            
                gridItem[column.UniqueName].ToolTip = text;                         
            }                                              
        }                 
    }             
}


I'm unable to get the value of the cell as tooltip - can you please help?
Vessy
Telerik team
 answered on 22 Nov 2013
5 answers
161 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
104 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
182 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
105 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
361 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
144 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
Narrow your results
Selected tags
Tags
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
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?