Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
176 views
Is there a way to Client side filter a grid on multiple columns? As an example, say I have two columns; Title & Description. If I have a textbox where someone can enter a filter term I want to be able to use that serch term on both columns in an OR fashion to accomplish the following

search where title OR description contains search_term 

I see that the GridTableView has a filter function but it appears to only filter a single column.
BaiH
Top achievements
Rank 1
 answered on 30 Jun 2009
1 answer
99 views
I have a TreeView that can add nodes dynamically in the client.  After you edit the name of the newly added node it uses ajax to go back to the server to update the database with the new node.

When I run this ASCX on it's own page it runs fine.  However, when I embed this ASCX as content within a tab pane the NodeEdit event stops firing after you edit a newly added node.  It still runs, though, when editing an already-existing node.

Any initial thoughts?  I'm not sure how to pull this out and do a simple repro.  My guess is it won't repro when I dumb down the code.

Thanks,
Kevin
Kevin Warnke
Top achievements
Rank 1
 answered on 30 Jun 2009
3 answers
134 views
Hi,
I'm trying to add a custom filter to grid using js, like this:
tableView.get_filterExpressions().clear();
tableView.get_filterExpressions().add("ContributionID='" + $get('cContributionID').value + "'");

And this works great. However; if we then filter using the gridcolumn it breaks on:
Telerik.Web.UI.GridFilterExpressions.prototype={find:function(_3e8){
for(var i=0,_3ea=this.get_count();i<_3ea;i++){
var item=this.getItem(i);
if(item.get_columnUniqueName()==_3e8){
return item;
}

Because item is just the filterstring.
I've read http://www.telerik.com/help/aspnet-ajax/grid_filter.html , but that requires that the filtered field is in the grid.

Please advice.
Tsvetoslav
Telerik team
 answered on 30 Jun 2009
3 answers
97 views
The message is Sys.ArgumentOutOfRangeException: Value must be an integer
Parameter name: x
Actual value was NaN

the page has the splitter, when I click to make it slide out, I get this error.
Please help, thanks.
Martin
Top achievements
Rank 1
 answered on 30 Jun 2009
3 answers
140 views
Hi,

I'm creating a grid dynammically on Page_Init event and using a placeholder declared in my html code. When the page load first time, the grid, the columns, the datasource are created perfectally. When I do a new ajax request (like perfoming a filter), the grid is created like expected on Page_Init (defining all structure like described in telerik online demos), but when the DetailTableDataBind event is called the grid comes with its structure changed. Example, first time the page inits I create a grid with the following structure (on Page_init event):

- MasterTableView
---- DetailtTable 1
-------- DetailTable 1.1
-------- DetailTable 1.2
-------- DetailTable 1.3

After performing a filter (the second load), the grid must be created like this:

- MasterTableView
---- DetailtTable 1
-------- DetailTable 1.1

I follow the code in debug and it is created ok. But when the code enter in DetailTableDataBind event, the grid changed its structure and back to the first structure:

- MasterTableView
---- DetailtTable 1
-------- DetailTable 1.1
-------- DetailTable 1.2
-------- DetailTable 1.3

The instance of the grid is the same (before and after the the DetailTableDataBind event). In don't know why it is ignoring my modifications on the grid structure at Page_Init event. Another problem is when calling the DetailTableDataBind event the Name property is empty even when I set its value (after the first page request).

Thanks.



Pavlina
Telerik team
 answered on 30 Jun 2009
1 answer
119 views
Hi,

 I've a question regarding radajaxpanel and the ajaxmanager. I've used the telerik example RadScheduler with tooltip. I've extended the tooltip with a button. The ClickEvent is implemenet in the main page (code behind - used a deligate in the tooltip control). The Button works fine, but after executing the onclick event I like to update my rategrid1. It works with an updatepanel if I use UpdatePanel2.Update(). But if i use radajaxpanel the rategrid1 doesn't get updated even on rategrid1.rebind(). Also the Button on the bottom of the page, which is enabled=false should be updated. I guess I've to use the ajax manager, but I'm not sure how this works. Maybe you can tell me how to manage the updates.

Here is my new code again:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="ProtelShop._Default" MasterPageFile="~/ProtelShop.Master" %> 
 
<%@ Register assembly="Telerik.OpenAccess, Version=2009.1.405.1, Culture=neutral, PublicKeyToken=7ce17eeaf1d59342" namespace="Telerik.OpenAccess" tagprefix="telerik" %> 
<%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik"  %> 
 
 
 
<%@ Reference Control="~/Controls/ShopBuyTooltip.ascx" %> 
 
 
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">  
 
  <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">  
 <AjaxSettings>    
        <telerik:AjaxSetting AjaxControlID="RadGrid1">    
            <UpdatedControls>    
                <telerik:AjaxUpdatedControl ControlID="RadGrid1"  />    
            </UpdatedControls>    
        </telerik:AjaxSetting>    
        <telerik:AjaxSetting AjaxControlID="RadWindowManager1">    
            <UpdatedControls>    
                <telerik:AjaxUpdatedControl ControlID="RadWindowManager1"  />    
            </UpdatedControls>    
        </telerik:AjaxSetting>    
 
    </AjaxSettings>   
    </telerik:RadAjaxManager> 
 
    <div> 
      
    </div> 
    <telerik:RadScriptManager ID="RadScriptManager1" Runat="server">  
      
    </telerik:RadScriptManager> 
       
    <telerik:RadWindowManager runat="server" ID="RadWindowManager1">  
    </telerik:RadWindowManager> 
    <script type="text/javascript">  
 
        //<![CDATA[
       
            function hideActiveToolTip()
            {            
                var controller = Telerik.Web.UI.RadToolTipController.getInstance();
                var tooltip = controller.get_activeToolTip();
                if (tooltip)
                {
                    tooltip.hide();
                }
            }
            
            Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(beginRequestHandler);
            function beginRequestHandler(sender, args)
            {
                var prm = Sys.WebForms.PageRequestManager.getInstance();
                if (args.get_postBackElement().id.indexOf('RadScheduler1') != -1)
                {
                    hideActiveToolTip();
                }
            }
            
            function clientBeforeShow (sender, eventArgs) {
             w = $telerik.$(window).width() / 2;
             h = $telerik.$(window).height() / 2;
               
             if ((sender._mouseX > w) && (sender._mouseY > h)) {
             sender.set_position(Telerik.Web.UI.ToolTipPosition.TopLeft);
             return;
             }
             if ((sender._mouseX < w) && (sender._mouseY > h)) {
             sender.set_position(Telerik.Web.UI.ToolTipPosition.TopRight);
             return;
             }
             if ((sender._mouseX > w) && (sender._mouseY < h)) {
             sender.set_position(Telerik.Web.UI.ToolTipPosition.BottomLeft);
             return;
             }
         sender.set_position(Telerik.Web.UI.ToolTipPosition.BottomRight);
            }
        //]]> 
        </script> 
    <telerik:OpenAccessDataSource ID="OpenAccessDataSource1" runat="server"   
        ObjectContextProvider="ProtelShop.ObjectScopeProvider1, ProtelShop"   
        TypeName="ProtelAccess.Article" ContextTypeName="" OrderBy=""   
        Where="MaxAnz &gt; 0" > 
    </telerik:OpenAccessDataSource> 
       
<telerik:RadSkinManager ID="RadSkinManager1" runat="server">          
        </telerik:RadSkinManager> 
        <telerik:RadFormDecorator ID="RadFormDecorator1" runat="server"  DecoratedControls="All"/>  
     
                    
                  <asp:Panel ID="Panel2" runat="server" CssClass="title" > 
                   Seminar Angebote  
               </asp:Panel> 
             
               <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" > 
    <telerik:RadScheduler ID="RadScheduler1" runat="server" DataEndField="EndTime"   
        DataKeyField="ArtNr" DataSourceID="OpenAccessDataSource1"   
        DataStartField="StartTime" DataSubjectField="Name" HoursPanelTimeFormat="htt"   
        ValidationGroup="RadScheduler1"  ReadOnly="true"  SelectedView="MonthView" Height="350">  
    </telerik:RadScheduler> 
    <telerik:RadToolTipManager runat="server" ID="RadToolTipManager1" Width="320" Height="170" 
                    Animation="None" HideEvent="LeaveToolTip" Text="Loading..." 
                    OnAjaxUpdate="RadToolTipManager1_AjaxUpdate" OnClientBeforeShow="clientBeforeShow" /> 
                      
                    </telerik:RadAjaxPanel> 
                   <br /> 
         
 
 
      
            <telerik:RadAjaxPanel ID="RadAjaxPanel2" runat="server" > 
      
           <br /> 
               <asp:Panel ID="Panel1" runat="server" CssClass="title">  
                   Warenkorb  
               </asp:Panel> 
           <telerik:RadGrid ID="RadGrid1" runat="server" AllowAutomaticDeletes="true"   
                    AllowAutomaticUpdates="true" AutoGenerateColumns="true"   
                    AutoGenerateDeleteColumn="true" OnDeleteCommand="RadGrid1_DeleteCommand"  OnItemDataBound="RadGrid1_ItemDataBound" > 
                    <MasterTableView AutoGenerateColumns="False" RetrieveAllDataFields="false" ShowFooter="true">  
                        <Columns> 
                            <telerik:GridBoundColumn DataField="ArtNr" HeaderText="Artikelnummer">  
                            </telerik:GridBoundColumn> 
                            <telerik:GridBoundColumn DataField="Name" HeaderText="Artikelname">  
                            </telerik:GridBoundColumn> 
                            <telerik:GridBoundColumn DataField="ArtName" HeaderText="Artikelbeschreibung">  
                            </telerik:GridBoundColumn> 
                            <telerik:GridBoundColumn DataField="StartTime" HeaderText="Start">  
                            </telerik:GridBoundColumn> 
                            <telerik:GridBoundColumn DataField="EndTime" HeaderText="Ende">  
                            </telerik:GridBoundColumn> 
                            <telerik:GridBoundColumn DataField="Quantity" HeaderText="Anzahl">  
                            </telerik:GridBoundColumn> 
                            <telerik:GridBoundColumn DataField="ArtPrice" HeaderText="Preis" DataFormatString="{0:C}">  
                            </telerik:GridBoundColumn> 
                             
 
                        </Columns> 
                          
                    </MasterTableView> 
                </telerik:RadGrid> 
     
        </telerik:RadAjaxPanel> 
        <br /> 
 
    <telerik:RadAjaxPanel ID="RadAjaxPanel3" runat="server" > 
    
        <div style="text-align:right">  
    <asp:Button ID="Button1" runat="server" Text="Zur Kasse" onclick="Button1_Click" Width="100px"  /> 
    </div> 
      </telerik:RadAjaxPanel> 
 
      
 </asp:Content> 


  private void btbuy_clicked(object sender, EventArgs e)  
        {  
            AppointmentToolTip mytooltip = (AppointmentToolTip)sender;  
            TempOrder myOrder = new TempOrder();  
            int ArtID = int.Parse(mytooltip.TargetAppointment.ID.ToString());  
            int ct = 0;  
            for (int a = 0; a < myOrders.Count; a++)  
            {  
                TempOrder to = (TempOrder)myOrders[a];  
                if (to.ArtNr == ArtID)  
                    ct++;  
 
            }  
 
              
            var articlesselected = from a in cashedScope.Extent<Article>()  
                                   where a.ArtNr == ArtID  
                                   select a;  
 
              
            cashedScope.Transaction.Begin();  
 
            foreach (Article art in articlesselected)  
            {  
                if (ct + 1 > art.MaxAnz)  
                {  
 
                    string scriptstring = "radalert('<h4>Dieser Artikel ist leider nicht mehr verfügbar!</h4>', 330, 210);";    
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "radalert", scriptstring, true);    
                    return;  
                }  
                myOrder.setArticle(1, art);  
            }  
 
            cashedScope.Transaction.Commit();  
            myOrders.Add(myOrder);  
            Session["myOrders"] = myOrders;  
            if (myOrders.Count > 0)  
            {  
                Button1.Enabled = true;  
        
            }  
            TAmount += myOrder.ArtPrice;  
 
            RadGrid1.Rebind();  
            
        } 

Thanks
Pavlina
Telerik team
 answered on 30 Jun 2009
7 answers
542 views
Hi,
 I have a date picker and required field validator on a user control. The issue is if I click in the date input box and I click on the calendar popup button or even I just clicked anywhere on the page the "Error message is shown" before I click on the save button on the page.
 Is this the real behaviour? or Is there a way to solve the issue?
ascx:
telerik:RadDatePicker AutoPostBack="false" runat="server" ID="datepicker1" Skin="Web20new"
                        EnableEmbeddedSkins="false" MinDate="1900-01-01" Width="132px">
                        <DateInput runat="server" InvalidStyleDuration="100" DateFormat="MM/dd/yyyy" LabelCssClass="radLabelCss_Web20new"
                            Skin="Web20new" EnableEmbeddedSkins="False" ShortYearCenturyEnd="2039">
                            <InvalidStyle ForeColor="Red" />
                        </DateInput>
</telerik:RadDatePicker>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="datepicker1" ErrorMessage="RequiredFieldValidator"></asp:RequiredFieldValidator>

aspx:
Protected Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
..
End Sub

 Thank you
Pavlina
Telerik team
 answered on 30 Jun 2009
6 answers
177 views
Hi,
I'm using a RadGrid inside a RadWindow (as a popup), to allow the user select a row that will be added on the main page.
I want to get the Key of the selected row and pass it to the main page, the code of the page that loads into RadWindow is:

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="NewsSelect.aspx.cs" Inherits="SR.News.Views.NewsSelect" 
    Title="NewsSelect"  %> 
<%@ Register Assembly="Microsoft.Practices.Web.UI.WebControls" Namespace="Microsoft.Practices.Web.UI.WebControls" 
    TagPrefix="pp" %> 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml" style="height: 100%"> 
<head id="Head" runat="server">  
    <script type="text/javascript">             
    function GetRadWindow() 
    { 
    var oWindow = null; 
    if (window.radWindow) 
     oWindow = window.radWindow; 
    else if (window.frameElement.radWindow) 
     oWindow = window.frameElement.radWindow; 
    return oWindow; 
    }    
    function OnClientRowSelected(sender, eventArgs) 
    { 
    var currentWindow = GetRadWindow();     
    var newsId = eventArgs.getDataKeyValue("NewsID") 
    currentWindow.close(newsId); 
    }      
    </script> 
    <link href="../App_Themes/Default/rightcontent.css" type="text/css" rel="stylesheet" /> 
    <title>SardegnaRicerche</title> 
</head> 
<body style="height: 100%; margin: 0 auto; overflow: hidden" scroll="no"> 
 
     
    <form id="form1" runat="server" style="height: 100%; width: 100%; margin: 0px"> 
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server"  
        OutputCompression="AutoDetect"> 
    </telerik:RadScriptManager> 
    <pp:ObjectContainerDataSource ID="odsNews" runat="server"  
        DataObjectTypeName="SRRules.Entities.News" /> 
    <telerik:RadGrid ID="grdFiles" runat="server" AutoGenerateColumns="False"  
        GridLines="None" Skin="Office2007" DataSourceID="odsNews"> 
<MasterTableView DataKeyNames="NewsID" DataSourceID="odsNews"  
            ClientDataKeyNames="NewsID"> 
<RowIndicatorColumn> 
<HeaderStyle Width="20px"></HeaderStyle> 
</RowIndicatorColumn> 
 
<ExpandCollapseColumn> 
<HeaderStyle Width="20px"></HeaderStyle> 
</ExpandCollapseColumn> 
    <Columns> 
        <telerik:GridBoundColumn DataField="Priority" DataType="System.Int32" HeaderText="Priorità" 
                    ReadOnly="True" SortExpression="Priority" UniqueName="Priority"> 
                </telerik:GridBoundColumn> 
                <telerik:GridBoundColumn DataField="Title"  
                    HeaderText="News" UniqueName="Title" SortExpression="Title"> 
                </telerik:GridBoundColumn> 
                <telerik:GridDateTimeColumn DataField="StartDatePublication"  
                    HeaderText="Data pubblicazione" SortExpression="StartDatePublication" 
                    UniqueName="StartDatePublication"  DataFormatString="{0:d}" 
                    DataType="System.DateTime"> 
                </telerik:GridDateTimeColumn> 
                <telerik:GridDateTimeColumn DataField="EndDatePublication"  
                    HeaderText="Data scadenza" SortExpression="EndDatePublication" 
                    UniqueName="EndDatePublication" DataFormatString="{0:d}"  
                    DataType="System.DateTime"> 
                </telerik:GridDateTimeColumn> 
    </Columns>     
</MasterTableView> 
 
        <ClientSettings> 
            <Selecting AllowRowSelect="True" EnableDragToSelectRows="False" /> 
            <ClientEvents OnRowSelected="OnClientRowSelected" /> 
        </ClientSettings> 
 
<FilterMenu EnableTheming="True" Skin="Office2007"> 
<CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> 
</FilterMenu> 
    </telerik:RadGrid> 
    </form> 
</body> 
</html> 


This code work fine for IE7, however, the event doesn't get fired in Firefox3 (I tried putting a breakpoint on the function OnClientRowSelected(sender, eventArgs) (line 20) and Firefox never reaches it.

I would appreciate any help on this matter,

Regards,
Raúl Herrmann

Pavlina
Telerik team
 answered on 30 Jun 2009
7 answers
173 views
Hi Telerik Team,

We have implemented the RadGrid header localization using Grid ItemCreated event(as per mentioned in your help documentation).But here we are facing major performance issues;reason being during binding of the Grid for every record, Grid Item event is getting invoked, so calling of this event for every record is very time consuming.

We are looking for an event where we can localize grid header at once only other than Item_Created or Column_Created Event to regain performance of the page.

Thanks,
Rajesh
Georgi Krustev
Telerik team
 answered on 30 Jun 2009
2 answers
154 views
Ever time I try to install the RadControls I get the following error:
"Another installation is in progress. You must comßplete that installation before continue this one".

This appears also after a complete reboot.
How can I discover the process which is causing this error?

Thank you,
Reinhold
Reinhold
Top achievements
Rank 1
 answered on 30 Jun 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?