Telerik Forums
UI for ASP.NET AJAX Forum
6 answers
492 views
Hi,
I am using two Rad grids on one of my page. There are some DateTimeColumns created for each of them for DateTime fields. Dates are displayed correctly in DateTime column. 
When I apply filter on DateTime column, it works in one grid but throws exception in another grid, although code is same for both. There is no custom filtering.

For both grids, DateTimeColumn is added programmatically as below:
-------------------------------------------------------------------------------------------------------------------------
GridDateTimeColumn boundColumn = new GridDateTimeColumn();

ProductsGrid.MasterTableView.Columns.Add(boundColumn);
boundColumn.PickerType = GridDateTimeColumnPickerType.DatePicker;
boundColumn.FilterControlWidth = Unit.Pixel(100);
boundColumn.HeaderStyle.Width = Unit.Pixel(110);
boundColumn.DataField = col.SystemName;
boundColumn.UniqueName = col.SystemName;
boundColumn.EnableTimeIndependentFiltering = true;
boundColumn.HeaderText = col.FriendlyName;
boundColumn.DataFormatString = "{0:dd/MM/yyyy}";
boundColumn.AutoPostBackOnFilter = true;
boundColumn.SortExpression = col.SystemName;

boundColumn.CurrentFilterFunction = GridKnownFunction.GreaterThanOrEqualTo;
boundColumn.ShowFilterIcon = true;

boundColumn.Display = col.Visible;
-------------------------------------------------------------------------------------------------------------------------

Exception I am getting while filtering by DateTime Column is :

-------------------------------------------------------------------------------------------------------------------------
Exception Type: Telerik.Web.UI.ParseException

Message: Neither of the types 'String' and 'DateTime' converts to the other

Stack Trace:
at
Telerik.Web.UI.ExpressionParser.GenerateConditional(Expression test,
Expression expr1, Expression expr2, Int32 errorPos)

at Telerik.Web.UI.ExpressionParser.ParseIif()

at Telerik.Web.UI.ExpressionParser.ParseIdentifier()

at Telerik.Web.UI.ExpressionParser.ParsePrimaryStart()

at Telerik.Web.UI.ExpressionParser.ParsePrimary()

at Telerik.Web.UI.ExpressionParser.ParseUnary()

at Telerik.Web.UI.ExpressionParser.ParseMultiplicative()

at Telerik.Web.UI.ExpressionParser.ParseAdditive()

at Telerik.Web.UI.ExpressionParser.ParseComparison()

at Telerik.Web.UI.ExpressionParser.ParseLogicalAnd()

at Telerik.Web.UI.ExpressionParser.ParseLogicalOr()

at Telerik.Web.UI.ExpressionParser.ParseExpression()

at Telerik.Web.UI.ExpressionParser.ParseParenExpression()

at Telerik.Web.UI.ExpressionParser.ParsePrimaryStart()

at Telerik.Web.UI.ExpressionParser.ParsePrimary()

at Telerik.Web.UI.ExpressionParser.ParseUnary()

at Telerik.Web.UI.ExpressionParser.ParseMultiplicative()

at Telerik.Web.UI.ExpressionParser.ParseAdditive()

at Telerik.Web.UI.ExpressionParser.ParseComparison()

at Telerik.Web.UI.ExpressionParser.ParseLogicalAnd()

at Telerik.Web.UI.ExpressionParser.ParseLogicalOr()

at Telerik.Web.UI.ExpressionParser.ParseExpression()

at Telerik.Web.UI.ExpressionParser.Parse(Type resultType)

at Telerik.Web.UI.DynamicExpression.ParseLambda(ParameterExpression[]
parameters, Type resultType, String expression, Object[] values)

at Telerik.Web.UI.DynamicExpression.ParseLambda(Type itType, Type resultType,
String expression, Object[] values)

at Telerik.Web.UI.GridDynamicQueryable.Where(IQueryable source, String
predicate, Object[] values)

at Telerik.Web.UI.GridDataTableFromEnumerable.FillData35()

at Telerik.Web.UI.GridDataTableFromEnumerable.FillData()

at Telerik.Web.UI.GridResolveEnumerable.Initialize()

at Telerik.Web.UI.GridResolveEnumerable.EnsureInitialized()

at Telerik.Web.UI.GridResolveEnumerable.get_DataTable()

at Telerik.Web.UI.GridEnumerableFromDataView..ctor(GridTableView owner,
IEnumerable enumerable, Boolean CaseSensitive, Boolean autoGenerateColumns,
GridColumnCollection presentColumns, String[] additionalField, Boolean
retrieveAllFields, Boolean enableSplitHeaderText)

at Telerik.Web.UI.GridDataSourceHelper.CreateGridEnumerable(GridTableView
owner, IEnumerable enumerable, Boolean caseSensitive, Boolean
autoGenerateColumns, GridColumnCollection presentColumns, String[]
additionalField, Boolean retrieveAllFields, Boolean enableSplitHeaderText)

at Telerik.Web.UI.GridDataSourceHelper.GetResolvedDataSource(GridTableView
owner, Object dataSource, String dataMember, Boolean caseSensitive, Boolean
autoGenerateColumns, GridColumnCollection presentColumns, String[]
additionalField, Boolean retrieveAllFields, Boolean enableSplitHeaderText)

at Telerik.Web.UI.GridTableView.get_ResolvedDataSource()

at Telerik.Web.UI.GridTableView.CreateControlHierarchy(Boolean useDataSource)

at Telerik.Web.UI.GridTableView.CreateChildControls(IEnumerable dataSource,
Boolean useDataSource)

at System.Web.UI.WebControls.CompositeDataBoundControl.PerformDataBinding(IEnumerable
data)

at
System.Web.UI.WebControls.DataBoundControl.OnDataSourceViewSelectCallback(IEnumerable
data)

at System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments,
DataSourceViewSelectCallback callback)

at System.Web.UI.WebControls.DataBoundControl.PerformSelect()

at Telerik.Web.UI.GridTableView.PerformSelect()

at System.Web.UI.WebControls.BaseDataBoundControl.DataBind()

at Telerik.Web.UI.GridTableView.DataBind()

at Telerik.Web.UI.GridTableView.Rebind()

at Telerik.Web.UI.GridFilterCommandEventArgs.ExecuteCommand(Object source)

at Telerik.Web.UI.RadGrid.OnBubbleEvent(Object source, EventArgs e)

at System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args)

at Telerik.Web.UI.GridItem.OnBubbleEvent(Object source, EventArgs e)

at System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args)

at Telerik.Web.UI.GridItem.OnBubbleEvent(Object source, EventArgs e)

at Telerik.Web.UI.GridItem.FireCommandEvent(String commandName, Object
commandArgument)

at Telerik.Web.UI.RadGrid.RaisePostBackEvent(String eventArgument)

at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl,
String eventArgument)

at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)

at System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

-------------------------------------------------------------------------------------------------------------------------

Can someone please let me know the reason for this exception?

Best Regards
Tushar
Eyup
Telerik team
 answered on 02 Sep 2014
3 answers
143 views
Hi,

I am using telerik version 2013.3.1324.35.  I tried to insert appointment without clicking any button. Please see attached image for example. It worked fine if I use tab key after I fill in data. I would like it to be save and show data in schedule when I click on another timeslot after I fill in data. 




 Thanks in advance.

Best regards,
Ei 
Ei Wai
Top achievements
Rank 1
 answered on 02 Sep 2014
1 answer
156 views
I would like a telerik tool not to place blank lines between sections of an editor when the user clicks the 'save' button.
I am new to working with Telerik tools.
I have an existing VB.net 2010 web application that uses telerik tools. This application has a user interface for the users to edit 'templates'. When you hit the save button on the application, blank lines are automatically inserted between various parts of a 'letter' that is being generated.

When the editor is being used, there are tabs for preview, html, and design.

I have gone into the 'html' editor to remove the extra <br></br> tags. However the same tags keep appearing. Thus I am wondering if you can tell me what I can do to keep the blank lines from appearing?

To help me, I thought I would show you some code that is being used so you can see where the telerik tool is being accessed;
​Imports System.Data
Imports System.Reflection
Imports System.Windows.Forms
Imports Telerik.Web.UIImports System.Web.Script.Services
Imports System.Web.Script.Serialization
Imports System.Web.Services
Partial Class edittemplates_default
    Inherits System.Web.UI.Page    Protected _master As MasterPage#Region "Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load"
    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load        _master = CType(Page.Master, MasterPage)
        _master.PageTitle = "Edit Templates"        If Not Page.IsPostBack Then
            If (SiteUserManager.SessionUser IsNot Nothing) Then                LoadTemplates()             
                LoadVariables()
             
            Else                'pnlEditor.Enabled = False
                'pnlEditor.Visible = False            End If
        End If        Master.Page.Title = "Login"    End Sub
#End Region#Region "Protected Sub LoadTemplates()"
    Protected Sub LoadTemplates()
        Dim et As EditTemplates = New EditTemplates()
        Dim dt As DataTable = et.SelectTemplates()        For i = 0 To dt.Rows.Count() - 1
            ddlTemplates.Items.Add(New ListItem(dt.Rows(i)(dt.Columns(1).ColumnName()), dt.Rows(i)(dt.Columns(0).ColumnName())))
        Next    End Sub
#End Region
#Region "Protected Sub LoadVariables()"
    Protected Sub LoadVariables()
        Dim et As EditTemplates = New EditTemplates()
        Dim dt As DataTable = et.SelectAtnLtrVariables()        For i = 0 To dt.Rows.Count() - 1
            rlbVariables.Items.Add(New RadListBoxItem(dt.Rows(i)(dt.Columns(1).ColumnName()), dt.Rows(i)(dt.Columns(0).ColumnName())))
        Next    End Sub
#End Region
#Region "Protected Sub btnSaveTemplate_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSaveTemplate.Click"
    Protected Sub btnSaveTemplate_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSaveTemplate.Click
        Dim et As EditTemplates = New EditTemplates()
        If ddlTemplates.SelectedValue <> 0 Then
            et.UpdateTemplate(ddlTemplates.SelectedValue, ddlLanguage.SelectedValue, rEditor.Content.ToString())
        End If
    End Sub
#End Region
Ianko
Telerik team
 answered on 02 Sep 2014
1 answer
118 views
Hello there.

I'm rather new to the telerik world so please bare with me.
C#, Asp.net.

Im currently having a RadGrid load my content from some DObjectDataSource.

Now i want to make my own insert template, with a asp textbox.
I've done this like so:

RadGrid > MasterTableView > Columns > GridTemplateColumn > InsertItemTemplate.

Within the InsertItemTemplate i have created a asp textbox:
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>

From my codebehind id like to be able to acess this to set it's value and later pull the value and save it to the database.

Is anyone able to make me a working example of getting the contents of a asp textbox from within the InsertItemTemplate? 
It would be much appriciated.

Thanks in advance.

Pavlina
Telerik team
 answered on 01 Sep 2014
6 answers
237 views
I have a radbutton on the right side of the page. When I click on it a vertical scroll bar briefly pops up and then the clientclicked function is called. The problem is that when I click on the right side of the image button the clientclicked function does not get called. When I click on the left it functions as planned. It seems the vertical scroll is forcing the button to move to the left putting the right side of the button out of range of the click.

here is a piece of code and attached are screenshots.
<telerik:RadButton ID="SettingsButton" runat="server" OnClientClicked="rWinSettingsOpen" AutoPostBack="false" Width="28" Height="28" BackColor="#25a0da">
                        <Image ImageUrl="~/images/settings.png" EnableImageButton="true" />
</telerik:RadButton>

Danail Vasilev
Telerik team
 answered on 01 Sep 2014
20 answers
643 views
my page structure looks like this:

<radajaxpanel> 
    <formview> 
         <targetcontrol id="abc123" /> 
         <radtooltip TargetControlID="abc123" ShowEvent="OnClick" 
                     HideEvent="ManualClose" RelativeTo="BrowserWindow" 
                     Position="Center" Animation="FlyIn" Modal="true"
              <radgrid> 
              </radgrid> 
         </radtooltip> 
    </formview> 
</radajaxpanel> 

When any kind of events in the radgrid (Paging, Filtering) the modal tooltip disappears.  Any ideas?


Fit2Page
Top achievements
Rank 2
Bronze
Iron
Iron
 answered on 01 Sep 2014
6 answers
428 views
Hi,

I'm using a Rad Grid Control in which I want to display a Rad Context Menu. The Javascript function supposed displaying the Rad Context Menu in RadGrid throws an error message as soon as "menu.Show(evt)" is executed. The error message is "Microsoft JScript runtime error: Object doesn't support property or method 'Show' ".
It seems that the javascript code does not recognize my RadMenu1 control.
Here is the code for the function I'm using:

<script type="text/javascript">
function RowContextMenu(index, e) {
document.getElementById("radGridClickedRowIndex").value = index;
 
var menu = $find("<%=RadMenu1.ClientID %>");
  var evt = e.get_domEvent();

menu.Show(evt);

e.cancelBubble = true;
e.returnValue = false;

if (e.stopPropagation) {
e.stopPropagation();
e.preventDefault();
}
this.SelectRow(this.Rows[index].Control, true);
}
</script>

Please, How do I fix this?
Thanks,
Eyup
Telerik team
 answered on 01 Sep 2014
1 answer
182 views
Hello, 

I have this in my aspx page:

<telerik:RadAutoCompleteBox
         ID="MyControl" runat="server" Width="400" DropDownHeight="150"
         DropDownWidth="500"
         SelectMethod="MySelectMethod"
         InputType="Text">
     </telerik:RadAutoCompleteBox>
   
          

In my code-behind, I have this:

01.Public Function MySelectMethod() As AutoCompleteBoxData
02.    Dim data As DataTable = GetChildNodes("a", "139")
03.    Dim result As New List(Of AutoCompleteBoxItemData)()
04. 
05.    For Each row As DataRow In data.Rows
06.        Dim childNode As New AutoCompleteBoxItemData()
07.        childNode.Text = row("field1").ToString()
08.        childNode.Value = row("field2").ToString()
09.        result.Add(childNode)
10.    Next
11. 
12.    Dim res As New AutoCompleteBoxData
13.    res.Items = result.ToArray()
14. 
15.    Return res
16.End Function
17. 
18.Private Function GetChildNodes(ByVal searchString As String, ByVal countryList As String) As DataTable
19.    ' Some code that works
20.End Function
21. 
22.Private Function GetData(selectCommand As SqlCommand) As DataTable
23.    ' Some code that works
24.End Function



MySelectMethod is returning the records that I am expecting, given that the parameters are hardcoded. However this are the problems that I encounter:

1) The list of records is not appearing. 
2) My text-input goes away after getting the list of records
3) MyControl.Text property is empty

Anyhelp on this one? I badly need specifically #3 since it is a parameter that I need to pass dynamically. 









Nencho
Telerik team
 answered on 01 Sep 2014
1 answer
148 views
I have a situation where RadMenu, sometimes, on page load shows completely malformed for a split second, after which it shows and works properly. It does not happen all the times, it is most pronounced on new page load (not from cache), but it may happen even when all resources are pulled from local cache.
The RadMenu item is actually inside a Table element, in an include file, used by multiple pages, yet this problem appears exclusively on one specific page

I have recorded the screen and extracted what the menu looks like at the split second when it is malformed. It is big enough to be annoying even though it does not happen all the times. I have also attached what it looks like when it is properly rendered, for comparison.

How do I go about finding what is causing the problem?
Magdalena
Telerik team
 answered on 01 Sep 2014
2 answers
340 views
Hi Admin!
I have a proplem with RadAjaxManager. I have a usercontrol in Webpage. Webpage use tempalte MasterPager. When i press Button SendComment in UC. Page reload again. Can you show me a method to  solve this problem
Usercontrol ASPX:
  <telerik:RadAjaxManagerProxy ID="uxRadAjaxManager" runat="server" EnableViewState="False">        
        <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="bt_sencomments">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="commentsContainer" LoadingPanelID="uxLoadingPanel" />
            </UpdatedControls>
        </telerik:AjaxSetting>           
    </AjaxSettings>    
    </telerik:RadAjaxManagerProxy>  
  <div id="commentsContainer">              
       <telerik:RadListView ID="RadListViewContainer" runat="server">
        <ItemTemplate>            
                    <div class="commentWrapper">
                        <img alt="avatar" src='<%#ProcessingImage((byte[])Eval("ProfilePicture"))  %>'>
                        <span>
                            <strong>From: </strong><%# Eval("FullName")%> - <%#Eval("CreatedDate")%>                            
                        </span>
                        <div class="commentContent">
                            <%# Eval("CommentContent")%>
                        </div>
                    </div>
                </ItemTemplate>           
           </telerik:RadListView>
         
        </div>
        <div>          
            <p style="margin-left: 10px;"><b>Leave a comment</b> </p>
            <div class="commentForm">
                <textarea cols="50" rows="10" runat="server" placeholder="Enter your comment here..."
                    id="commentField"></textarea>
                <br />
                <asp:Button   ID="bt_sencomments" Text="Send Comments"  OnClick="bt_sencomments_Click" OnClientClick="return validate();"
                    runat="server"></asp:Button>
                  
                

            </div>
        </div>
Mywebpage:


<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeBehind="ArticleDetail.aspx.cs" Inherits="ICSCMWA.News.ArticleDetail" %>

<%@ Register Src="~/UC/ArticleViewDetails.ascx" TagPrefix="uc1" TagName="ArticleViewDetails" %>


<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    
     <link rel="stylesheet" type="text/css" href="../Styles/ViewArticleDetail.css">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
      
    <uc1:ArticleViewDetails runat="server" id="UCViewDeteail" NewsId="0"/>
</asp:Content>
<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeBehind="ArticleDetail.aspx.cs" Inherits="ICSCMWA.News.ArticleDetail" %>

<%@ Register Src="~/UC/ArticleViewDetails.ascx" TagPrefix="uc1" TagName="ArticleViewDetails" %>


<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    
     <link rel="stylesheet" type="text/css" href="../Styles/ViewArticleDetail.css">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
      
    <uc1:ArticleViewDetails runat="server" id="UCViewDeteail" NewsId="0"/>
</asp:Content>

My masterpage:
<telerik:RadAjaxManager ID="uxRadAjaxManager" runat="server" EnableAJAX="true" DefaultLoadingPanelID="uxLoadingPanel">
<%--<ClientEvents OnRequestStart="requestStart" OnResponseEnd="responseEnd" />--%>
</telerik:RadAjaxManager>         
<telerik:RadAjaxLoadingPanel ID="uxLoadingPanel" EnableAjaxSkinRendering="true" runat="server" RegisterWithScriptManager="true" Skin="Silk">

</telerik:RadAjaxLoadingPanel>


Konstantin Dikov
Telerik team
 answered on 01 Sep 2014
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?