Telerik Forums
UI for ASP.NET AJAX Forum
0 answers
67 views
Hi,

I am using RadTreeView in my project. If my page has not a masterpage ClientSide events of TreeView working exactly. But if it has a masterpage, i can't use scripts that is related with events. In example, i can use Drag& Drop events/scripts if my page has not a masterpage, but if has, i can not use these events/scripts.

How can I solve this problem,

Thanks for your help.

Edit : Oops! I solved this problem :) I used $find('RadTreeView1'), but in MasterPage; naturally tree's id changing so i change my function to $find('<%= RadTreeView1.ClientID %>') and worked :)
Bagis Rona
Top achievements
Rank 1
 asked on 05 May 2010
2 answers
228 views
Hello

I have a RadCombo in the template for a RadToolBarButton in the RadToolBarDropDown.

I want to allow the user to make a selection from the Combo Box and then have him click the RadToolBarButton to perform the post back.

As soon as a selection is made from the combo box the RadToolBarDropDown closes. 

I want to be able to leave the RadToolBarDropDown open after a selection has been made in the combo box and hence avoid an extra click which is currently needed to reopen RadToolBarDropDown. 

I have attached the image with this message.

Any insight will be greatly appreciated.

Thanks
Imran

 
Imran
Top achievements
Rank 1
 answered on 05 May 2010
0 answers
73 views

I currently use the Ajax toolkit throughout my application for the Rounded Corners control.  Now the I'm moving to the Telerik Ajax manager, is there a Telerik control that I can use to give me the rounded corners?

Scott Durrett
Top achievements
Rank 1
 asked on 05 May 2010
1 answer
125 views
Hi,
I'm trying to add a table of contents to my site, but because of the nodes has a large number of sub nodes it is throwing the allignment way out.  Is there a why to specify the number of primary nodes per column.

IE I have 13 main nodes and want 3 columns, 5 nodes in first column, 2 nodes in column 2 and 6 nodes column 3.
The sitemap control just defaults to 5,4,4 (even split).

See images for a better representation.

Thanks in advance for any help you can give.

Regards
Byron
Genady Sergeev
Telerik team
 answered on 05 May 2010
1 answer
206 views
Hi Telerik,
While Exporting to Excel, i am getting error like

Object reference not set to an instance of an object.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

I am using the VB Code as bellow
    

 

If (Not RadGrid1.MasterTableView.Items.Count = 0) Then   
With RadGrid1   
 .ExportSettings.IgnorePaging = True   
 .ExportSettings.ExportOnlyData = True   
 .ExportSettings.FileName = "ExportedResult"   
 .MasterTableView.ExportToExcel()  
End With   
End If 
 
 


if i'll remove the line " ExportSettings.IgnorePaging = True" , it will work. but i need all the pages to be exported.

in aspx, i am used the code like bellow
 

                        <telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="True" AutoGenerateColumns="true"   
                            DataSourceID="sqlData1" EnableEmbeddedSkins="False" GridLines="None"   
                            EnableAJAX="True" > 
                            <HeaderContextMenu EnableTheming="True">  
                                <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> 
                            </HeaderContextMenu> 
                            <MasterTableView DataSourceID="sqlData1" AllowFilteringByColumn="false" PageSize="50">  
                                <RowIndicatorColumn> 
                                    <HeaderStyle Width="20px"></HeaderStyle> 
                                </RowIndicatorColumn> 
                                <ExpandCollapseColumn> 
                                    <HeaderStyle Width="20px"></HeaderStyle> 
                                </ExpandCollapseColumn> 
                                <Columns> 
                                </Columns> 
                            </MasterTableView> 
                            <FilterMenu EnableTheming="True">  
                                <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> 
                            </FilterMenu> 
                        </telerik:RadGrid> 
                        <asp:SqlDataSource ID="sqlData1" runat="server" ConnectionString="<%$ ConnectionStrings:PAMMSConnectionString %>">  
                        </asp:SqlDataSource> 

 

 

 

 

 

 

My grid is creating Dynamically, thats why i used " AutoGenerateColumns="true" ". According to the query user gives , the grid will populate the data.

can you please help me out for this issue.

 

 

 

Daniel
Telerik team
 answered on 05 May 2010
1 answer
153 views

I've got a RadGrid that contains multiple DataList in a template column, most all the values are numeric, but not all.  I can export to excel, and most everything is correct, however in my situation, I need different formats for the cells, depending on the datalist.

This is my export secion

        gv.ExportSettings.FileName = Format(Now(), "MMddyyyy")  
        gv.ExportSettings.IgnorePaging = True 
        gv.ExportSettings.ExportOnlyData = False 
        gv.ExportSettings.OpenInNewWindow = True 
        gv.ExportSettings.HideStructureColumns = True 
        gv.MasterTableView.ExportToExcel()  
 

Example Output

From the sample, which is linked to above, I need a different format on the numeric values for SP, CFM, BHP and Sone, which I have working on the screen.  The issue is when I export to excel trailing 0's on the decimal fields are chopped off.  If it's whole number, the trailing 0's aren't chooped off.  Per the link to the Example output,
SP cell c1 should be 0.000 cell K1 should be 1.000, always contain three decimals
BHP cell c6 should be 1.370, always contain three decimals

The Radgrid is a copy of the grid shown on the screen, I need slightly different formating when exported versus what's shown on the screen.  I've wired up the ExcelExportCellFormatting event to gv
AddHandler gv.ExcelExportCellFormatting, AddressOf Me.gv_ExcelExportCellFormatting  
 
 

 

 

I can get the individual datalist in this event, but how do I apply a specific format to the Cells within the Datalist whenexported to Excel?

Hopefully I've provided enough info to get some assistance here, of not let me know and I'll try respond with additional info.

Thanks in Advance

Daniel
Telerik team
 answered on 05 May 2010
2 answers
126 views
Hi,
I have a grid with 3 level hierarchy. I wanted to get the client id of the expaned/collapsed detailtable when the expand/collapse image button is clicked.The detailtable just below the button expanded/collapse.
I can get this work for two level by the following code
 <ClientSettings AllowExpandCollapse="True"
                                <ClientEvents OnHierarchyCollapsed="Collapsed" /> 
                                <ClientEvents OnHierarchyExpanded="Expanded" /> 
</ClientSettings> 
 
<script type="text/javascript" language="javascript"
 
    function Collapsed(sender, eventArgs) { 
        var radgrid = sender
        var detailTablesArray = radgrid.get_detailTables(); 
        document.getElementById(detailTablesArray[eventArgs.get_itemIndexHierarchical()]._data.ClientID).style.display = "none"
 
    } 
 
    function Expanded(sender, eventArgs) { 
        var radgrid = sender
        var detailTablesArray = radgrid.get_detailTables(); 
        document.getElementById(detailTablesArray[eventArgs.get_itemIndexHierarchical()]._data.ClientID).style.display = "inline"
 
    } 
</script> 



But  incase of 3 level hierarchy i get the value of "eventArgs.get_itemIndexHierarchical()" for the level two "expand/collapse" click as something like "2:0_2" and hence not able to index the detailtable array.
I need to do this for totally different issue though it seems from code above that i am just hiding / showing the detail table. All i need is the client id for the detailtable for the expanded/collapsed row.

Appreciate any help on this.
Thanks,
Sudhir.
sudhir singh
Top achievements
Rank 1
 answered on 05 May 2010
3 answers
155 views

It disappeared so I had to use this:

if (e.Item is GridGroupFooterItem)  
        {  
            GridGroupFooterItem groupedItem = e.Item as GridGroupFooterItem;  
            groupedItem.Style["width"] = "20px";  
            groupedItem.Style["height"] = "20px";  
            groupedItem.Style["background-color"] = "lightgray";  
            groupedItem.Style["font-size"] = "11px";  
            groupedItem.Style["font-family"] = "Verdana";  
            groupedItem.Style["text-align"] = "right";               
            groupedItem.Style["font-weight"] = "bold";  
            groupedItem.Style["vertical-align"] = "text-top";        } 
Pavlina
Telerik team
 answered on 05 May 2010
1 answer
169 views
I have this problem which i've been trying to resolve for quite awhile.

Here's what i have:
  1. RadControls AJAX 2010.1 309
  2. RadAjaxManagerProxy on a page
  3. RadGrid 
  4. User control that's used to edit record
  5. TabStrip and MultiPage in the usercontrol
  6. "Update & Next" button in the user control that saves edited record and moves to the next record.

Everything seems to work fine, except:
  1. When click Edit for the same record twice the the tabs stop changing pages within MultiPage
  2. The tabs themselves get changes, but not the content within Multipage
  3. If i go to another record i can change tabs ok.
  4. Basically the first time i edit a record the tabs work, and if i try to edit it again it does not work
  5. It irrespective of the page i'm in
  6. Tabs on records with the same index on the page don't work on any page.

So it appears that those lines that i've opened to edit get "locked" and after that tabstrip or mutipage stops working.

Has anybody had the same issue found a solution for this scenario?

Some code snippets:
My page:
        <telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server"
            <AjaxSettings> 
                <telerik:AjaxSetting AjaxControlID="rgEntries"
                    <UpdatedControls> 
                        <telerik:AjaxUpdatedControl ControlID="rgEntries" /> 
                    </UpdatedControls> 
                </telerik:AjaxSetting> 
                [cut] 
            </AjaxSettings> 
        </telerik:RadAjaxManagerProxy> 

        <telerik:RadGrid ID="rgEntries" runat="server" AllowPaging="True" 
            AllowSorting="True" GridLines="None" ShowFooter="True" ShowStatusBar="True" AllowCustomPaging="True" AutoGenerateColumns="False"  
             OnNeedDataSource="rgEntries_NeedDataSource" OnDeleteCommand="rgEntries_DeleteCommand" OnInsertCommand="rgEntries_InsertCommand" OnUpdateCommand="rgEntries_UpdateCommand" OnItemCommand="rgEntries_ItemCommand"
            <ExportSettings IgnorePaging="True" OpenInNewWindow="True" ExportOnlyData="True" filename="TimeEntriesExport" > 
<Pdf Title="Time Entries Export" PaperSize="A4" PageWidth="297mm" PageHeight="210mm"></Pdf> 
</ExportSettings> 
            <MasterTableView CommandItemDisplay="Top" DataKeyNames="ID" AllowCustomSorting="True" EditMode="EditForms"
                <CommandItemSettings ShowExportToExcelButton="True" ShowExportToWordButton="True" ShowExportToCsvButton="True"></CommandItemSettings> 
                <Columns> 
                    <telerik:GridEditCommandColumn></telerik:GridEditCommandColumn> 
                    [cut] 
                </Columns> 
 
                <EditFormSettings EditFormType="WebUserControl" UserControlName="Controls\TimeEntryDetails.ascx"
                <EditColumn UniqueName="EditCommandColumn1"></EditColumn> 
                </EditFormSettings> 
                </MasterTableView> 
                <ClientSettings AllowDragToGroup="True"
                <Selecting AllowRowSelect="True"></Selecting> 
                <ClientEvents OnRowDblClick="RowDblClick"></ClientEvents> 
                </ClientSettings> 
            <HeaderContextMenu EnableAutoScroll="True"
            </HeaderContextMenu> 
        </telerik:RadGrid> 
 

        protected void rgEntries_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e) 
        { 
            int? totals  = null
            EntryCollection entries = GetEntries(ref totals, rgEntries.CurrentPageIndex); 
 
            rgEntries.DataSource = entries; 
            rgEntries.VirtualItemCount = totals.Value; 
        } 

        protected void rgEntries_UpdateCommand(object source, GridCommandEventArgs e) 
        { 
            bool moveNext = true
 
            CRMAdmin.Controls.TimeEntryDetails userControl = 
(CRMAdmin.Controls.TimeEntryDetails)e.Item.FindControl(GridEditFormItem.EditFormUserControlID); 
            Entry entry = 
                CRMService.Default.Repository.Fetch<Entry>( 
                    (Guid)rgEntries.MasterTableView.DataKeyValues[e.Item.ItemIndex]["ID"], false); 
 
            userControl.LoadToObject(entry); 
 
            if (!entry.IsDirty) 
            { 
                if (moveNext) 
                { 
                    if (e.Item.ItemIndex < rgEntries.Items.Count - 1) 
                    { 
                        rgEntries.Items[e.Item.ItemIndex + 1].Edit = true
                    } 
                    else 
                    { 
                        rgEntries.CurrentPageIndex++; 
                        rgEntries.Items[0].Edit = true
                    } 
                } 
                return//nothing changed 
            } 
 
            ValidationResults val = entry.Validate(); 
            if (val.IsValid) 
            { 
                try 
                { 
                    using (TransactionScope scope = new TransactionScope()) 
                    { 
                        string userName = System.Web.HttpContext.Current != null ? System.Web.HttpContext.Current.User.Identity.Name : string.Empty; 
 
                        entry.Save(userName); 
 
                        scope.Complete(); 
                    } 
 
                    if (moveNext) 
                    { 
                        if (e.Item.ItemIndex < rgEntries.Items.Count - 1) 
                        { 
                            rgEntries.Items[e.Item.ItemIndex + 1].Edit = true
                        } 
                        else 
                        { 
                            rgEntries.CurrentPageIndex++; 
                            rgEntries.Items[0].Edit = true
                        } 
                    } 
                } 
                catch (Exception ex) 
                { 
                    Label lblError = new Label(); 
                    lblError.Text = "Unable to update Time Entry. Reason: " + ex.Message; 
                    lblError.ForeColor = System.Drawing.Color.Red; 
                    rgEntries.Controls.Add(lblError); 
 
                    e.Canceled = true
                } 
            } 
            else 
            { 
                Validator validator = new Validator(); 
                validator.IsValid(entry as IRepositoryRecord); 
                rgEntries.Controls.Add(validator); 
 
                e.Canceled = true
            } 
        } 

User Control:
    <telerik:RadTabStrip ID="RadTabStrip1" runat="server" MultiPageID="RadMultiPage1" SelectedIndex="0" ShowBaseLine="True" EnableViewState="false"
        <Tabs> 
            <telerik:RadTab runat="server" Text="Common" Selected="True"></telerik:RadTab> 
            <telerik:RadTab runat="server" Text="Other" Value="Other"></telerik:RadTab> 
            <telerik:RadTab runat="server" Text="Audit History" Value="AuditHistory"></telerik:RadTab> 
        </Tabs> 
    </telerik:RadTabStrip> 
    <telerik:RadMultiPage ID="RadMultiPage1" runat="server" SelectedIndex="0" ScrollBars="None" EnableViewState="true"
        <telerik:RadPageView ID="rpvCommon" runat="server"
            [cut] 
</telerik:RadPageView> 
</telerik:RadMultiPage> 

<asp:button id="btnUpdate" text="Update & Next" runat="server" CommandName="Update" Visible='<%# !(DataItem is Telerik.Web.UI.GridInsertionObject) %>'></asp:button> 

protected Object _dataItem = new object(); 
 
        public object DataItem 
        { 
            get { return this._dataItem; } 
            set { this._dataItem = value; } 
        } 

        protected override void OnDataBinding(EventArgs e) 
        { 
            base.OnDataBinding(e); 
 
            //setup control values from DataItem  
            [cut] 
        } 
 


Iana Tsolova
Telerik team
 answered on 05 May 2010
8 answers
578 views

Hi All, I am following the Load on Demand RadPageView example and everything is working correctly except for the fact that I am trying to load PageIndex  2 and show PageIndex 2. When I do this the tab shows up blank as if nothing was loaded. I believe the actual tab is loading but at index 0, any guidance or a how to will be much appreciated.

Thanks

-----------

 

 

protected void Page_Load(object sender, EventArgs e)

 

{

 

 

if (!Page.IsPostBack)

 

{

AddTab(

 

"General Information");

 

AddTab(

 

"Change Password");

 

AddTab(

 

"Quick Links");

 

AddTab(

 

"Application Access");

 

 

 

int i = -1;

 

 

 

if (Request.QueryString["PageIndex"] != null)

 

 

 

Int32.TryParse(Request.QueryString["PageIndex"], out i);

 

 

 

switch (i)

 

{

 

 

case 2:

 

RadMultiProfile.SelectedIndex = 2;

RadTabProfile.SelectedIndex = 2;

AddPageView(RadTabProfile.FindTabByText(

 

"Quick Links"));

 

 

 

 

break;

 

 

 

default:

 

AddPageView(RadTabProfile.FindTabByText(

 

"General Information"));

 

 

 

break;

 

}

 

}

}

 

 

private void AddTab(string tabName)

 

{

 

 

RadTab tab = new RadTab();

 

tab.Text = tabName;

RadTabProfile.Tabs.Add(tab);

}

 

 

private void AddPageView(RadTab tab)

 

{

 

 

RadPageView pageView = new RadPageView();

 

pageView.ID = tab.Text;

RadMultiProfile.PageViews.Add(pageView);

tab.PageViewID = pageView.ID;

}

 

 

protected void RadTabProfile_TabClick(object sender, RadTabStripEventArgs e)

 

{

AddPageView(e.Tab);

e.Tab.PageView.Selected =

 

true;

 

}

 

 

protected void RadMultiProfile_PageViewCreated(object sender, RadMultiPageEventArgs e)

 

{

 

 

string userControlName = "Controls/" + e.PageView.ID.Replace(" ", "") + ".ascx";

 

 

 

Control userControl = Page.LoadControl(userControlName);

 

userControl.ID = e.PageView.ID +

 

"_userControl";

 

e.PageView.Controls.Add(userControl);

}

Jorge Cardenas
Top achievements
Rank 2
 answered on 05 May 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
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?