Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
378 views
Previous Question

I am trying to validate date in server side. When I am trying to pass invalid date to my server side code, it is getting converted to {01/01/0001 00:00:00}.

Works fine when I select proper date.

Here is my code:

<telerik:RadDatePicker ID="rdpDob" runat="server" AutoPostBack="true"   DateInput-EmptyMessage="MaxDate" MinDate="01/01/1000"MaxDate="01/01/3000">

When I try to access the date value:
rdpDob.SelectedDate

It is returning as null.

Which is quiet strange as I can see my invalid date being passed in the POST request.

Whats wrong with what I am doing, Is there any property which I need to tweek??

Thanks.

Shinu
Top achievements
Rank 2
 answered on 28 May 2014
2 answers
152 views
Hi,
I am trying to export RADHtml Chart to PDF using the inkscape as suggested in one of the telerik blogs,but when I export a Radhtml chart which is having special characters like '^,~' I am unable to see the complete text after export,you can find this from attached document which contains two files one shows the chart before export and other is after exporting , so can you please let me know how to export with out these truncations in text (In the attached files the row data is being truncated).

Thanks,
Sukumar.
Chary
Top achievements
Rank 1
 answered on 28 May 2014
1 answer
264 views
Hi,

is it possible to add radcombobox to div in runtime?

For example I use:
$('#' + '<%= pnlValues.ClientID %>').append('<label for="tbClientName" class="ClientMatterTitle">Client:</label><input class="ClientMatterValue" type="text" id="tbClientName" maxlength="256" />');

in order to add label and textbox.

I tried to do the same with:

$('#' + '<%= pnlValues.ClientID %>').append('<telerik:RadComboBox ID="RadComboBox4" runat="server" Width="250px" Height="150px" EmptyMessage="Select a Company" EnableLoadOnDemand="true" ShowMoreResultsBox="true" EnableVirtualScrolling="true" Label="Page Methods:"></telerik:RadComboBox>')

but it doesn't work (throws a javascript error). Is it possible to do something like this?









Princy
Top achievements
Rank 2
 answered on 28 May 2014
1 answer
142 views
We have formatted telerik grid using javascript for design purpose, due to which grid line issue arises. If we remove the javascript gridline issue will be solved but telerik grid design will changed drastically & some of functionality will not work correctly.Please Suggest.
Angel Petrov
Telerik team
 answered on 28 May 2014
1 answer
75 views
Hello,

I would like to double click on a time slot in the scheduler and show my own popup with the Telerik Window control to add an appointment and add it by code to show. I saw code for adding an appointment by code which is good. But I have two questions. In the click event can I tell it so show my window instead of the one built in the scheduler? If so, can I get the date and time for the slot clicked so I can set that as default?

Thanks,

Warren
Nencho
Telerik team
 answered on 28 May 2014
6 answers
91 views
Hi,

I am trying to solve this problem since 2days but unable to do.

I am having a radgrid with edit link radbutton, when I click edit button then radwindow will open with rad tree containing some images from local folder and radeditor with data when I drag and drop the image from tree to editor java script error is coming. I have used update panel with radwindow  inside it. 

function isMouseOverEditor(editor,event){


return $telerik.isMouseOverElementEx(editor.get_contentAreaElement(),event)

}




I am getting the error inside the the above javascript. After lots of efforts I found that the above javascript is not getting the id of the rad editor
Ianko
Telerik team
 answered on 28 May 2014
1 answer
169 views
Hi,

We're upgrading our web application from Telerik 2010 to 2014. 
After replacing the DLL files as instructed by Telerik, one functionality seems to broken.
We have a RadTreeView inside a RadPane:

<telerik:RadPane ID="RadPane1" runat="server" Width="14%" Scrolling="Y">
            <telerik:RadTreeView ID="RadTreeViewSideNav" runat="server" TabIndex="1"
                AccessKey="T" AllowNodeEditing="false" ShowLineImages="false"
                OnClientContextMenuItemClicked="RadTreeViewSideNav_ClientContextMenuItemClicked"
                OnClientMouseOut="RadTreeViewSideNav_ClientMouseOut"
                OnClientMouseOver="RadTreeViewSideNav_ClientMouseOver"
                OnClientLoad="RadTreeViewSideNav_ClientLoad"
                OnClientNodeEditing="RadTreeViewSideNav_ClientNodeEditing"
                OnClientNodeClicking="RadTreeViewSideNav_ClientNodeClicking"
                OnClientNodeEditStart="RadTreeViewSideNav_ClientNodeEditStart"
                OnNodeEdit="RadTreeViewSideNav_NodeEdit"
                OnNodeClick="RadTreeViewSideNav_NodeClick">
                <ContextMenus>
                    <telerik:RadTreeViewContextMenu ID="RadTreeViewContextMenuEmpty" runat="server">
                        <CollapseAnimation Duration="20" Type="OutQuint" />
                    </telerik:RadTreeViewContextMenu>
                    <telerik:RadTreeViewContextMenu ID="MainContextMenu" runat="server">
                        <CollapseAnimation Duration="200" Type="OutQuint" />
                    </telerik:RadTreeViewContextMenu>
                    <telerik:RadTreeViewContextMenu ID="MainContextMenu2" runat="server">
                        <CollapseAnimation Duration="200" Type="OutQuint" />
                    </telerik:RadTreeViewContextMenu>
                    <telerik:RadTreeViewContextMenu ID="RadTreeViewContextMenuContact" runat="server">
                        <CollapseAnimation Duration="200" Type="OutQuint" />
                    </telerik:RadTreeViewContextMenu>
                    <telerik:RadTreeViewContextMenu ID="RadTreeViewContextMenuContact1" runat="server">
                        <CollapseAnimation Duration="200" Type="OutQuint" />
                    </telerik:RadTreeViewContextMenu>
                    <telerik:RadTreeViewContextMenu ID="RadTreeViewContextMenuContact2" runat="server">
                        <CollapseAnimation Duration="200" Type="OutQuint" />
                    </telerik:RadTreeViewContextMenu>
                </ContextMenus>
                <CollapseAnimation Duration="100" Type="OutQuint" />
                <ExpandAnimation Duration="100" />
            </telerik:RadTreeView>
            <telerik:RadToolTip ID="tt1" runat="server" Position="BottomRight" Width="170px" Height="20px" Animation="None" Modal="false" ShowCallout="false" AutoCloseDelay="10000">
                <span id="mails" class="formlabel"></span>
                <div id="spanSound"></div>
            </telerik:RadToolTip>
        </telerik:RadPane>

Clicking on the menus of the RadTreeView is supposed to rebind a RadGrid inside another RadPane (separated from the one hosting the
RadTreeView).

Initially, I was receiving this error upon click:
   Uncaught TypeError: Cannot read property 'oldUpdatePanelIDs' of undefined

After searching around, I found out here that removing the RadCompression from web.config may resolve the issue. So I did so.

But now I am having another problem (I am pasting from Google Chrome Developer Tools console log so you know the full error):

Sys.WebForms.PageRequestManagerParserErrorException: Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed. Common causes for this error are when the response is modified by calls to ...<omitted>...'. Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=ctl00_scm_TSM&compress=1&_TSM_CombinedScripts_=%3b…:6
 
   Error.createTelerik.Web.UI.WebResource.axd?_TSM_HiddenField_=ctl00_scm_TSM&compress=1&_TSM_CombinedScripts_=%3b…:6
   Sys.WebForms.PageRequestManager._createPageRequestManagerParserErrorTelerik.Web.UI.WebResource.axd?_TSM_HiddenField_=ctl00_scm_TSM&compress=1&_TSM_CombinedScripts_=%3b…:15
   Sys.WebForms.PageRequestManager._parseDeltaTelerik.Web.UI.WebResource.axd?_TSM_HiddenField_=ctl00_scm_TSM&compress=1&_TSM_CombinedScripts_=%3b…:15
   Sys.WebForms.PageRequestManager._onFormSubmitCompletedTelerik.Web.UI.WebResource.axd?_TSM_HiddenField_=ctl00_scm_TSM&compress=1&_TSM_CombinedScripts_=%3b…:15
   (anonymous function)Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=ctl00_scm_TSM&compress=1&_TSM_CombinedScripts_=%3b…:6
   (anonymous function)Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=ctl00_scm_TSM&compress=1&_TSM_CombinedScripts_=%3b…:6
   Sys.Net.WebRequest.completedTelerik.Web.UI.WebResource.axd?_TSM_HiddenField_=ctl00_scm_TSM&compress=1&_TSM_CombinedScripts_=%3b…:6
   _onReadyStateChange

Any suggestion is appreciated.
Regards.

Radoslav
Telerik team
 answered on 28 May 2014
3 answers
205 views
Hello Telerik,

I have a small issue and maybe you can help me. I have a form where user enters the info. What i want is to convert the html document into pdf on button click without saving the entered info by the user into the database. Can you tell which telerik tool should i use in this case? Thank you. 

here is a simplified version of the form:

<div>
        <asp:Label ID="Label1" runat="server" Text="Label">Please enter your name:</asp:Label><br />
        <br />
        <asp:Label ID="Label4" runat="server" Text="Label">name: </asp:Label>
        <asp:TextBox ID="txtName" runat="server"></asp:TextBox>
        <br />
        <br />
        <asp:Label ID="Label2" runat="server" Text="Label"> Please enter your last name:</asp:Label><br />
        <br />
        <asp:Label ID="Label3" runat="server" Text="Label">lastname:</asp:Label>
        <asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
        <br />
        <br />
        <asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click" />
    </div>


Ianko
Telerik team
 answered on 28 May 2014
4 answers
203 views
Hi,

I would like to set a default group on a rad grid but not allow users to change it. Therefore, I do not want to see the group panel at the top of the grid but still display the actual grouping row in the grid itself. (I hope that is clear!) 

This is what I currently have:

                <telerik:RadGrid ID="rgAdditionalPermissions" runat="server" DataSourceID="odsAdditionalPermissions" GroupingEnabled="true" ShowGroupPanel="false" ClientSettings-AllowDragToGroup="false">
                    <GroupingSettings ShowUnGroupButton="false" />
                    <GroupPanel Enabled="false"></GroupPanel>
                    <MasterTableView AutoGenerateColumns="False" DataSourceID="odsAdditionalPermissions" DataKeyNames="RightId">
                        <CommandItemSettings ExportToPdfText="Export to PDF" />
                        <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
                            <HeaderStyle Width="20px" />
                        </RowIndicatorColumn>
                        <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column">
                            <HeaderStyle Width="20px" />
                        </ExpandCollapseColumn>
                        <GroupByExpressions>
                            <telerik:GridGroupByExpression>
                            <SelectFields>
                                <telerik:GridGroupByField FieldName="RightCategoryName" HeaderText="Category" />
                            </SelectFields>
                            <GroupByFields>
                                <telerik:GridGroupByField FieldName="RightCategoryName" SortOrder="Descending" />
                            </GroupByFields>
                            </telerik:GridGroupByExpression>
                        </GroupByExpressions>
                        <Columns>
                            <telerik:GridBoundColumn DataField="RightName" FilterControlAltText="Filter RightName column" HeaderText="Permission" SortExpression="RightName" UniqueName="RightName">
                            </telerik:GridBoundColumn>
                            <telerik:GridTemplateColumn>
                                <ItemTemplate>
                                    <asp:CheckBox ID="chkSelected" runat="server" Checked='<%# Bind("Active") %>'/>
                                </ItemTemplate>
                            </telerik:GridTemplateColumn>
                        </Columns>
                        <EditFormSettings>
                            <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                            </EditColumn>
                        </EditFormSettings>
                    </MasterTableView>
                    <FilterMenu EnableImageSprites="False">
                    </FilterMenu>
                    <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default">
                    </HeaderContextMenu>

                </telerik:RadGrid>




If I want the rows of the Grid to be grouped then I have to set GroupingEnabled="true" but despite setting all others, like ShowGroupPanel to false, it still displays the group panel. 

Is it possible to do what I would like RadGrid to do? And if so do you know how I would go about implementing it?

Kind regards
Sidharth


Shinu
Top achievements
Rank 2
 answered on 28 May 2014
2 answers
410 views
Hi

On page load I want to set one of the custom filters if querystring has a value.  I am getting an exception (no items in collection) in my CombineFilters method on line

GridFilteringItem filterItem = grdParts.MasterTableView.GetItems(GridItemType.FilteringItem)[0] as GridFilteringItem;

I believe this is mostly about the order I am doing things in (page load running before filter pre render event) 
but I am not sure how to modify the code to get this working. 

Code attached below

Check QueryString, if company passed in have the filter preselected
protected void Page_Load(object sender, EventArgs e)
{
    if (!Page.IsPostBack)
    {
        BindGrid();
    }
 
    //if (querystring has value)
    //{
        ViewState["CompanyFilterVal"] = "123";
        CombineFilters();
    //}
}

Setting the filter dropdown values on grid item created event
//Item created - binding data to custom company filter 
protected void grdParts_ItemCreated(object sender, Telerik.Web.UI.GridItemEventArgs e)
{
    if (e.Item is GridFilteringItem)
    {
        try
        {
            using (MyEntities db = new MyEntities())
            {
                //Set options for the filter controls
                GridFilteringItem filterItem = (GridFilteringItem)e.Item;
 
                RadComboBox CompanyCbo = (RadComboBox)filterItem["Company"].FindControl("cboFilterCompany");
                BindCompanyFilterData(db, CompanyCbo);
 
                //...other filters
        }
        catch (Exception ex)
        {
            ...
        }
    }
}

setting selected value on filter pre render event. 
protected void cboFilterCompany_PreRender(object sender, EventArgs e)
{
    RadComboBox combo = sender as RadComboBox;
    if (ViewState["CompanyFilterVal"] != null)
        combo.SelectedValue = ViewState["CompanyFilterVal"].ToString();
    else
        combo.ClearSelection();
}

method inspects all filters for value and sets grid filter based on filters
protected void CombineFilters()
{
    string filterToApply = "";
    List<string> filtexprn = new List<string>();
 
    ClearFilterFromViewState();
 
    GridFilteringItem filterItem = grdParts.MasterTableView.GetItems(GridItemType.FilteringItem)[0] as GridFilteringItem;
 
    //COMPANY
    RadComboBox cboCompany = (RadComboBox)filterItem.FindControl("cboFilterCompany");
    if (cboCompany.SelectedIndex != -1)
    {
        if(cboCompany.SelectedValue != "All")
        {
            filtexprn.Add("([Company] ='" + cboCompany.SelectedValue + "')");
            ViewState["CompanyFilterVal"] = cboCompany.SelectedValue; //to persist value on postback
        }
    }
 
    //...
     
    //SITE
    RadComboBox cboSite = (RadComboBox)filterItem.FindControl("cboFilterSite");
    if (cboSite.SelectedIndex != -1)
    {
        if (cboSite.SelectedValue != "All")
        {
            filtexprn.Add("([Site] ='" + cboSite.SelectedValue + "')");
            ViewState["SiteFilterVal"] = cboSite.SelectedValue; //to persist value on postback
        }
    }
 
    int count = filtexprn.Count - 1;
    foreach (string s in filtexprn)
    {
        filterToApply += s;
        if (count-- != 0)
            filterToApply += " AND ";
    }
 
    grdParts.MasterTableView.FilterExpression = filterToApply;
    grdParts.MasterTableView.Rebind();
}

grid aspx code
<telerik:RadGrid ID="grdParts" runat="server"
    OnItemCreated="grdParts_ItemCreated"
    OnItemDataBound="grdParts_ItemDataBound"
    OnItemCommand="grdParts_ItemCommand"
    OnNeedDataSource="grdParts_NeedDataSource"
    AllowFilteringByColumn="true" AllowSorting="true"
    AllowPaging="True" PageSize="15" EnableLinqExpressions="false"
    AllowMultiRowSelection="true">
    <PagerStyle AlwaysVisible="true"></PagerStyle>
    <MasterTableView AutoGenerateColumns="False" DataKeyNames="UniquePartID" ClientDataKeyNames="UniquePartID"
        Width="100%" CommandItemDisplay="None" PageSize="15">
        <Columns>
            <telerik:GridBoundColumn DataField="UniquePartID" HeaderText="UniquePartID" ReadOnly="True"
                SortExpression="UniquePartID" UniqueName="UniquePartID" Display="false">
            </telerik:GridBoundColumn>
 
            <telerik:GridBoundColumn DataField="Company" HeaderText="CONO" SortExpression="Company" UniqueName="Company" FilterControlAltText="Filter Company column"
                ItemStyle-Width="4%" HeaderStyle-Width="4%" AllowFiltering="true" AllowSorting="true">
                <FilterTemplate>
                    <telerik:RadComboBox runat="server" ID="cboFilterCompany" AutoPostBack="false"
                        OnPreRender="cboFilterCompany_PreRender"
                        DataValueField="CompanyID" DataTextField="CompanyDescription"
                        Width="100%">
                    </telerik:RadComboBox>
                </FilterTemplate>
            </telerik:GridBoundColumn>
 
            <telerik:GridBoundColumn DataField="Site" HeaderText="Site" SortExpression="Site" UniqueName="Site" FilterControlAltText="Filter Site column"
                ItemStyle-Width="6%" HeaderStyle-Width="6%" AllowFiltering="true" AllowSorting="true">
                <FilterTemplate>
                    <telerik:RadComboBox runat="server" ID="cboFilterSite" AutoPostBack="false"
                        OnPreRender="cboFilterSite_PreRender"
                        DataValueField="SiteDesc" DataTextField="SiteDesc"
                        Width="100%">
                    </telerik:RadComboBox>
                </FilterTemplate>
            </telerik:GridBoundColumn>
 
            ...
 
        </Columns>
    </MasterTableView>
    <ClientSettings>
        <Selecting AllowRowSelect="true"></Selecting>
        <ClientEvents OnRowDblClick="RowDblClick"></ClientEvents>
    </ClientSettings>
    <GroupingSettings CaseSensitive="false" />
</telerik:RadGrid>
Kostadin
Telerik team
 answered on 28 May 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?