Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
166 views

Hi,

I have a RadGrid in my page with "EnableHeaderContextMenu" set to true. 

 

I want to change the texts for the columns in the HeaderContextMenu.

With an older telerik version the code snippet below the function was working, now with the latest Version 2015.2.826.45 it doesn't work anymore.  

 

this.GridView.HeaderContextMenu.ItemClick += this.pContextMenu_ItemClick;

 

void HeaderContextMenu_PreRender(object sender, EventArgs e)
        {
            // Correct the column names for Context Menue
            Telerik.Web.UI.GridHeaderContextMenu pContextMenue = sender as Telerik.Web.UI.GridHeaderContextMenu;
            Telerik.Web.UI.RadMenuItem pColumnsContextMenu = pContextMenue.FindChildByValue<Telerik.Web.UI.RadMenuItem>("ColumnsContainer", true);
 
            foreach (Telerik.Web.UI.RadMenuItem pItem in pColumnsContextMenu.Items)
            {
                pItem.Text = _Regex.Replace(pItem.Text, String.Empty);
            }
        }

 

Kindly help us in solving this issue.

Regards, 

Miriam

Konstantin Dikov
Telerik team
 answered on 22 Sep 2015
1 answer
100 views
In IE 10 & 11, I am seeing an issue when trying to remove dates from a group of RadDatePicker controls.  When I remove the values from multiple controls and submit, a dropdown list is visible for the last control selected, for about one second.  When I go back to that particular record, the value is still persisted in that same last control I touched.  IE 9 does not exhibit this behavior.  Neither does Chrome or Firefox.   Our Telerik.Web.UI.dll version is 2010.2.826.35.
Konstantin Dikov
Telerik team
 answered on 22 Sep 2015
1 answer
159 views
Hello,
I am initializing the RadFIlter component from Server side.  After initializing, I am loading the collection list into the component. In the front end, whenever I am clicking on the item of the list, it works fine. There is a refresh interval timeout (5 seconds). After every 5 seconds, I am loading the values from the database on the front end grid.
So whenever I click on any Radfilter items after 5 seconds refresh interval, the error window appears which says "index was out of range. must be nonnegative and less than the size of the collection List". Within the 5 seconds interval, it works fine. It seems the values which I am loading on the server side are getting lost. 
I am performing the following steps;
1. On the page initialization, I am creating the Rad FIlter Component.
 this.ComplexFilter = new RadFilter()
                    {
                        ID = "ComplexFilter",
                           AllowFilterOnBlur = true,
                          ShowApplyButton = false,
                          Skin = "Vista",
                          EnableViewState = false
                                           
                    };
this.ComplexFilter.ItemCommand += this.ComplexFilter_OnItemCommand;
this.ComplexFilterPanel.ContentTemplateContainer.Controls.Add(this.ComplexFilter);
fieldEditor.FieldName = column.JsName; // column is the list of items. This I am doing for every column list item.
fieldEditor.DisplayName = column.Name;
 fieldEditor.DataType = column.Type;
this.ComplexFilter.FieldEditors.Add(fieldEditor);
 
var rootGroup = this.Settings.ComplexFilter_Expression;
 if (rootGroup != null)
                {
                    this.ComplexFilter.RootGroup.GroupOperation = rootGroup.GroupOperation;
                     foreach (var expression in rootGroup.Expressions)
                    {
                        this.ComplexFilter.RootGroup.AddExpression(expression);
                    }
                } 
                this.ComplexFilter.PreRender += this.ComplexFilter_OnPreRender;
  
void ComplexFilter_OnUpdate(object sender, EventArgs args)
        {
            string previousComplexFilterSql;
             string newComplexFilterSql; 
            if (this.Settings.ComplexFilter_Sql != null)
            {
                previousComplexFilterSql = this.Settings.ComplexFilter_Sql;
            }
            else
            {
                if (this.Settings.ComplexFilter_Expression != null)
                {
                    previousComplexFilterSql = this.Settings.ComplexFilter_Expression.ToWhere(this.TablesTable).ToString();
                }
                else
                {
                    previousComplexFilterSql = String.Empty;
                }
            } 
            if (this.Settings.ComplexFilter_Visible)
            {
                this.Settings.ComplexFilter_Expression = this.ComplexFilter.RootGroup;
 
                newComplexFilterSql = this.Settings.ComplexFilter_Sql = this.Settings.ComplexFilter_Expression.ToWhere(this.TablesTable).ToString();
            }
            else
            {
                newComplexFilterSql = String.Empty;
            } 
            this.ComplexFilter_ReloadData(previousComplexFilterSql, newComplexFilterSql); 
            ComplexFilter.RecreateControl(); 
        }
 
  2. After every 5 seconds Refresh timeout, I am checking for the complex filter saved settings. But due to the null value of ComplexFilter_Expression, settings could not be fetched from the database.
   if (this.ComplexFilter_Visible && this.ComplexFilter_Expression != null)
            {
                where &= this.ComplexFilter_Expression.GetDBWhere(table, joins, out saveSettings); 
            }
            else
            {
                saveSettings = false;
            }


I request to the Telerik expertise, to tell me what I am doing wrong. Why the Telerik object is getting lost due the front end refresh time interval.
Angel Petrov
Telerik team
 answered on 22 Sep 2015
1 answer
191 views
Hi Kevin, i need your help quickly about a similar problem :

http://www.telerik.com/forums/itemdatabound-even-in-batch-edit-mode-of-rad-grid

The combo​Box works with  static ​Web​Method enableLoadOnDemand=true, autopostback=false option under Radgrid BatchEdit in Row Edit mode.
When I add a new row with the Edit mode (EditItemTemplate > RadComboBox), I select a value in second line RadComboxBox and close editMode : the first ItemTemplate  takes the value of the second newly input.

The this a real problem

Scenario Step 1 :


Scenario Step 2 :


Scenario Step 3 :


Scenario Step 4 : the first field red line value should be 71886 but automatically change by 147244 ??


Can you give me some alternative or give me an issue for this problem .
Angel Petrov
Telerik team
 answered on 22 Sep 2015
3 answers
354 views
Dear All

I created a page method that return the result data source in json string format to bind the RadGrid:

[WebMethod]
public static string GetRows(int from, int len)
{
    DataTable dt =  MyEntity_BL.GetData();
 
    //convert DataTable into Json string
    System.Web.Script.Serialization.JavaScriptSerializer serializer = new System.Web.Script.Serialization.JavaScriptSerializer();
    List<Dictionary<string, object>> rows = new List<Dictionary<string, object>>();
    Dictionary<string, object> row = null;
 
    foreach (DataRow dr in dt.Rows)
    {
        row = new Dictionary<string, object>();
        foreach (DataColumn col in dt.Columns)
        {
            row.Add(col.ColumnName, dr[col]);
        }
        rows.Add(row);
    }
    return serializer.Serialize(rows);
}

and then i call the page method at client side at user button click:

function btnShowClientClick(clickedButton) {
 
    PageMethods.GetRows(0, 0, Succsess);
 
}
 
function Succsess(result) {
    var masterTable = $find("<%= grd.ClientID %>").get_masterTableView();
    masterTable.set_dataSource(result);
    masterTable.rebind();
}

The problem is that there no action done on the RadGrid ??
It doesn't bind any data!

Is there something miss ?

Thanks
Konstantin Dikov
Telerik team
 answered on 22 Sep 2015
1 answer
81 views

How can I restrict start date and end date in Gantt?

I want user to be unable to insert/update start date before 1 month.

I need server side code.

 

Thanks

Brian
Top achievements
Rank 1
 answered on 21 Sep 2015
6 answers
435 views

Hello

I've LinkButton in my RadComboBox ItemTemplate with CommandName OnCommand event and Command Argument for delete item if user clicking.

ComboBox populating with SqlDataSource. 

When trying to click second item in ComboBox page postabacking but doesnt raise onclick or even oncommand event. 

If clicking first item in ComboBox raising both of events but command argument is second items command argument. 

Where is the mistake?

Thanks is advance.

omer
Top achievements
Rank 1
 answered on 21 Sep 2015
1 answer
177 views

I am using a RadGrid element and need to export CSV data from it. When I place a link outside of the RadGrid element, the export works fine: 

<a title="Export" onserverclick="Export_CSV_Click" runat="server" class="icon-msexcelexport icon" href="#"></a>

<telerik:RadGrid ID="myGrid" runat="server" EnableViewState="false">

etc...

​

Now when I place that same link within the PagerTemplate, it no longer works and I get a javascript popup error.

<telerik:RadGrid ID="myGrid" runat="server" EnableViewState="false">

    <MasterTableView

        <PagerTemplate>

            <a title="Export" onserverclick="Export_CSV_Click" runat="server" class="icon-msexcelexport icon" href="#"></a>

 

 

And the export method..

protected void Export_CSV_Click(object sender, System.EventArgs e)

{

     myGrid.MasterTableView.ExportToCSV();

}

 

How would I get this button working from within the PagerTemplate?

 
 

 
 
 
 
 
 
 
 
 
Daniel
Telerik team
 answered on 21 Sep 2015
34 answers
857 views
hi,

i am very much impressed with telerik controls especially with radgrid.please let we know how can i copy data (rows,columns) from excel sheet and paste it to the rad grid


Thanks,
David
Top achievements
Rank 1
Iron
Iron
Veteran
 answered on 21 Sep 2015
1 answer
273 views

RadDateTimePicker is not working after ajax call, only if rad datetimepicker is open time of response back from server. i am also attaching ASPX and CS code

 Step to replicate.

  1. Create new page
  2. Add two datetimepicker
  3. add date change event
  4. Add Ajax panel
  5. put debug pointer on selecteddatechnage event
  6. select date from first datetimepicker
  7. now code will stop in break point
  8. now open second datetimepicker
  9. Go to CS page and Release code from debug point
  10.  Now open second datetimepicker
  11. Now date selection, Month selection will not work

Thanks,

 

 ASPX

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="TestRadDateTimePickerPostBack._Default" %>
<%@ 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">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
     <telerik:RadScriptManager ID="ScriptManager1" runat="server">
         <Scripts>
<asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js"></asp:ScriptReference>
<asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js"></asp:ScriptReference>
<asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js"></asp:ScriptReference>
</Scripts>
    </telerik:RadScriptManager>
    <telerik:radajaxmanager id="RadAjaxManager1" runat="server" 
        onajaxrequest="RadAjaxManager1_AjaxRequest">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="panel1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="panel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="panel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:radajaxmanager>
    
    <script language="javascript" type="text/javascript">

    <telerik:radscriptblock id="RadScriptBlock1" runat="server">
                function InitiateAjaxRequest() {
                    var ajaxManager = $find("<%= RadAjaxManager1.ClientID %>");
                    ajaxManager.ajaxRequest('RebindCard');
                }
                
                
                function Expensereport_PeriodFrom_OnDateSelected(sender, args) {
                    
                        InitiateAjaxRequest();
                }
                function Expensereport_PeriodTo_OnDateSelected(sender, args) {
                    InitiateAjaxRequest();
                }
                
    </telerik:radscriptblock>
    </script>
    
    
    <asp:Panel ID="panel1" runat="server">
        <div class="form-group form-group-sm">
            <asp:Label runat="server" CssClass="control-label col-sm-3 " ID="lbl_Expensereport_PeriodFrom"
                AssociatedControlID="Expensereport_PeriodFrom" Text="From"></asp:Label>
            <div class="col-sm-3 col-md-3">
                <telerik:raddatepicker id="Expensereport_PeriodFrom" runat="server" calendar-showrowheaders="false"
                    width="100%" cssclass="requiredText">
                                    <DateInput EnableSingleInputRendering="false" DateFormat="MM/dd/yyyy" DisplayDateFormat="MM/dd/yyyy"
                                        ReadOnly="true" SelectionOnFocus="CaretToBeginning" />
                                    <DatePopupButton  />
                                    <ClientEvents OnDateSelected="Expensereport_PeriodFrom_OnDateSelected" />
                                </telerik:raddatepicker>
            </div>
            <asp:Label runat="server" CssClass="control-label col-sm-2 col-md-2 col-lg-1 " ID="lbl_Expensereport_PeriodTo"
                AssociatedControlID="Expensereport_PeriodTo" Text="To"></asp:Label>
            <div class="col-sm-3 col-md-3">
                <telerik:raddatepicker id="Expensereport_PeriodTo" runat="server" width="100%" cssclass="requiredText"
                    calendar-showrowheaders="false">
                                    <DateInput EnableSingleInputRendering="false" DateFormat="MM/dd/yyyy" DisplayDateFormat="MM/dd/yyyy"
                                        ReadOnly="true" SelectionOnFocus="CaretToBeginning" />
                                    <DatePopupButton ToolTip="" />
                                    <ClientEvents OnDateSelected="Expensereport_PeriodTo_OnDateSelected" />
                                </telerik:raddatepicker>
            </div>
            <div class="clearBoth">
            </div>
        </div>
    </asp:Panel>
    </form>
</body>
</html>

 

 C#

protected void RadAjaxManager1_AjaxRequest(object sender, AjaxRequestEventArgs e)
        {

            for (int i = 1000; i <= 1000; i++)
            {
                i++;
            }
           
        }
​

Daniel
Telerik team
 answered on 21 Sep 2015
Narrow your results
Selected tags
Tags
+? more
Top users last month
Top achievements
Rank 1
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ivory
Top achievements
Rank 1
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
YF
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Top achievements
Rank 1
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ivory
Top achievements
Rank 1
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
YF
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?