Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
192 views
Hi
I have the following telerik:RadTreeList 

<telerik:RadTreeList ID="RadTreeListFacility" runat="server" DataKeyNames="Key" ParentDataKeyNames="SuperiorFacilityID"
        AutoGenerateColumns="False" Width="100%" AllowMultiItemEdit="False" Culture="(Default)"
        OnNeedDataSource="RadTreeListFacility_NeedDataSource">
        <Columns>
            <telerik:TreeListSelectColumn UniqueName="SelectColumn" Visible="false" />
            <telerik:TreeListBoundColumn DataField="Name" UniqueName="Name" HeaderText="Display Name" />
            <telerik:TreeListBoundColumn DataField="Key" UniqueName="Key" HeaderText="Unique ID" />
            <telerik:TreeListBoundColumn DataField="FacilityType" UniqueName="FacilityType" HeaderText="Type" />
            <telerik:TreeListBoundColumn DataField="SuperiorFacilityID" UniqueName="SuperiorFacilityID"
                HeaderText="Parent ID" Visible="false" />
            <telerik:TreeListTemplateColumn ItemStyle-Width="100px" HeaderStyle-Width="100px">
                <HeaderTemplate>
                </HeaderTemplate>
                <ItemTemplate>
                    <span onclick="Edit_OnClick({Key:'<%# Eval("Key") %>',Name:'<%# Eval("Name")%>',SID:'<%# Eval("SuperiorFacilityID")%>',Type:'<%# Eval("FacilityType")%>'});">
                        <img src="../../images/DataEditing/Edit.gif" title="Update Selected Clinic" alt="Update Selected Clinic" />
                    </span>
                    <span onclick="AddSubFacility_OnClick({SID:'<%# Eval("Key")%>'});">
                        <img src="../../images/DataEditing/AddRecord.gif" title="Add Below Selected Clinic"
                            alt="Add Below Selected Clinic" />
                    </span>
                    <span onclick="Delete_OnClick({Key:'<%# Eval("Key") %>',Name:'<%# Eval("Name")%>'});">
                        <img src="../../images/DataEditing/Delete.gif" title="Delete Selected Clinic" alt="Delete Selected Clinic" />
                    </span>
                </ItemTemplate>
            </telerik:TreeListTemplateColumn>
        </Columns>
        <ClientSettings AllowPostBackOnItemClick="false">
            <Selecting AllowItemSelection="true" AllowToggleSelection="true" />
        </ClientSettings>
    </telerik:RadTreeList>


This tree has only one root node element.
Using Javascript I want to get hold of the Root element.
I have tried
var tree = $find("<%= RadTreeListFacility.ClientID %>");
var node0 = tree.get_nodes().getNode(0);


This dose not work


Also I would like to know how to get values the Key and the Name DataField values of the root node client side. Thanks in advance. Tejas
Tsvetina
Telerik team
 answered on 31 Aug 2011
1 answer
68 views
Hello,

I need help to retrieve and save into DB through grid.

Scenario:
I have one main grid , and this grid Contain three column , Menu name , Assigned school, and Select school ....

When User create a New menu and save, then Immediately Menu name Displayed in the grid , now The select school Column contain the Drop down for each grid row contain the School name with the Check box.

I want to implement feature here is "

When User check the check box of any school /s from this drop down , after out of focus from this Drop down , checked value (School) stored in to DB, and Refresh my grid / page , and Immediately shows the selected school in my "Assigned School" column of the Grid..

How can i do this, ?  Possible send me the example , that would great great help...

REgards
Samir
Veli
Telerik team
 answered on 31 Aug 2011
14 answers
987 views
Hi there,

I'm having trouble to get the insert values of my grid. My grid does on every postback a databind and it seems, that if that is done, the insert values are gone. If I don't databind on every postback, the grid doesn't show up (no columns, no rows).

My code to get the values is this:

Dim insertedItem As GridEditFormInsertItem = TryCast(e.Item, GridEditFormInsertItem)
 
Dim test As Object = TryCast(insertedItem.FormColumns(0).Controls(0).Controls(1).Controls(0), TextBox)

test.Text should contain the value, but it doesn't. Do you have any idea?

Thanks and regards,
Mark
Jayesh Goyani
Top achievements
Rank 2
 answered on 31 Aug 2011
1 answer
158 views
Hi Telerik,

I can't get my RadWindow to size below 150px and I don't know why! It seems super trivial. I've applied the normal CSS fixes. There's no auto-height going on, and I've set dimensions for all my controls. What do you guys think?

Relevant Code:

html, form, body
{
    padding: 0;
    margin: 0;
    width: 250px;
    height: 100%;
    font-size: 12px;
    font-family: "segoe ui",arial,sans-serif;
}
 
.LabelEnabled
{
    color: Black !important;
}
 
.LabelDisabled
{
    color: Gray !important;
}
 
.riTextBox
{
    color: Black !important;
}
 
.BottomButton
{
    margin-left: 93px;
}

<%@ Page Language="C#" EnableViewState="False" AutoEventWireup="True" CodeBehind="UploadDashboard.aspx.cs" Inherits="CableSolve.Web.Dashboard.Dialog.Windows.UploadDashboard" %>
 
<!DOCTYPE html>
 
<html lang="en">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
        <link rel="stylesheet" type="text/css" href="../../../Content/Dashboard/UploadDashboard.css" />
 
        <telerik:RadScriptManager ID="RadScriptManager1" Runat="server">
        </telerik:RadScriptManager>
 
        <telerik:RadUpload ID="RadUpload1" Runat="server" AllowedFileExtensions=".txt,.xml" Skin="Web20" MaxFileInputsCount="1" ControlObjectsVisibility="None" Height="44px" Width="238px" BorderWidth="0px" >
        </telerik:RadUpload>
 
        <div class="BottomButton">
            <telerik:RadButton ID="RadButton1" Runat="server" Skin="Web20" Text="Upload" OnClick="RadButton1_Click" Height="22px" Width="54px" />
        </div>
 
    </form>
</body>
</html>

<telerik:RadWindowManager ID="RadWindowManager1" Runat="Server" Skin="Web20" Modal="True" KeepInScreenBounds="True" EnableShadow="True" Behaviors="Close, Move" VisibleStatusbar="False" ReloadOnShow="True" ShowContentDuringLoad="False" Behavior="Close, Move" Title="Confirm Action" IconUrl="~/Content/Dashboard/Icons/radwindow_confirmdelete.png">
    <Windows>
        <telerik:RadWindow ID="UploadDashboardWindow" Runat="Server" NavigateUrl="~/Dashboard/Dialog/Windows/UploadDashboard.aspx" IconUrl="~/Content/Dashboard/Icons/drive-upload.png" OnClientAutoSizeEnd="OnClientAutoSizeEnd" Title="Upload Dashboard" Height="100" />
    </Windows>
</telerik:RadWindowManager>

// When a dialog window appears on the page, it does not automatically
// keep itself centered. If the user resizes the browser window, the
// dialog window may drop off the screen. This method keeps dialog windows shown.
function OnClientAutoSizeEnd(dialogWindow) {
    dialogWindow.center();
}

The OnClientAutoSizeEnd event doesn't fire. It's just boilerplate code I've been attaching to all my windows and I show it to be unambiguous with the state of my window.

The only thing I can think of is that there's something weird going on with the Upload control? Its generated markup is more complex than expected.

Thanks

Sean
Marin Bratanov
Telerik team
 answered on 31 Aug 2011
3 answers
378 views

Occasionally, I got the same message Sys.WebForms.PageRequestManagerParserErrorException:: The message received from the server could not be parsed. Common causes for this error are when the response is modified by calls to Response.Write(), response filters, HttpModules, or server trace is enabled.

Details: Error Parsing near 'Telerik.Web.UI.2008.'.
I thought it only happened on Telerik 2007 version. Are you sure it caused by my version is still a trial version one or something else ?

John Hadikusumo
Sebastian
Telerik team
 answered on 31 Aug 2011
2 answers
66 views
Hi,

on Sharepoint 2010 we create an ASPX Layout Page with multiple PageViews. The PageViews are dynamically added to TabStrip by code-behind. If we put the RadUpload in the PageView it doesn't shows the File-Input Control. After first click on "Upload"-Button the input is visible and can be used. I think the problem is related to the postback of TabStrip-Click ... but how to prevent/to require a full postback to the current PageView ...

Screenshot:


ASPX Page:
<telerik:radformdecorator id="FormDecorator1" runat="server"  DecoratedControls="all" Skin="Windows7" ControlsToSkip="Fieldset"></telerik:radformdecorator
 <telerik:RadAjaxLoadingPanel runat="server" ID="LoadingPanel1" Transparency="25" BackgroundPosition="Center">
        <div style="vertical-align:middle;text-align:center;width:100%;height:100%;background-color:white;font-weight:bolder;font-size:large">
            <img src="/_layouts/images/IFXForms/loading1.gif" alt="Loading ..." />
        </div>
 </telerik:RadAjaxLoadingPanel>
 
         <telerik:RadAjaxManager runat="server" ID="RadAjaxManager1">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="RadTabStrip1">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadTabStrip1" />
                        <telerik:AjaxUpdatedControl ControlID="RadMultiPage1" LoadingPanelID="LoadingPanel1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="RadMultiPage1">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadMultiPage1" LoadingPanelID="LoadingPanel1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>
 
        <script type="text/javascript">
 
            function onTabSelecting(sender, args) {
                if (args.get_tab().get_pageViewID()) {
                    args.get_tab().set_postBack(false);
                }
            }
        </script
<table>
<tr>
    <td valign="top">
<asp:UpdatePanel runat="server" ChildrenAsTriggers="true" UpdateMode="Conditional" ID="formUpdatePanel">  
<ContentTemplate>          
       <div style="padding-top: 10px;">
            <telerik:RadAjaxPanel runat="server" ID="RadAjaxPanel1" LoadingPanelID="LoadingPanel1">
                <div style="float:left; width:900px">
                    <telerik:RadTabStrip ID="RadTabStrip1" OnClientTabSelecting="onTabSelecting" SelectedIndex="0" runat="server" MultiPageID="RadMultiPage1" OnTabClick="RadTabStrip1_TabClick"
                         CssClass="tabStrip">
                    </telerik:RadTabStrip>
                    <div style="padding: 10px;border-style:solid;border-width:1px">
                    <asp:Literal ID="lMessage" runat="server" visible="false"></asp:Literal>
                   <telerik:RadMultiPage ID="RadMultiPage1" runat="server" SelectedIndex="0" OnPageViewCreated="RadMultiPage1_PageViewCreated" CssClass="multiPage">
                    </telerik:RadMultiPage>
                    </div>
                </div>
                <div class="previewWrapper">
 
                </div>
            </telerik:RadAjaxPanel>
        </div>
        <br/>
</ContentTemplate>
</asp:UpdatePanel>

ASPX code-behid:
protectedvoidPage_Load(objectsender, EventArgs e)
{
    initTabs();
    if(!Page.IsPostBack)
    {
        Filename = this.Request.QueryString.Get("data");
        itprData = deserializeData();
        lPageTitle.Text = string.Format("Purchase Request {0} ({1})", itprData.ID, itprData.ActiveStepID.ToString());
        lPageTitleInTitleArea.Text = string.Format("Purchase Request {0}", itprData.ID);
        foreach(KeyValuePair<string, string> pair intabs)
        {
            AddTab(pair.Key);
        }
        AddPageView(RadTabStrip1.FindTabByText("Request Info"));
    }
}      
privatevoidAddTab(stringtabName)
{
    RadTab tab = newRadTab();
    tab.Text = tabName;
  
    RadTabStrip1.Tabs.Add(tab);
}
  
protectedvoidRadMultiPage1_PageViewCreated(objectsender, RadMultiPageEventArgs e)
{
    stringuserControlName = e.PageView.ID + ".ascx";
  
    Control userControl = Page.LoadControl("~/_controltemplates/IFXForms/ITPR/"+ userControlName);
    userControl.ID = e.PageView.ID + "_userControl";
  
    e.PageView.Controls.Add(userControl);
}
  
privatevoidAddPageView(RadTab tab)
{
    RadPageView pageView = newRadPageView();
    pageView.ID = tabs[tab.Text];
    RadMultiPage1.PageViews.Add(pageView);
    pageView.CssClass = "pageView";
    tab.PageViewID = pageView.ID;
}
  
protectedvoidRadTabStrip1_TabClick(objectsender, RadTabStripEventArgs e)
{
    AddPageView(e.Tab);
    e.Tab.PageView.Selected = true;
}

PageView Control ASCX:

<telerik:RadScriptBlock ID="RadScriptBlock12" runat="server">
 <script type="text/javascript">
     // on upload button click temporarily disables ajax to perform
     // upload actions
     function conditionalPostback(sender, args) {
         if (args.get_eventTarget() == "<%= FileUploadButton.UniqueID %>") {
             args.set_enableAjax(false);
         }
     }
 </script>
</telerik:RadScriptBlock>
<telerik:RadAjaxPanel runat="server" id="RadAjaxPanel12"
 ClientEvents-OnRequestStart="conditionalPostback">
 <telerik:RadUpload runat="server" id="RadUpload1" EnableFileInputSkinning="false" />
 <asp:Button id="FileUploadButton" runat="server" text="Upload" OnClick="SubmitButton_Click" />
</telerik:RadAjaxPanel>

D4
Top achievements
Rank 1
 answered on 31 Aug 2011
4 answers
138 views
Hi,
I am using RadGrid as node Templates in Radtree. Radgrid has suppoort to add/edit the fields. When Radgrid goes into add/edit mode & I press spacebar in Textbox inside the radgrid automatically root tree node gets selected & on presseing left/right arrow keys tree refreshes. How I can stop selecting the tree node on pressing space key inside the textbox. I tried disabling the onkeydown event

tree.detachEvent("onkeydown",tree.onkeydown);  for tree but it did not work.


Thanks.

Nikolay Tsenkov
Telerik team
 answered on 31 Aug 2011
1 answer
102 views
I have RadGrid with many columns and selectable rows, here is its code:

<telerik:RadGrid AutoGenerateColumns="false" ID="RadGrid1" AllowMultiRowSelection="true" OnNeedDataSource="RadGrid1_NeedDataSource" OnItemCreated="RadGrid1_ItemDataBound" OnPreRender="RadGrid1_PreRender"
            Width="2000px" AllowFilteringByColumn="True" AllowSorting="True"
            PageSize="20" ShowGroupPanel="true" ShowStatusBar="true" ShowFooter="True" AllowPaging="True" runat="server"
            GridLines="Both" EnableLinqExpressions="true">
            <PagerStyle Mode="NextPrevNumericAndAdvanced"></PagerStyle>
            <GroupingSettings CaseSensitive="false" />
            <MasterTableView AutoGenerateColumns="false" GroupsDefaultExpanded="false" CommandItemDisplay="None" EditMode="InPlace"  AllowFilteringByColumn="True" DataKeyNames="VendorChargeId"
                ShowFooter="True" TableLayout="Fixed">               
                 
                <Columns>
                 
                <telerik:GridClientSelectColumn UniqueName="ClientSelectColumn">
                <HeaderStyle Width="40px"/>
                </telerik:GridClientSelectColumn>                                       
 
                <telerik:GridCheckBoxColumn  DataType="System.Boolean" AllowFiltering="true" HeaderText="Requires Comment" Groupable="false" DataField="RequiresComments" UniqueName="RequiresComments" ReadOnly="false" >
                        <HeaderStyle Width="80px"/>
                    </telerik:GridCheckBoxColumn>
 
                    <telerik:GridTemplateColumn UniqueName="TemplateEditColumn" HeaderText="Comments">                       
                        <ItemTemplate><asp:LinkButton ID="ShowComment" runat="server" OnClick='<%# String.Format("ShowComment({0}); return false;",Eval("VendorChargeId")) %>'  Text='<%# Eval("Comments") %>'></asp:LinkButton></ItemTemplate>
                    </telerik:GridTemplateColumn>
                    <telerik:GridDateTimeColumn  FilterControlWidth="105px" DataField="ChargeDate" HeaderText="Transaction Date" DataFormatString="{0:dd/MM/yyyy}"
                        UniqueName="ChargeDate" AutoPostBackOnFilter="true" AllowSorting="true" AllowFiltering="false" Groupable="true" ShowFilterIcon="false">
                        <HeaderStyle Width="80px"/>
                        <ItemStyle Width="80px" />
                    </telerik:GridDateTimeColumn >
                     
                    <telerik:GridBoundColumn AllowFiltering="true" FilterControlWidth="40px" Groupable="true" DataField="Resource" UniqueName="Resource" HeaderText="Resource">
                        <HeaderStyle Width="80px"/>
                        <ItemStyle Width="80px" />
                    </telerik:GridBoundColumn>
 
                    <telerik:GridBoundColumn AllowFiltering="true" Groupable="true" DataField="Researcher" UniqueName="Researcher" HeaderText="Researcher"></telerik:GridBoundColumn>
 
                    <telerik:GridBoundColumn AllowFiltering="true" Groupable="true" DataField="ResearcherValid" UniqueName="ResearcherValid" HeaderText="ResearcherValid" Visible="false"></telerik:GridBoundColumn>
 
                    <telerik:GridBoundColumn AllowFiltering="true" Groupable="true" DataField="Timekeeper" UniqueName="Timekeeper" HeaderText="Timekeeper"></telerik:GridBoundColumn>
 
                    <telerik:GridBoundColumn AllowFiltering="true" Groupable="true" DataField="TimekeeperValid" UniqueName="TimekeeperValid" HeaderText="TimekeeperValid" Visible="false"></telerik:GridBoundColumn>
 
                    <telerik:GridBoundColumn AllowFiltering="true" Groupable="true" DataField="MatterNumber" UniqueName="MatterNumber" HeaderText="Matter Number"></telerik:GridBoundColumn>
 
                    <telerik:GridBoundColumn AllowFiltering="true" Groupable="true" DataField="MatterName" UniqueName="MatterName" HeaderText="Matter Name"></telerik:GridBoundColumn>
 
                    <telerik:GridBoundColumn AllowFiltering="true" Groupable="true" DataField="MatterValid" UniqueName="MatterValid" HeaderText="MatterValid" Visible="false"></telerik:GridBoundColumn>
 
                    <telerik:GridBoundColumn AllowFiltering="true" Groupable="true" DataField="ClientName" UniqueName="ClientName" HeaderText="Client Name"></telerik:GridBoundColumn>
 
                    <telerik:GridBoundColumn AllowFiltering="true" Groupable="true" DataField="ChargeService" UniqueName="ChargeService" HeaderText="Service"></telerik:GridBoundColumn>
 
                    <telerik:GridBoundColumn AllowFiltering="true" Groupable="true" DataField="ChargeDescription" UniqueName="ChargeDescription" HeaderText="Charge Description">
                    <ItemStyle Width="180px" />
                    <HeaderStyle Width="180px" />
                    </telerik:GridBoundColumn>
 
                    <telerik:GridBoundColumn AllowFiltering="true" FilterControlWidth="50px" Groupable="false" DataField="ChargeDatabaseTime" UniqueName="ChargeDatabaseTime" HeaderText="Database Time">
                        <HeaderStyle Width="90px"/>
                        <ItemStyle Width="90px" />
                    </telerik:GridBoundColumn>
 
                    <telerik:GridBoundColumn AllowFiltering="true" Groupable="false" DataField="TransactionCount" UniqueName="TransactionCount" HeaderText="Transactions"></telerik:GridBoundColumn>
                    <telerik:GridMaskedColumn FilterControlWidth="70px" AllowFiltering="true" Groupable="true" DataField="TotalCharge" UniqueName="TotalCharge" HeaderText="Total Charge" SortExpression="TotalCharge" DataType="System.Double" Aggregate="Sum" DataFormatString="{0:0.00}" FooterAggregateFormatString="Grand Total: {0:0.00}" >                   
                    </telerik:GridMaskedColumn>
                     
                    <telerik:GridTemplateColumn FilterControlWidth="85px" UniqueName="VendorChargeIdLink" HeaderText="Import Raw Data" AllowFiltering="false" Groupable="false">
                        <ItemTemplate>
                            <asp:LinkButton ID="ShowRawData" runat="server" OnClick='<%# String.Format("ShowRecords({0}); return false;",Eval("VendorChargeId")) %>'  Text='<%# Eval("VendorChargeId") %>'></asp:LinkButton>
                        </ItemTemplate>
                        <HeaderStyle Width="80px"/>
                        <ItemStyle Width="80px" />
                    </telerik:GridTemplateColumn>
                     
                    <telerik:GridBoundColumn AllowFiltering="false" Groupable="false" DataField="VendorChargeId" UniqueName="VendorChargeId" HeaderText="Id" Display="false">
                    <HeaderStyle Width="30px" />
                </telerik:GridBoundColumn>
                </Columns>
                 <CommandItemSettings ShowExportToExcelButton="true" ShowAddNewRecordButton="false" />
                  
            </MasterTableView>
            <ExportSettings IgnorePaging="true" ExportOnlyData="true" HideStructureColumns="true" OpenInNewWindow="true" FileName="Export">
                 
            </ExportSettings>
            <ClientSettings AllowDragToGroup="true">
                <Selecting AllowRowSelect="true" EnableDragToSelectRows="true" />
                <Scrolling AllowScroll="false" />
            </ClientSettings>
        </telerik:RadGrid>

the problem is with Comments column which is template column (its UniqueName is TemplateEditColumn) , in IE 8 when I select a row it looks corrupted:

http://screencast.com/t/QkJzsLZU5bv

It looks fine in IE 9 and Firefox 5.
Galin
Telerik team
 answered on 31 Aug 2011
1 answer
241 views
hi i open radwindow with the following code , my problem is if i set VisibleOnPageLoad=true the code is working but each time the page post back the Radwindow open again if i set VisibleOnPageLoad=false couldn't open radwindow
Dim RW As New RadWindow
RW.NavigateUrl = "Search.aspx"
RW.VisibleOnPageLoad = True
RW.Width = New Unit(720, UnitType.Pixel)
RW.Height = New Unit(532, UnitType.Pixel)
RW.VisibleStatusbar = False
RW.MaxWidth = New Unit(720, UnitType.Pixel)
RW.MaxHeight = New Unit(532, UnitType.Pixel)
RW.OnClientClose = "OnClientClose"
RW.Modal = True
RadWindowManager1.Windows.Add(RW)            
Princy
Top achievements
Rank 2
 answered on 31 Aug 2011
3 answers
251 views
How can I show the group footer when the group is collapsed?  So that the collapsed group would show the header with the name and expand/collapse button, and directly below it the footer with all the aggregates for the group.
Thanks
Pavlina
Telerik team
 answered on 31 Aug 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?