Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
103 views
I just upgraded from v2008 to v2009 AJAX .NET controls.

I have a huge website that I developed using these older controls. I want to use the newer versions going forward, but if I place one on the page it tells me that the file already exists and asks me if I want to replace "Bin/Telerik.Web.UI.dll"?

If I select yes than none of my pages work with the older controls - it tells me "that the 2008 version blah blah could not be found".  if I select no, than wouldn't I really just be working with the older libraries and not even using the new controls?


Schlurk
Top achievements
Rank 2
 answered on 14 Jan 2010
1 answer
145 views
Hi, I have an Export to Excel button (image button) that sits inside an Ajaxified RadPageView and a mult-tabbed interface and as you guessed by the title, The excel file does not export even though the following code executes without error.

 Protected Sub btnExport_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnExport.Click
        Dim filename As String
        filename = Membership.ApplicationName.ToString & txtFirstName.Text & "_" & txtLastName.Text & "_" & lblmemberID.Text & "_OrderHistory"
        RadGrid1.ExportSettings.OpenInNewWindow = True
        RadGrid1.ExportSettings.FileName = filename
        RadGrid1.ExportSettings.ExportOnlyData = True
        RadGrid1.ExportSettings.IgnorePaging = True


        RadGrid1.ExportSettings.OpenInNewWindow = True
        RadGrid1.MasterTableView.ExportToExcel()

    End Sub

Does anyone know how I can keep the Ajax but have the export perform as desired? Thanks.
Daniel
Telerik team
 answered on 14 Jan 2010
0 answers
103 views
I am trying to customize the paging of the radgrid but i hit the dead end.

Inside the NeedDataSource event handler i have these two lines:

RadGrid1.VirtualItemCount = Catalog.ItemCount(Me.txtSearch.Text.Trim, _ 
                                                                    txtRangeFrom.Text, txtRangeTo.Text, _ 
                                                                    IIf(cmbDepartments.SelectedValue <> "", cmbDepartments.SelectedValue, 0), _ 
                                                                    IIf(cmbCategories.SelectedValue <> "", cmbCategories.SelectedValue, 0), _ 
                                                                    0) 
 
 
RadGrid1.DataSource = Catalog.GetProducts(Me.txtSearch.Text.Trim, _ 
                                                                     txtRangeFrom.Text, txtRangeTo.Text, _ 
                                                                     IIf(cmbDepartments.SelectedValue <> "", cmbDepartments.SelectedValue, 0), _ 
                                                                     IIf(cmbCategories.SelectedValue <> "", cmbCategories.SelectedValue, 0), _ 
                                                                     0, Me.RadGrid1.CurrentPageIndex + 1, 10) 

But it seems i am missing something because when i move through the pages after 10 or 20 pages it appears empty althrough it says that there are more pages remaining.

Also when i add some search criteria it does affect the items shown up in the grid itself but not the pager which still refers to the previously counted items/pages.

For instance if i enter search term "test" and click the search button calling RadGrid.Rebind method it affects only the first page of the grid but the pager does not change at all.

Am i missing something e.g. maybe i should replace the code for setting virtualItemCount property in another event?

Thanks

El
Top achievements
Rank 1
 asked on 14 Jan 2010
3 answers
307 views


Ok I need a solution to a problem I keep running into. Basically, I want the edit and delete command columns to be the rightmost columns on my grid. However, when I use the advanced databinding technique, the edit and delete command options are in the leftmost columns.

I tried explicitly declaring my data columns in the <column> section of the masterTableView, but the only thing that does is cause the needDataSource event to duplicate the collumns.

Here is my grid declairation markup:

<telerik:RadGrid ID="gvFirmInfo" runat="server" Width="550px"> 
    <MasterTableView  
        EditMode="PopUp"  
        CommandItemDisplay="Bottom" CommandItemStyle-BackColor = "#D8D8D8" 
        ShowHeader="true" ShowHeadersWhenNoRecords="false" NoMasterRecordsText="" 
        HeaderStyle-Font-Bold="true" HeaderStyle-BackColor ="#D8D8D8" 
        ItemStyle-BackColor="White" ItemStyle-BorderColor="#C9C4D1"  
        ItemStyle-BorderStyle="Solid" ItemStyle-BorderWidth="1px"  
        AlternatingItemStyle-BackColor="#E0E0E0" AlternatingItemStyle-BorderStyle="Solid" 
        AlternatingItemStyle-BorderWidth="0px" AlternatingItemStyle-BorderColor="#FFFFFF" 
        BorderColor="#C9C4D1" BorderWidth="1px" BorderStyle="Solid" 
        GridLines="None"> 
         
        <CommandItemTemplate>  
            <div style="text-align: right; padding: 8px;"> 
                <asp:Button ID="Button1" Text="Add Firm Location"  
                Runat="server" CommandName="InitInsert"></asp:Button>  
            </div> 
        </CommandItemTemplate>  
         
        <Columns> 
            <telerik:GridBoundColumn DataField="city" HeaderText="City"> 
            </telerik:GridBoundColumn> 
            <telerik:GridBoundColumn DataField="Country" HeaderText="Country"> 
            </telerik:GridBoundColumn> 
             
            <telerik:GridButtonColumn CommandName="Delete" Text="Delete" UniqueName="columnDelete" 
                ConfirmText="Are you sure you want to delete this record?"> 
            </telerik:GridButtonColumn> 
            <telerik:GridEditCommandColumn UniqueName="EditCommandColumn"> 
            </telerik:GridEditCommandColumn> 
        </Columns> 
         
        <EditFormSettings> 
         <!-- I have a custom edit form in here --> 
        </EditFormSettings> 
         
    </MasterTableView> 
 
    <ClientSettings> 
        <ClientEvents OnPopUpShowing="PopUpShowing" /> 
    </ClientSettings> 
</telerik:RadGrid> 


Here is my VB:

    Protected Sub gvFirmInfo_NeedDataSource(ByVal source As Object, ByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles gvFirmInfo.NeedDataSource 
        Dim sqlString As String = "" 
        Dim sqlparam(2) As SqlParameter 
        Dim ds As New DataSet 
        Dim dr As SqlDataReader = Nothing 
 
        Try 
            SetParam(sqlparam(0), "@recId", Data.SqlDbType.Int, 4, m_rec_id) 
            SetParam(sqlparam(1), "@recType", Data.SqlDbType.Char, 2, m_rec_type) 
 
 
            
                sqlString = "SELECT ... FROM..."  
 
            ds = SqlHelper.ExecuteDataset(Conn, Data.CommandType.Text, sqlString, sqlparam) 
 
 
            gvFirmInfo.DataSource = ds
 
 
        Catch ex As Exception 
 
        End Try 
 
    End Sub 


Most likely I have been ripping my hair out over something stupid.... any suggestions?



Drew
Top achievements
Rank 2
 answered on 14 Jan 2010
3 answers
131 views
Greetings.

We just a number of issues concerning using the scheduler in IE 6 as well as firefox 2.0
I'm wondering if these browsers are even supported at all?

There are issues rendering the calendar month view in IE where the day cells are not rendered properly until you switch views or force a refresh by changing the month.

Fireforx 2.0 also doesn't seem to want to render the start and end date controls and much of the css formatting of the recurrence panel is not good at all really.

Is there anything we can do to support these browsers?



thanks
towpse
Top achievements
Rank 2
 answered on 14 Jan 2010
2 answers
362 views
Hello-
I'm having an issue with the RadGrid ItemTemplate.

I'm using the RadGrid to display three items per page.  The RadGrid gives me the fexiblity to use the ItemTemplate as well as the PagerTemplate, etc.

My issue is the following:
Inside the RadGrid > MasterTableView > ItemTemplate i have html code.  Inside this html code i need to bind a control to a second data source.  When i try this my page doesn't show what i would expect to have rendered.  When i debug using Firebug i don't see the value being set, nor do i see the control being loaded.

Of note, the second SQLDatasource is taking the ArticleID from the RadGrid control to create the proper recordset.  Running this SQL statement against the database gives me the proper COUNT that i'm looking for.

    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:LionsConnectionString %>" 
        SelectCommand="SELECT ArticleTitle, ArticleContent, ArticleDateTime, ArticleID FROM tblLionsArticles ORDER BY ArticleDateTime DESC">  
    </asp:SqlDataSource> 
    <telerik:RadGrid ID="RadGrid2" runat="server" AllowPaging="True" DataSourceID="SqlDataSource1" 
        EnableEmbeddedSkins="False" GridLines="None" PageSize="3" ShowHeader="False" 
        OnItemCreated="RadGrid1_ItemCreated">  
        <HeaderContextMenu EnableEmbeddedSkins="False">  
        </HeaderContextMenu> 
        <MasterTableView DataSourceID="SqlDataSource1" DataKeyNames="ArticleID">  
            <ItemTemplate> 
                <div class="apost">  
                    <%# Convert.ToDateTime(Eval("ArticleDateTime"))>=(DateTime.Now.AddDays(-7)) ? "<div class='firstPost'></div>" : ""%> 
                    <div class="first">  
                    </div> 
                    <div class="inner">  
                        <div class="inner">  
                            <div class="media">  
                                <a href='articles/default.aspx?ArticleID=<%# DataBinder.Eval (Container.DataItem, "ArticleID") %>'>  
                                    <img alt="" height="199" src="http://site/image.jpg" 
                                        width="135" /></a>  
                            </div> 
                            <h2 id="post-181">  
                                <a href='articles/default.aspx?ArticleID=<%# DataBinder.Eval (Container.DataItem, "ArticleID") %>' 
                                    rel="bookmark" title='<%# DataBinder.Eval (Container.DataItem, "ArticleTitle") %>'>  
                                    <asp:Label ID="ArticleTitle" runat="server" Text='<%# DataBinder.Eval (Container.DataItem, "ArticleTitle") %>'></asp:Label> 
                                </a> 
                            </h2> 
                            <ul class="info">  
                                <li class="ptime">Posted on:  
                                    <asp:Label ID="ArticleDateTime" runat="server" Text=' <%#Convert.ToDateTime(DataBinder.Eval (Container.DataItem, "ArticleDateTime")).AddHours(3) %>'></asp:Label> 
                                </li> 
                                <li class="pcomm">Those Who Had Their Say:  
                                    <asp:SqlDataSource ID="SqlDataSource_FV1" runat="server" ConnectionString="<%$ ConnectionStrings:LionsConnectionString %>" 
                                        SelectCommand="SELECT COUNT(Art_Comment_Rating) AS 'Art_Comment_Rating_Count' FROM [tblLionsArticlesComments] WHERE ([ArticleID] = @ArticleID)">  
                                        <SelectParameters> 
                                            <asp:ControlParameter ControlID="RadGrid2" Name="ArticleID" PropertyName="SelectedValue" 
                                                Type="Empty" /> 
                                        </SelectParameters> 
                                    </asp:SqlDataSource> 
                                    <asp:DataList ID="DataList1" DataSourceID="SqlDataSource_FV1" runat="server">  
                                    <ItemTemplate> 
                                    <asp:Label ID="Greg" runat="server" Text='<%# DataBinder.Eval (Container.DataItem, "Art_Comment_Rating_Count") %>'></asp:Label> 
                                    </ItemTemplate> 
                                    </asp:DataList> 
                                </li> 
                            </ul> 
                            <div class="pmain">  
                                <!-- spost --> 
                                <asp:Label ID="ArticleContent" runat="server" Text='<%# Truncate(DataBinder.Eval (Container.DataItem, "ArticleContent")) %>'></asp:Label> 
                                <!-- epost --> 
                            </div> 
                            <ul class="pfoot">  
                                <li><a href='articles/default.aspx?ArticleID=<%# DataBinder.Eval (Container.DataItem, "ArticleID") %>'>  
                                    continue reading post Â»</a></li>  
                            </ul> 
                        </div> 
                    </div> 
                    <div class="second">  
                    </div> 
                </div> 
            </ItemTemplate> 
This is the start of the RadGrid and ends at the ItemTemplate.  As you can see i have a second SQLDataSource in the ItemTemplate and then i bind the value to a label.  

But when i execute this code it doesn't show up. I see the following from firebug:
iv id="ctl00_ContentPlaceHolder1_RadGrid2" class="RadGrid RadGrid_Default" tabindex="0">  
<table id="ctl00_ContentPlaceHolder1_RadGrid2_ctl00" class="rgMasterTable" cellspacing="0" border="0" style="width: 100%; table-layout: auto; empty-cells: show;">  
<colgroup> 
</colgroup> 
<thead> 
</thead> 
<tfoot> 
</tfoot> 
<tbody> 
<tr id="ctl00_ContentPlaceHolder1_RadGrid2_ctl00__0" class="rgRow">  
<td colspan="4">  
<div class="apost">  
<div class="first"> </div> 
<div class="inner">  
<div class="inner">  
<div class="media">  
</div> 
<h2 id="post-181">  
</h2> 
<ul class="info">  
<li class="ptime">  
</li> 
<li class="pcomm">Those Who Had Their Say: </li> 
</ul> 
<div class="pmain">  
</div> 
<ul class="pfoot">  
</ul> 
</div> 
</div> 
<div class="second"> </div> 
With the important part being:
<li class="pcomm">Those Who Had Their Say: </li> 
 
After the ":" i would expect to see my databinded label but i see nothing. I have tried with many different .NET controls that can be databinded...and nothing works.

Should i expect this to work?  How do i get this to work?  I have seen people nest Repeaters and Grids...but not sure about doing so inside and ItemTemplate.

Thanks,
Greg
 
Greg
Top achievements
Rank 1
 answered on 14 Jan 2010
1 answer
90 views
Hiya,
I do not know if DNN is a red herring or not.

I have an IList<CategoryInfo> of items which looks like this
 public class CategoryInfo 
    { 
 
        public int ModuleId{get; set;} 
        public int ItemId{get; set;} 
        public int CreatedByUser{get; set;} 
        public string Content { get; set; } 
        public DateTime CreatedDate{get; set;} 
        public string CategoryDescription{ get; set;} 
        public int? ParentId { get; set; } 
 
    } 

which I am trying to bind to a treeview using the following.

            var objCategories = new CategoryController(); 
             
            RadTreeView1.DataSource = objCategories.GetCategories(ModuleId);  
            RadTreeView1.DataTextField = "CategoryDescription"; 
            RadTreeView1.DataValueField = "ItemId"; 
            RadTreeView1.DataFieldParentID = "ParentId"; 
            RadTreeView1.DataBind(); 

my result set looks like this
ModuleId    itemId      CategoryDescription                                parentId  
----------- ----------- -------------------------------------------------- ----------
381         0                                                              NULL      
381         831         CraftyPatterns                                     0         
381         832         ClassicPatterns                                    0         
381         957         CreativePatterns                                   0         
381         1631        Textures                                           0         
381         1688        Themes                                             0         
381         1689        Animals                                            1688      
381         1700        DELETE TO TRASH                                    1688      
381         1705        Events                                             1688      
381         1738        Floral                                             1688      
381         1748        Gardening                                          1688      
381         1750        Holidays                                           1688      
381         1760        Music                                              1688      
381         1778        Shapes                                             1688      
381         1783        Sports                                             1688      
381         1794        Travel                                             1688      
381         1795        Par Avion                                          1794      
381         1784        Golf                                               1783      
381         1787        Soccer                                             1783      
381         1788        Soccer Kits                                        1787      
381         1789        All Red                                            1788      
381         1790        Blue                                               1788      
381         1791        Green Hoops                                        1788      
381         1792        Red                                                1788      
381         1793        White                                              1788      
381         1785        Golf Mad                                           1784      

but when I run the code it returns a flat tree, I am sure I am missing something but I can not fathom it out.

TIA
Richard

Dimitar Milushev
Telerik team
 answered on 14 Jan 2010
1 answer
143 views
Hi,

I have a radgrid in my aspx page and Reports button in the page. I want to do exporttoexcel() on button click of Reports button.

The values for the grid are binded during page_load.

<

 

script type="text/javascript">

 

var

 

_selectedRow;

 

 

 

var rowindex;

 

 

function grdResult_RowSelected(sender, args)

 

{

_selectedRow = $get(args.get_id());

 

rowindex = _selectedRow.sectionRowIndex;

 

var myAppKey = "<%= hdnradGridClickedRowIndex.ClientID %>";

 

 

document.getElementById(myAppKey).value = rowindex;

}
</script>

<

 

telerik:RadGrid ID="grdResult" runat="server" Width="1198px"

 

 

AllowMultiRowSelection="True" AllowSorting="True" Height="552px" style="margin-right: 1px" >

 

 

 

 

<MasterTableView Width="100%">

 

 

<Columns>

 

 

<telerik:GridClientSelectColumn UniqueName="SEL" Text="SEL"></telerik:GridClientSelectColumn>

 

 

</Columns>

 

 

</MasterTableView>

 

 

<ClientSettings>

 

 

<Scrolling AllowScroll="True" SaveScrollPosition="True"/>

 

 

<Resizing ClipCellContentOnResize="False" />

 

 

<Selecting AllowRowSelect="true" UseClientSelectColumnOnly="true" />

 

 

<ClientEvents OnRowContextMenu="grdResult_RowSelected" />

 

 

</ClientSettings>

 

</

 

telerik:RadGrid>

 


In my code behind I have the following code on Reports button click.

 

Private Sub btnReport_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnReport.Click

 

 

grdResult.ExportSettings.OpenInNewWindow = True

 

grdResult.ExportSettings.IgnorePaging =

True

 

grdResult.ExportSettings.Excel.Format = Telerik.Web.UI.GridExcelExportFormat.ExcelML

grdResult.MasterTableView.ExportToExcel()

 

End Sub

Please let me know what is wrong here. Exporttoexcel()  functionality is not working.

Thanks,
M.Raji

 

Daniel
Telerik team
 answered on 14 Jan 2010
8 answers
210 views
I'm having an issue with my menu.  To debug the issue, ...  I have removed it and recompiled; added a generic one in by hand and recompiled; and added my original back in and recompiled.  All of which have not given me my menu back in working order.  Adding a generic one in by hand was just as hosed as my current one.  I left on Friday and it was fine, come in on Monday and it was hosed. 
Here is my aspx code:
<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Master.master.cs" Inherits="PRSAdminTelerik.Pages.Master" %> 
<!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" > 
<head runat="server">  
    <title>PRS Administration</title> 
        <link href="../Includes/Default.css" type="text/css" rel="stylesheet" /> 
        <script language="javascript" src="../Includes/Default.js" type="text/javascript"></script>   
    <asp:ContentPlaceHolder ID="head" runat="server">  
    </asp:ContentPlaceHolder> 
</head> 
<body> 
  <form id="form1" runat="server">  
  <telerik:RadScriptManager ID="RadScriptManager1" runat="server"></telerik:RadScriptManager> 
  <img style="LEFT: 0px;POSITION: absolute; TOP: 0px" height="79" alt="" 
            src="..\images\hoover.jpg"/>  
    <div style="position:absolute;left:304px; top: 26px; height: 18px; width: 200px;">  
      <asp:Label ID="userLabel" runat="server" Text="Label" CssClass="TextReadOnly"></asp:Label> 
    </div> 
    <div> 
    <asp:Label ID="Label1" runat="server" Text="PRS Administration" 
      style="position:absolute;left:69px; top:18px; font-size:larger"></asp:Label> 
    <asp:Label ID="environmentLabel" runat="server"   
      style="LEFT:536px; POSITION: absolute; TOP:22px" Text="" CssClass="PageWarning"></asp:Label> 
    <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="http://ww2t.wapa.gov/sites/western/prshelp/Pages/default.aspx" 
      style="z-index:1;  position:absolute; top:26px; left:830px;">PRS Help</asp:HyperLink> 
    </div> 
      
      
    <div style="position:absolute; top:70; left:76; width:1000px; ">  
    <telerik:RadMenu ID="RadMenu1" runat="server"    
      style="z-index:1;  position:absolute; top: 53px; left: 59px;">  
    <Items> 
      <telerik:RadMenuItem Text="Home" runat="server" NavigateUrl="Default.aspx"></telerik:RadMenuItem> 
      <telerik:RadMenuItem Text="Accounts" runat="server">  
        <Items> 
          <telerik:RadMenuItem Text="Administer" runat="server" NavigateUrl="PlantAccountAdministration.aspx"></telerik:RadMenuItem> 
        </Items>                  
      </telerik:RadMenuItem> 
      <telerik:RadMenuItem Text="Construction Cost Trend" runat="server" > 
        <Items> 
          <telerik:RadMenuItem Text="Multiplier Update" runat="server" NavigateUrl="CostConstructionMultiplier.aspx"></telerik:RadMenuItem> 
        </Items>   
      </telerik:RadMenuItem> 
      <telerik:RadMenuItem Text="Interest Rates" runat="server">  
        <Items> 
          <telerik:RadMenuItem Text="Current" runat="server" NavigateUrl="InterestRatesCurrent.aspx"></telerik:RadMenuItem> 
        </Items> 
      </telerik:RadMenuItem> 
      <telerik:RadMenuItem Text="Power System" runat="server" NavigateUrl="PowerSystemAdministration.aspx"></telerik:RadMenuItem> 
      <telerik:RadMenuItem Text="Study" runat="server">  
        <Items> 
          <telerik:RadMenuItem Text="Administer" runat="server" NavigateUrl="StudyAdministration.aspx"></telerik:RadMenuItem> 
        </Items> 
      </telerik:RadMenuItem> 
      <telerik:RadMenuItem Text="Reports" runat="server" NavigateUrl="ReportAdministration.aspx"></telerik:RadMenuItem> 
      <telerik:RadMenuItem Text="Templates" runat="server">  
        <Items> 
          <telerik:RadMenuItem Text="Administer" runat="server" NavigateUrl="TemplateAdministration.aspx"></telerik:RadMenuItem> 
          <telerik:RadMenuItem Text="Master" runat="server" NavigateUrl="TemplateMaster.aspx"></telerik:RadMenuItem> 
        </Items> 
      </telerik:RadMenuItem> 
      <telerik:RadMenuItem Text="Users" runat="server">  
        <Items> 
          <telerik:RadMenuItem Text="Administer" runat="server" NavigateUrl="Default.aspx"></telerik:RadMenuItem> 
        </Items> 
      </telerik:RadMenuItem> 
    </Items> 
  </telerik:RadMenu> 
    </div> 
    <div> 
    <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">  
      
        
      
    </asp:ContentPlaceHolder> 
  </div> 
</form> 
</body> 
</html> 
 

The only behind code is this:
      if (!this.IsPostBack)  
      {  
        RadMenuItem item = RadMenu1.FindItemByUrl(Request.Url.PathAndQuery);  
        if (item != null)  
        {  
          item.HighlightPath();  
        }  
      } 

I've attached a pic to show you.

Should I be opening up a support ticket?

Thanks!
wen



Wendy Hunt
Top achievements
Rank 2
 answered on 14 Jan 2010
6 answers
509 views
Hi,

I am using RadDatePicker control to accept date of birth. The scenario is as follows:

My RadDatePicker control is in the dotnet datagrid (so each row will have its own instance of RadDatePicker).
There is another column in my datagrid named 'Age' which consists of normal textbox control. As per my business logic, I need to disable DateOfBirth if the age is entered and vice versa. I was trying to call javascript onblur of both the conrtols but couldn't do.

Below is my javascript code:

function disableAgeOrDOB(birthDate, age)
     {     
        if(birthDate.GetDate() != null && birthDate.GetDate()!= "")
        {
            age.disabled = true;
        }
        else if(age.value != null && age.value != "")
        {
            birthDate.DateInput.Enable() = false;
        }
     }

and here is markup:

<asp:DataGrid ID="dgTraveler" runat="server" AutoGenerateColumns="False" Width="100%"
                            HeaderStyle-CssClass="basic_textBold bg_lightorange" ItemStyle-HorizontalAlign="Center"
                            GridLines="Both" HeaderStyle-HorizontalAlign="Center">
                            <Columns>
<asp:TemplateColumn HeaderText="Date Of Birth (ddmmmyyyy)" HeaderStyle-Width="200px"
                                    HeaderStyle-HorizontalAlign="Right">
                                    <ItemTemplate>
                                        <telerik:RadDatePicker ID="dtBirthDatePicker" runat="server" MinDate="01-01-1900">
                                            <DateInput DisplayDateFormat="dd-MMM-yyyy">                                               
                                            </DateInput>
                                        </telerik:RadDatePicker>                                       
                                    </ItemTemplate>
                                </asp:TemplateColumn>
                                <asp:TemplateColumn HeaderText="Age" HeaderStyle-Width="60px">
                                    <ItemTemplate>
                                        <asp:TextBox runat="server" ID="txtAge" MaxLength="3" Width="50px" onkeypress="return AllowNumbersOnly();" />
                                    </ItemTemplate>
                                </asp:TemplateColumn>
 </Columns>
                        </asp:DataGrid>

Here is what I tried in ItemDataBound of datagrid in code behind:

RadDatePicker birthDate = (RadDatePicker)e.Item.FindControl( "dtBirthDatePicker" );
birthDate.DateInput.ClientEvents.OnBlur = string.Format( "disableAgeOrDOB('{0}','{1})'", birthDate.ClientID, age.ClientID);

I have also tried,

birthDate.DateInput.Attributes.Add("onblur", string.Format("disableAgeOrDOB('{0}','{1}');", birthDate.ID, age.ClientID));

I tried many other options also but couldn't succeed. I searched for posts but still didn't get any solution.

Can you please suggest any solution for it?



Pavlina
Telerik team
 answered on 14 Jan 2010
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?