Telerik Forums
UI for ASP.NET AJAX Forum
7 answers
130 views
Regards,
I have a problem with two RadTreeview, the scenario is:
1) In a WebUserControl, I have a radtreeview.
2) From the WebUserControl, I calling a aspx page is loaded in a RadWindow
3) This page contains another radtreeview
4) Before closing the child window, it runs a function that in turn calls a function of the parent window (as is in the examples of telerik).
5) The function of the parent window receives as argument the Treview RootNode of the child window with all the nodes that were created in the window.
6) The function of the parent window is to be inserted into specific nodes (in the parent window treeview)newly created nodes in the child window.
7) Therefore, from the function of the parent window, I need to use the method 'findNodeByValue' in order to know which node to insert the nodes created from the window.
8) The first time you invoke the function works fine (ie, the window opens, new nodes are created and inserted into the treview of the parent window and then closes the window).
9) But if I try to rerun the procedure immediately (open the window, create and insert nodes in the treeview of the parent window), it throws a javascript to use the method 'findNodeByValue'. The exception code is: '-2146823277' and the error message is: 'Can not execute code from a script Freed. "

It is noteworthy that in shaping the RadWindow is the property 'ReloadOnShow' to True because I require it to recharge the aspx of the window every time you open.

The truth did not find much relevant information about the javascript error and I found not applicable to the scenario that I mentioned.

Also, to clarify that by default, is not doing a recursive search on any node since it is assumed that the child page is refreshed every time you open (and actually does).

The next is the code of javascript function to receive the nodes and insert the nodes in the parent window treeview:

var ArbolPresupuestoConfigurator_ReceiveData = function (nodesConfig) {
    /*
    nodesConfig is a object passed to the function  and the following is the structure of the object
        var nodesConfig = {
        nodes: null,
        level: '',
        idFlota: 0
        }
    where 'nodes' is the object that contains the root node (with child nodes) from the child window.*/


        if (nodesConfig != null) {
            switch (nodesConfig.level) {
                case 'Flota':
                    var nodoFlota = nodesConfig.nodes.get_nodes().getNode(0)
                    if (nodoFlota != null) {
                        var esFlotaPersonalizada = nodoFlota.get_attributes().getAttribute('EsPersonalizada');
                        if (esFlotaPersonalizada == 'True') {
                            var nombreFlota = nodoFlota.get_text();
                        } else {
                            var idFlota = nodoFlota.get_value();
                            //The exception is fired here from the second time the function is called.
                            //treeArbolPresupuesto is the parent window treeview
                            var _currentNodoFlota = treeArbolPresupuesto.findNodeByValue(idFlota)
                            if (_currentNodoFlota != null) {                                
                                if (nodoFlota.get_nodes().get_count() > 0) {
                                    treeArbolPresupuesto.trackChanges();                                    
                                    var nuevaActividad = nodoFlota.get_nodes().getNode(0);                                    
                                    _currentNodoFlota.get_nodes().getNode(0).get_nodes().add(nuevaActividad);
                                    treeArbolPresupuesto.commitChanges();
                                }
                            }
                        }
                    }
                    break;
                case 'Actividad':
                    break;
                case 'Area':
                    break;
                case 'Sistema':
                    break;
                case 'SubSistema':
                    break;
                case 'Material':
                    break;
            }
        }
}
and the code caller function from child window is:

var wizardToolbar_HandleButtonClick = function (sender, eventArgs) {
    var button = eventArgs.get_item();
    var commandName = button.get_commandName();

    switch (commandName) {
        case 'SaveAll':
            //RootNode is the root node of the treeview in child window
            var rootNode = treeConfig.findNodeByValue('-100');
            nodesConfig.nodes = rootNode;
            GetRadWindow().BrowserWindow.ArbolPresupuestoConfigurator_ReceiveData(nodesConfig);
            GetRadWindow().close();
            break;
        case 'Cancel':
            //TODO: Pendiente implementar.
            GetRadWindow().close();
            break;
        case 'Undo':
            window.location.reload();
            break;
        case 'Help':
            //TODO: Pendiente implementar.
            break;
    }
}
Actually I am very upset with this problem since I have not found a solution and I promptly deliver development.

I appreciate any help you can provide.

Regards,

Camilo Bernal
Nikolay Tsenkov
Telerik team
 answered on 19 Jan 2011
7 answers
714 views
Hi,

I am using Nested grid in my app. i have three columns in my grid.

Three column like plan name(Label), max amount(label) and user enter amount (Text box)

all are using Itemtemplate. i want to avoid user enter amount should not greater then max amount. if user enter amount greater then max amount means alert message should be display like  (Plan name || cann't accept more then || max amount) onbluer time.

please anyone help me how to get entering text box row value in onbluer time.

Please help,
I have also attached image.


Thanks in Advance,
Dhamu,
Dhamodharan
Top achievements
Rank 1
 answered on 19 Jan 2011
1 answer
139 views
How to restrict a rad window in content page within a panel?
Code:
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1"  runat="server">
    
    <telerik:RadWindowManager ID="RadWindowManager1" runat="server" >
        <Windows>
            <telerik:RadWindow runat="server" Behavior="Default" InitialBehavior="None" VisibleOnPageLoad="True" ID="RadWindow1">
            </telerik:RadWindow>
        </Windows>
    </telerik:RadWindowManager>
    <asp:Panel ID="Panel1" BorderStyle="Dotted" runat="server" Height="1000px" Width="100%">
    </asp:Panel>
    
</asp:Content>

Princy
Top achievements
Rank 2
 answered on 19 Jan 2011
1 answer
60 views
Hi to all,

I am trying to define heirarchy in radgrid programmatically. I am able to get it at the first level and not after that. Here is what I have done:
private void BindData()
        {
            clickedType = Session["type"].ToString();
            int id = ParentEntity.ParentEntityId;
            GridTableView tableView = new GridTableView(grv);
             
            switch (clickedType)
            {
                case "All Categories":
                    using (SpaceCategoriesService.SpaceCategoriesServiceClient s = new SpaceCategoriesService.SpaceCategoriesServiceClient())
                    {
                        grv.DataSource = s.GetCategoryTable();
                        tableView.Name = "Buildings";
                        tableView.DataMember = "Buildings";
                    }
                    break;
 
                case "SpaceCategories":
                    using (SpaceBuildingsService.SpaceBuildingsServiceClient s = new SpaceBuildingsService.SpaceBuildingsServiceClient())
                    {
                        grv.DataSource = s.GetBuildingByCategoryId(id);
                        tableView.Name = "Floors";
                        tableView.DataMember = "Floors";
                    }
                    break;
 
                case "SpaceBuildings":
                    using (SpaceFloorService.SpaceFloorServiceClient s = new SpaceFloorService.SpaceFloorServiceClient())
                    {
                        grv.DataSource = s.GetFloorsByBuildingId(id);
                        tableView.Name = "Rooms";
                        tableView.DataMember = "Rooms";
                    }
                    break;
 
                case "SpaceFloors":
                    using (SpaceRoomService.SpaceRoomServiceClient s = new SpaceRoomService.SpaceRoomServiceClient())
                    {
                        grv.DataSource = s.GetRoomByFloorId(id);
                    }
                    break;
 
                default:
                    throw new Exception("Unable to identify Entity.");
            }
 
            grv.MasterTableView.DetailTables.Clear();
            grv.MasterTableView.DetailTables.Add(tableView);
            grv.DataBind();
 
            foreach (GridDataItem item in grv.Items)
            {
                if (tableView.Name != "")
                {
                                         
                    LinkButton lnkExpand = (LinkButton)grv.Items[item.ItemIndex].FindControl("lnkExpand");
                    lnkExpand.Text = "Show " + tableView.Name;
                     
                }
                 
            }
            GridTableView tab = new GridTableView(grv);
            tab.DataMember = "Rooms";
            tab.Name = "Rooms";
            tableView.DetailTables.Clear();
            tableView.DetailTables.Add(tab);
 
        }
 
        protected void grv_DetailTableDataBind(object sender, GridDetailTableDataBindEventArgs e)
        {
            try
            {
                GridDataItem dataItem = (GridDataItem)e.DetailTableView.ParentItem;
                 
                string datamem = e.DetailTableView.DataMember;
 
                if (!string.IsNullOrEmpty(e.DetailTableView.DataMember))
                {
 
                    switch (e.DetailTableView.DataMember)
                    {
                        case "Buildings":
                            int CategoryID = int.Parse(dataItem.GetDataKeyValue("Id").ToString());
                            DataTable buildings;
                            using (SpaceBuildingsService.SpaceBuildingsServiceClient s = new SpaceBuildingsService.SpaceBuildingsServiceClient())
                            {
                                buildings = s.GetBuildingByCategoryId(CategoryID);
                            }
                            e.DetailTableView.DataSource = buildings;
                            break;
 
                        case "Floors":
                            int BuildingID = int.Parse(dataItem.GetDataKeyValue("Id").ToString());
                            DataTable floors;
                            using (SpaceFloorService.SpaceFloorServiceClient s = new SpaceFloorService.SpaceFloorServiceClient())
                            {
                                floors = s.GetFloorsByBuildingId(BuildingID);
                            }
                            e.DetailTableView.DataSource = floors;
                            break;
 
                        case "Rooms":
                            int FloorID = int.Parse(dataItem.GetDataKeyValue("Id").ToString());
                            DataTable rooms;
                            using (SpaceRoomService.SpaceRoomServiceClient s = new SpaceRoomService.SpaceRoomServiceClient())
                            {
                                rooms = s.GetRoomByFloorId(FloorID);
                            }
                            e.DetailTableView.DataSource = rooms;
                            break;
 
                        default:
                            break;
                    }
 
                }
 
            }
            catch (Exception ee)
            {
                string asd = ee.Message;
                //throw new Exception("Unable to load!");
            }
        }

At the second level I am getting the exception "Index out of range". Please assist me....

cheers
rohan
Marin
Telerik team
 answered on 19 Jan 2011
9 answers
262 views

If I have both paging and grouping enabled on the same grid,  the page gets cut off on the grid, so that the paging selector on the bottom of the grid sometimes doesn't show up at all, and sometimes will be partially cut off.  If I remove the grouping functionality, the paging works 100%.  I definitely need paging, as the grid is not very tall, so the data cannot be contained on one page.   I've tried seting the height of the grid, and setting the page size to something ridiculously low like 3, but the paging control still gets at least partially cut off, so I dont see how to get the grid working properly with both paging and grouping.

heres the code for the grid that is being cut off: 

 

 

 

<telerik:RadGrid ID="RadGrid2" runat="server" AllowSorting="true" AutoGenerateColumns="false"PageSize="4" AllowPaging="True" OnNeedDataSource="RadGrid2_NeedDataSource" Height="300px" ShowGroupPanel="false">
<MasterTableView>
<GroupByExpressions>
<telerik:GridGroupByExpression>
<SelectFields>
<telerik:GridGroupByField FieldAlias="FiscalYear" FieldName="FiscalYear" FormatString="{0:D}"HeaderValueSeparator=": "></telerik:GridGroupByField>
</SelectFields>
<GroupByFields>

 

 

 

 

 

 

 

<telerik:GridGroupByField FieldName="FiscalYear" SortOrder="Descending"></telerik:GridGroupByField>

 

 

 

 

 

 

 

</GroupByFields>

 

 

 

 

 

 

 

</telerik:GridGroupByExpression>

 

 

 

 

 

 

 

<telerik:GridGroupByExpression>

 

 

 

 

 

 

 

<SelectFields>

 

 

 

 

 

 

 

<telerik:GridGroupByField FieldAlias="Month" FieldName="Month" FormatString="{0:D}"

 

 

 

 

 

 

 

HeaderValueSeparator=": "></telerik:GridGroupByField>

 

 

 

 

 

 

 

</SelectFields>

 

 

 

 

 

 

 

<GroupByFields>

 

 

 

 

 

 

 

<telerik:GridGroupByField FieldName="Month" SortOrder="Ascending"></telerik:GridGroupByField>

 

 

 

 

 

 

 

</GroupByFields>

 

 

 

 

 

 

 

</telerik:GridGroupByExpression>

 

 

 

 

 

 

 

</GroupByExpressions>

 

 

 

 

 

 

 

<Columns>

 

 

 

 

 

 

 

<telerik:GridBoundColumn SortExpression="FiscalYear" HeaderText="Fiscal Year" DataField="FiscalYear" HeaderStyle-HorizontalAlign="Right" ItemStyle-HorizontalAlign="Right"></telerik:GridBoundColumn>

 

 

 

 

 

 

 

<telerik:GridBoundColumn SortExpression="Month" HeaderText="Month" DataField="Month" HeaderStyle-HorizontalAlign="Right" ItemStyle-HorizontalAlign="Right"></telerik:GridBoundColumn>

 

 

 

 

 

 

 

<telerik:GridBoundColumn SortExpression="Forecast" HeaderText="Forecast" DataField="Forecast" HeaderStyle-HorizontalAlign="Right" ItemStyle-HorizontalAlign="Right"></telerik:GridBoundColumn>

 

 

 

 

 

 

 

<telerik:GridBoundColumn SortExpression="Actuals" HeaderText="Actuals" DataField="Actuals" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center"></telerik:GridBoundColumn>

 

 

 

 

 

 

 

</Columns>

 

 

 

 

 

 

 

</MasterTableView>

 

 

 

 

 

 

 

<PagerStyle Mode="NextPrev">

 

 

 

 

 

 

 

</PagerStyle>

 

 

 

 

 

 

 

</telerik:RadGrid>

 

Pavlina
Telerik team
 answered on 19 Jan 2011
1 answer
217 views
Hi,

  I am using RadAsync upload in my application .
As per the demo,
http://demos.telerik.com/aspnet-ajax/upload/examples/async/ajaxprocessing/defaultcs.aspx?product=asyncupload
I followed the same code .
1. I want to hide the cancel and remove button the RadAsync upload.
2. Because ,While loading the image/file,click the cancel and remove button ,then the select button is disappears.

Please give any suggestion

Thanks
Prabha
Dimitar Terziev
Telerik team
 answered on 19 Jan 2011
4 answers
171 views
The latest release notes indicate Sprite support "Added: Support for sprites"
But I couldn't find anything in the documenation or demo site on how to use this new feature.

Is there any information available on how to use sprites for toolbar images?

Thanks
Yana
Telerik team
 answered on 19 Jan 2011
3 answers
144 views
Hi Telerik Support,

I need your help. I using RadAjaxLoadingPanel in my project. Everything is fine except progress image inside RadAjaxLoadingPanel doesn't show up on very first request. It appears properly on subsequent requests. I am using RadAjaxLoadingPanel along with RadAjaxManager. Here is the code:
 
<telerik:RadAjaxLoadingPanel runat="server" ID="RadLoadingPanel" IsSticky="True" EnableViewState="true" Enabled="true">
       <img id="imgLoader" src="loading.gif" height="20px" width="70px" />
</telerik:RadAjaxLoadingPanel>
                                               

<telerik:RadAjaxManager ID="RadAjaxManager" runat="server">
       <AjaxSettings>
              <telerik:AjaxSetting AjaxControlID="ibMoveToFolder">
                          More Code follows....


Can you guys help me out what property I am missing. I have tried many things but it didn't work.

- Just to let you know that it is just the loading panel which doesn't appear, the async request successfully goes to server and corresponding controls get updates without problem.

Any help would highly be appreciated.


Irfan
Pavlina
Telerik team
 answered on 19 Jan 2011
1 answer
120 views
Hi,

I'm using a Rad Grid which has templated edit / insert forms.
I want to select a value in a combobox for business unit name but when i save the record i want the "business unit name" to be the value of the combobox but i have another field called Business code which i would need to assign a value to based on the "business unit name" combobox value selected. How do i do this as i can't seem to find an "Item_Inserting" event the Rad Grid (only has ItemInserted but i need to assign the value before i insert). This also goes for the update of a record.

Can anyone suggest how i can do this?

Regards,

Shuja
Shinu
Top achievements
Rank 2
 answered on 19 Jan 2011
6 answers
552 views
Hi,

I have created a custom skin for RadUpload and have replaced the ruButtons with a custom image buttons. the custom image button has the text 'Browse' placed on it.

I have made the required changes to the css file to accrdng to the new skin. But the text 'Select' still gets displayed over the custom button.

Is there a way to remove that text or to make it not visible?

Rgds
Shuchi
shruthi
Top achievements
Rank 1
 answered on 19 Jan 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
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?