Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
297 views
My data is being shown in RadGrid. i am trying to export data in Excel. Properties are set for the RadGrid
like
        rdGridCustomer.ExportSettings.FileName = "MyDataFile";
        rdGridCustomer.ExportSettings.ExportOnlyData = true;
        rdGridCustomer.ExportSettings.IgnorePaging = false ;
        rdGridCustomer.ExportSettings.OpenInNewWindow = true;
        rdGridCustomer.ExportSettings.Excel.FileExtension = "xls";
        rdGridCustomer.ExportSettings.Excel.Format = Telerik.Web.UI.GridExcelExportFormat.Html;

event on that Excel is being exported.
 protected void btnExport_Click(object sender, EventArgs e)
    {
       
        rdGridCustomer.MasterTableView.ExportToExcel();     
    }
   event of Radgrid that is generated error
   Index was outside the bounds of the array.
when below event is fired after btnExport_Click event error occurs. It occurs only when
rdGridCustomer.MasterTableView.ExportToExcel();     this code of line exceuted.
 protected void rgModuleGrid_PreRender(object sender, EventArgs e)
      {
          // Institute Maximum Page Size for Main Grid
          GridPagerItem pagerItem = (GridPagerItem)rdGridCustomer.MasterTableView.GetItems(GridItemType.Pager)[1];
          on this above bold line error occures.
          RadNumericTextBox textBox = (RadNumericTextBox)pagerItem.FindControl("ChangePageSizeTextBox");
       }
please give me solution.
Thanks.
Princy
Top achievements
Rank 2
 answered on 22 Mar 2011
1 answer
195 views
I'm using the U.S. calendar format convention, but was wondering if I can change the order in which the week appears in my calendars.  Right now it appears as Sunday, Monday,...Saturday.  I was wondering if there is a setting to start the week at Monday and have it finish on Sunday.  I have an application which is based on a weekday and weekend times, so it would help to be able to see the calendar is the same format.

Thanks
Shinu
Top achievements
Rank 2
 answered on 22 Mar 2011
2 answers
232 views

Hi there,

I'm loading a RadGrid with AutoGenerateColumns="true", for databinding I'm using NeedDataSource(...) event handler. Since I want to format values from some columns I use the ColumnCreated(...) event handler. I also want to do some Aggregation based on  the type of column. For this, I have the following helper method:

public static void ColumnCreated(object sender, Telerik.Web.UI.GridColumnCreatedEventArgs e)
        {
           
            if(!string.IsNullOrEmpty(e.Column.UniqueName))
            {
                GridBoundColumn gbc = e.Column as GridBoundColumn;

                if (gbc != null)
                {
                    gbc.HeaderStyle.HorizontalAlign = HorizontalAlign.Center;

                    gbc.HeaderText = gbc.UniqueName.ToUpper() == "EXPANDCOLUMN" ? string.Empty : gbc.UniqueName;

                    switch (gbc.DataTypeName.ToUpper())
                    {
                        case "SYSTEM.DATETIME":
                            gbc.DataFormatString = "{0:d}";
                            break;
                        case "SYSTEM.DECIMAL":
                            gbc.DataFormatString = "{0:N2}";
                            gbc.Aggregate = GridAggregateFunction.Sum;
                            gbc.ItemStyle.HorizontalAlign = HorizontalAlign.Right;
                            gbc.FooterStyle.HorizontalAlign = HorizontalAlign.Right;
                            break;
                    }
                }               
            }
        }

But when this event fires something real "weird" is happening. I keep getting the following error:

Microsoft JScript runtime error:
Sys.WebForms.PageRequestManagerServerErrorException: cannot find column [xxxxxx].

When I mean "weird" is that such column does exist!.

On the other hand, when I comment out the logic inside ColumnCreated(...) event, the error does not show up. But as you might expect... the values are not formatted as well as there is no Aggregation on the columns that I want, and I do really want the event to fire since I need to do some formatting on the values of certain columns.

Thanks in advance,

Felix


Today, I tried a different approach.  This time I used the ItemDataBound(...) event.

The code now is as follows:

protected void gvwOperaciones_ItemDataBound(object sender, GridItemEventArgs e)
    {
        if(e.Item.ItemType == GridItemType.AlternatingItem ||
            e.Item.ItemType == GridItemType.Item)
        {
            int colIndex = 0;
            DataRowView drv = e.Item.DataItem as DataRowView;

            foreach (DataColumn dc in drv.DataView.Table.Columns)
            {
                GridDataItem gdi = e.Item as GridDataItem;
                switch (dc.DataType.ToString().ToUpper())
                {
                    case "SYSTEM.DATETIME":
                        gdi[dc.ColumnName].Text = string.Format("{0:d}", drv[dc.ColumnName]);                       
                        break;
                    case "SYSTEM.DECIMAL":
                        gdi[dc.ColumnName].Text = string.Format("{0:N2}", drv[dc.ColumnName]);
                        GridBoundColumn gbc = gvwOperaciones.MasterTableView.AutoGeneratedColumns[colIndex] as GridBoundColumn;
                        if(gbc != null)
                            gbc.Aggregate = GridAggregateFunction.Sum;
                        break;
                    default:
                        break;
                }
                colIndex++;
            }
        }
    }


But something interesting again!!!, this time if I comment out the lines:

GridBoundColumn gbc = gvwOperaciones.MasterTableView.AutoGeneratedColumns[colIndex] as GridBoundColumn;
if(gbc != null)
    gbc.Aggregate = GridAggregateFunction.Sum;


It works! but remember that the aggregation Does not occur!!!

Now as soon as I put them back again, the aforementioned error in javascript pops up again!!! 

Question:
Is it bug in RadGrid? Am I not coding the right way?

This is really driving me nuts! :-( Can some one, please shed some light on this?

Felix
Felix Ruben Melendez Batres
Top achievements
Rank 1
 answered on 21 Mar 2011
1 answer
41 views
What is the best way to dynamically assign the skin of a RadMenu control?

I've created a Sharepoint 2010 webpart, and exposed a text property named "Skin", which can be set when you modify the webpart.

I'd like to use the value of this property to change the skin once the property is set.

Therefore, I've used the following code in the PreRender event:

this.RadMenu1.Skin = WebPart.Skin.ToString();

but it doesn't seem to work... but I know the PreRender event is being fired - I can debug through it.

Is there a refresh that needs to be called after the line above?

Thanks in advance for your help.

Bill Richardson
Kalina
Telerik team
 answered on 21 Mar 2011
0 answers
89 views
It has recently come to our attention that our visitors using AOL is encountering problems when trying to use the Rad Controls we have placed on our site. 

Mostly around the RadDatePicker; from a user comment, "it shows that there is not a calendar icon to the right of the start and end date areas to click on to enter the start and end dates".

Is there any reports out that indicate AOL users are having problems with Telerik AJAX Controls?  Any insight in this at all?

We are gathering more information, as which browser they are using, but we are not receiving any other complaints from visitors NOT using AOL.

Any help or insight would be great!
Paul
Top achievements
Rank 2
 asked on 21 Mar 2011
7 answers
85 views
So, if you want to add and image upload icon - you lose the rest of the functionality of the radEditor?  How do I retain the other information in the menu of the radEditor yet add the ability to add images?

Thanks in advance.
Marin Bratanov
Telerik team
 answered on 21 Mar 2011
10 answers
173 views
Hi,
I handle the client side double click event to move a node from one tree to another.

my code :

treeSrc.trackChanges();

treeDst.trackChanges();

treeSrc.get_nodes().remove(node);

treeDst.get_nodes().add(node);

treeSrc.commitChanges();

treeDst.commitChanges();
...

When I double click some tree node it will be actually moved. However, I also got a runtime error: "'null' is null or not an object"

...

if

(this.get_contextMenuIDs().length>0){

Telerik.Web.UI.RadContextMenu.hideAll();

}

},_expandOnHover:function(e){

if(Telerik.Web.UI.RadTreeView._draggingTreeView){

var _53=this._extractNodeFromDomElement(e.eventMapTarget);

this._hoveredNode=_53;

window.setTimeout(function(){

if(_53==_53._getControl()._hoveredNode){

_53.set_expanded(true);

}

},1000);

}

return true;

},_toggle:function(e){

var _55=this._extractNodeFromDomElement(e.eventMapTarget);

if(!_55.get_isEnabled()){ //This line causes problem

return;

}

this._hideContextMenus();

e.stopPropagation();

var _56=_55.get_expanded();

if(_56==false){

if(this.raise_nodeExpanding(_55)){

return;

}
...

any idea on this?

Cheers,
Elton

Helen
Telerik team
 answered on 21 Mar 2011
2 answers
51 views
I am wondering if I can use a different datasource for the day view instead of the week or the month view?
Rick
Top achievements
Rank 1
 answered on 21 Mar 2011
1 answer
73 views
Hello,

I have a big problem with  <telerik:RadTextBox>.Here is the source of RadTextBox.
 <telerik:RadTextBox ID="TxtShopOperatorID" AutoPostBack="true" runat="server" Width="100px"
                OnTextChanged="TxtShopOperatorID_TextChanged" onKeyUp="changeVal()">

The method is working fine at popup dialog in InternetExplorer,but it doesnot happens in mozilla firefox.
Please tell me how to solve this problem.I red another post about this problem,whithout answer.So the methods works fine out of PopupDialog in IE and FF,but in pop dialog in FF the event is not happens.
The same problem without answer: http://www.telerik.com/community/forums/aspnet/general-discussions/radtextbox-ontextchanged-event-is-not-working-in-firefox.aspx

Regards,
Lubo
Martin
Telerik team
 answered on 21 Mar 2011
1 answer
83 views
hi telerik team

I followed this demo http://demos.telerik.com/aspnet-ajax/controls/examples/integration/gridincombobox/defaultcs.aspx?product=combobox
the difference is that i have two combos in cascade, so the first one has the radgrid load on demand, all is working, but i getting into a javascript error (see the image)

this is my javascript code when select a row of the radgrid, i test it and see that the problem is the doPostback, so whats the correct way to make the cascading of the combos.

 function RowSelected(sender, args) {
                var selectedText = args.getDataKeyValue("Name");
                var selectedValue = args.getDataKeyValue("InstanceID");

                var combo = $find('<%= rcCustomer.ClientID %>');

                if (selectedValue.length > 0) {
                    combo.trackChanges();
                    combo.set_text(selectedText);
                    combo.set_value(selectedValue);
                    combo.get_items().getItem(0).set_text(selectedText);
                    combo.get_items().getItem(0).set_value(selectedValue);
                    combo.commitChanges();
                }
                __doPostBack(combo.id, "TextChange");
            }

Thanks for the help
Dimitar Terziev
Telerik team
 answered on 21 Mar 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?