Telerik Forums
UI for ASP.NET AJAX Forum
0 answers
350 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
152 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
167 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
108 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
189 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
112 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
384 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
157 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
293 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
228 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
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?