Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
127 views
Hello I have some problem with nestedview template and I hope that I find the answer here.

In the attached code I have a sample with my problem.
I have a hierarchical grid made up with NestedViewTemplate (no detail tables)
In the detail table i have two columns set to visible="false". But they are binded manualy(via eval) in a nested view template. Also I have defined a norecord template.
My problem is, that when I push the insert button, the grid style goes wrong. There is still visible a part of norecord template, and the edit form is in the right side of the grid.

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
    </telerik:RadScriptManager>
    <div>
        <telerik:RadGrid
            DataSourceID="ObjectDataSource1"
            Skin="Vista"
            GridLines="None"
            AutoGenerateColumns="False"
            ID="RadGrid1"
            runat="server">
            <MasterTableView
                CommandItemDisplay="Top"
                DataKeyNames="ID"
                EnableNoRecordsTemplate="true"
                DataSourceID="ObjectDataSource1" >
                <NestedViewTemplate>
                    <asp:Panel runat="server" ID="InnerContainer" Visible="false">
                        <telerik:RadTabStrip ID="RadTabStrip1" MultiPageID="mpLocalizationDataSection"
                            runat="server" SelectedIndex="2" Skin="Vista">
                            <Tabs>
                                <telerik:RadTab
                                    runat="server"
                                    Text="Tabulka 1"                                    
                                    PageViewID="pgv" >
                                </telerik:RadTab>  
                                <telerik:RadTab
                                    runat="server"
                                    Text="Tabulka 2"                                    
                                    PageViewID="pgv2" >
                                </telerik:RadTab>                             
                            </Tabs>
                        </telerik:RadTabStrip>
                        <telerik:RadMultiPage
                            runat="server"
                            ID="mpLocalizationDataSection"
                            SelectedIndex="2"
                            RenderSelectedPageOnly="false" >
                            <telerik:RadPageView runat="server" ID="pgv">
                                <telerik:RadGrid
                                    ID="RadGrid2"
                                    Width="100%"
                                    DataSourceID="ObjectDataSource2"
                                    Skin="Vista"
                                    GridLines="None"                                   
                                    AutoGenerateColumns="false"
                                    runat="server" onprerender="RadGrid2_PreRender">
                                    <MasterTableView
                                        CommandItemDisplay="Top"
                                        AutoGenerateColumns="false"                                       
                                        DataKeyNames="ID"
                                        Width="100%"
                                        ExpandCollapseColumn-Display="false"
                                        ExpandCollapseColumn-Visible="false"
                                        EnableNoRecordsTemplate="true"
                                        DataSourceID="ObjectDataSource2" >                                       
                                         
                                        <Columns>
                                            <telerik:GridBoundColumn
                                                HeaderText="ID"
                                                Visible="false"
                                                DataField="ID" >                       
                                            </telerik:GridBoundColumn>
                                            <telerik:GridBoundColumn
                                                HeaderText="Meno"
                                                Visible="false"
                                                DataField="Name" >                       
                                            </telerik:GridBoundColumn>
                                        </Columns>
                                        <NestedViewTemplate>
                                            <asp:Panel ID="NesteViewPanel" runat="server">
                                                <asp:Label
                                                    runat="server"
                                                    ID="lblLocationPremisesTypeCode"
                                                    Text='<%# (Eval("ID")) %>' >
                                                </asp:Label>
                                                <asp:Label
                                                    runat="server"
                                                    ID="Label3"
                                                    Text='<%# (Eval("Name")) %>' >
                                                </asp:Label>
                                            </asp:Panel>
                                        </NestedViewTemplate>
                                         
                                    </MasterTableView>
                                </telerik:RadGrid>
                                <asp:ObjectDataSource
                                    ID="ObjectDataSource2"
                                    DataObjectTypeName="TestRadgridInsert.DTO2"
                                    TypeName="TestRadgridInsert.DS1"
                                    SelectMethod="Select2"
                                    runat="server">
                                </asp:ObjectDataSource>
                            </telerik:RadPageView>
                            <telerik:RadPageView runat="server" ID="pgv2">
                                text
                            </telerik:RadPageView>
                        </telerik:RadMultiPage>
                    </asp:Panel>
                </NestedViewTemplate>
 
                <Columns>
                    <telerik:GridBoundColumn
                        HeaderText="ID"
                        DataField="ID" >                       
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn
                        HeaderText="Meno"
                        DataField="Name" >                       
                    </telerik:GridBoundColumn>
                </Columns>
            </MasterTableView>
        </telerik:RadGrid>
        <asp:ObjectDataSource
            ID="ObjectDataSource1"
            DataObjectTypeName="TestRadgridInsert.DTO1"
            TypeName="TestRadgridInsert.DS1"
            SelectMethod="Select1"           
            runat="server">
        </asp:ObjectDataSource>       
    </div>
    </form>
</body>
</html>

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;
 
namespace TestRadgridInsert
{
    public partial class _Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            RadGrid1.ItemCreated += new Telerik.Web.UI.GridItemEventHandler(RadGrid1_ItemCreated);
            RadGrid1.PreRender += new EventHandler(RadGrid1_PreRender);
            RadGrid1.ItemCommand += new GridCommandEventHandler(RadGrid1_ItemCommand);
        }
        void RadGrid1_ItemCommand(object sender, GridCommandEventArgs e)
        {
            if (e.CommandName == RadGrid.ExpandCollapseCommandName)
            {
                ((GridDataItem)e.Item).ChildItem.FindControl("InnerContainer").Visible = !e.Item.Expanded;
            }
        }
        void RadGrid1_PreRender(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                RadGrid1.MasterTableView.Items[0].Expanded = true;
                RadGrid1.MasterTableView.Items[0].ChildItem.FindControl("InnerContainer").Visible = true;
            }
        }
        void RadGrid1_ItemCreated(object sender, Telerik.Web.UI.GridItemEventArgs e)
        {
            if (e.Item is GridNestedViewItem)
            {
                e.Item.FindControl("InnerContainer").Visible = ((GridNestedViewItem)e.Item).ParentItem.Expanded;
            }
        }
        protected void RadGrid2_PreRender(object sender, EventArgs e)
        {
            RadGrid grid = sender as RadGrid;
            if (grid.MasterTableView.Items.Count > 0)
            {
                grid.MasterTableView.Items[0].Expanded = true;
                GridExpandColumn collapseCol = grid.MasterTableView.ExpandCollapseColumn as GridExpandColumn;
                //collapseCol.Display = false;
            }
        }
    }
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
 
namespace TestRadgridInsert
{
    public class DS1
    {
        public List<DTO1> Select1()
        {
            List<DTO1> list = new List<DTO1>();
            for (int i = 0; i < 3; i++)
            {
                DTO1 dto1 = new DTO1();
                dto1.ID = i;
                dto1.Name = "meno " + i.ToString();
                list.Add(dto1);
            }
            return list;
        }
        public List<DTO2> Select2()
        {
            List<DTO2> list = new List<DTO2>();
            //for (int i = 0; i < 1; i++)
            //{
            //    DTO2 dto2 = new DTO2();
            //    dto2.ID = i;
            //    dto2.Name = "meno " + i.ToString();
            //    list.Add(dto2);
            //}
            return list;
        }
        public void Insert2(DTO2 item)
        {
        }
    }
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
 
namespace TestRadgridInsert
{
    public class DTO1
    {
        public DTO1()
        {
        }
 
        public int ID { get; set; }
        public string Name { get; set; }
    }
 
    public class DTO2
    {
        public DTO2()
        {
        }
 
        public int ID { get; set; }
        public string Name { get; set; }
    }
}


Thank you very much for answers and some solution.

With regards

Tibor
Marin
Telerik team
 answered on 23 Nov 2010
1 answer
132 views
Hi,

I have a radgrid which uses a modal popup window to insert new items as shown below. Does anyone know how I can find the textbox value through javascript?

<EditFormSettings InsertCaption="Add Note" CaptionFormatString="View Note" EditFormType="Template">
           <PopUpSettings Modal="true" />
           <FormTemplate>
               <table id="tblAddNote" cellspacing="1" cellpadding="1" width="250px" border="0">
                   <tr>
                       <td>
                           <asp:TextBox ReadOnly='<%# !(Container is GridEditFormInsertItem) %>' Width="400px" Height="150px" TextMode="MultiLine" ID="txtNote" Text='<%# Bind( "Content") %>' runat="server">
                           </asp:TextBox>
                       </td>
                   </tr>
               </table>
               <table style="width: 100%">
                   <tr>
                       <td align="right" colspan="2">
                           <asp:Button ID="btnUpdate"  Text='<%# (Container is GridEditFormInsertItem) ? "Add" : "Close" %>'
                               runat="server"  CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Cancel" %>'>
                           </asp:Button> 
                           <asp:Button ID="btnCancel" Visible="<%# (Container is GridEditFormInsertItem) %>" Text="Cancel" runat="server" CausesValidation="False" CommandName="Cancel">
                           </asp:Button>
                       </td>
                   </tr>
               </table>
           </FormTemplate>
       </EditFormSettings>
Daniel
Telerik team
 answered on 23 Nov 2010
3 answers
107 views
Hi Guys,

We used trial version of Telerik RAD Controls For Ajax Q2 2010 for one of our project and made it work as we want using CustomFileSystemProvider. Recently we bought a licensed version of RAD Controls which happened to be upgraded version Q3 2010. The problem is that after updating Telerik.Web.UI.dll in our project with new version our File Browser stopped working as before. In particular right panel of file browser stopped updating when one clicks on any folder on the left tree. After some debugging we found that ResolveDirectory function in CustomFileSystemProvider class for Q3 version is called only on initial load but not called on Folder Change. Note that ResolveRootDirectoryAsTree function is called and folder tree is still updated in left panel as it should.

Can you please give us some information what changes has been made in FileExplorer component which can cause this issue and how we can fix it. Our problem is that we need this component ASAP. Using previous version would be good temporary fix for us but it looks like we can not download full version for Q2 controls.

Regards,
Rob
Fiko
Telerik team
 answered on 23 Nov 2010
2 answers
168 views
Hi,

I have a Grid with a GridButtonColumn and a Column which invokes a TooltipManager.

The click functionality on the Buttons disappears as soon as I have triggered a Tooltip.

It appears that the OnItemCommand of the Grid is not fired anymore after triggering a ToolTip...

Do you have any clues?
I can send code if you want.

BR.
Marc

EDIT: When ButtonType=LinkButton it works well. It fails with ButtonType="ImageButton"
Fit2Page
Top achievements
Rank 3
Bronze
Bronze
Iron
 answered on 23 Nov 2010
2 answers
298 views
I am trying to get the value of radnumerictextbox in javascript.  When I set visible = true - it works fine.

Code creating the hidden field:

<

 

telerik:GridTemplateColumn DataField="RequestedHidden" Visible="false" ReadOnly="true" HeaderStyle-HorizontalAlign="Center"

 

 

UniqueName="Requested" HeaderText="Requested" ShowSortIcon="false">

 

 

<EditItemTemplate>

 

 

<telerik:RadNumericTextBox ID="tbxReqHidden" Value='<%#Bind("Requested") %>' CssClass="RightAlign"

 

 

runat="server" Culture="English (United States)" Type="Number" NumberFormat-DecimalDigits="0"

 

 

Width="90px" MinValue="0" DataType="System.Int32" Enabled="false" Visible="false" >

 

 

</telerik:RadNumericTextBox>

 

 

</EditItemTemplate>

 

 

</telerik:GridTemplateColumn>

Here is the JS:

 

 

function RequestedTotal(sender, args) {

 

 

var rdgrid = $find("<%=RadGrid1.ClientID %>");

 

 

var cell = sender.get_element().parentNode.parentNode;

 

 

var index = cell.parentNode.rowIndex;

 

 

var MasterTable = rdgrid.get_masterTableView();

 

 

var original = MasterTable.get_dataItems()[index - 2].findControl("tbxReqHidden");

 

tempValueRequested = sumInputRequested.get_value() - original;

sumInputRequested.set_value(tempValueRequested + sender.get_value());

}

Amanda
Top achievements
Rank 1
 answered on 23 Nov 2010
7 answers
213 views

I dumped out the contents of my asp.net application state and noticed many RadProgressContext instances.

Here’s a sample of the output I created while dumping the application state:

HttpContext.Current.Application[key]

HttpContext.Current.Application[key].ToString()

RadProgressContexta994ac27-7029-4afc-aba5-f71d1f53636d

Telerik.Web.UI.RadProgressContext

RadProgressContext9abbf6cc-983f-466d-bf0c-08d3144e0cc5

Telerik.Web.UI.RadProgressContext

RadUploadContext9abbf6cc-983f-466d-bf0c-08d3144e0cc5

Telerik.Web.UI.RadUploadContext

RadProgressContextb154df9a-33f7-4f30-b5ba-c27887fb83f1

Telerik.Web.UI.RadProgressContext

RadProgressContext0eaa8757-91ec-4dcf-8cd1-f6d8bf36bc52

Telerik.Web.UI.RadProgressContext

RadUploadContext0eaa8757-91ec-4dcf-8cd1-f6d8bf36bc52

Telerik.Web.UI.RadUploadContext


That is a sample, there are lots more of these. Does this indicate an issue? Do I need to do something to clean this stuff up?

 Thanks,

Genady Sergeev
Telerik team
 answered on 23 Nov 2010
3 answers
205 views
Does anyone know where I can get the default loading images to use in the loading panel?

thanks
Dimo
Telerik team
 answered on 23 Nov 2010
3 answers
175 views
I hope someone could please help me in the right direction. I have been trying to set the sub menu width to be 100% the width of the Root Item, It's currently looking a bit odd that the sub menu often ends up being quite a bit shorter than the width of the root item. Is this possible in the way the menu is structured or would it involve implementing some Java scripting?
Kalina
Telerik team
 answered on 23 Nov 2010
1 answer
132 views

Hello Telerik team,

I have a requirement where i have a Telerik rad grid which has a datasource of sharepoint list.
When you edit a record from the rad grid, I have to update the particular record and update the record.

I have a sharepoint list which have more than 150 columns in it.I am using sharepoint object model to update the sharepoint list item by saying
listitem.update();
 When I do that,it takes a lot of time to update the record.Is it because of so many columns or
i have more than 20000 records in the sharepoint list.Is there any better way of doing it.

One of my thought is that it might be taing so much time on update as
it has to create the content type for that particular list item.
Is there any way that if we can already define a content type for that list so that
the process of updation will become fast.

Any ideas to improve the performace is greatly appreciated.

Thank you,
Smith

Pavlina
Telerik team
 answered on 23 Nov 2010
2 answers
595 views
hello everybody

I have a question,
¿How can i get the number of columns in a radgrid when the property autogeneratecolumns is true?

when i add the columns programatically,  i use the next code
-----------------------------------------------
int cCount;
cCount = RadGrid1.Columns.Count;
-----------------------------------------------
and perfect,  cCount set the number of columms,  but, when i add columns automatically and the option autogeneratecolumns is in true, cCount only show zero,

thanks for the collaboration ,  and sorry for my bad English
Adolfo
Top achievements
Rank 1
 answered on 23 Nov 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?