Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
120 views
Hi,
I am using a radupload and I have set the skin to windows 7. However, I would also like to separtely set the backcolor of the input to a particular color. How can I do this?
Thanks ... Ed
Ed Staffin
Top achievements
Rank 1
 answered on 13 Aug 2010
1 answer
253 views
Hi, i have a radgrid with, a link column, and on itemcommand i want to open a radwindow by server side, i try this:
but the window can't show
thanks

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
                    <AjaxSettings>
                        <telerik:AjaxSetting AjaxControlID="rgrAnalisi">
                            <UpdatedControls>
                                <telerik:AjaxUpdatedControl ControlID="rgrAnalisi" 
                                    LoadingPanelID="RadAjaxLoadingPanel1" />
                            </UpdatedControls>
                        </telerik:AjaxSetting>
                    </AjaxSettings>
                </telerik:RadAjaxManager>
  
                <telerik:RadWindowManager ID="RadWindowManager1" runat="server" 
                    EnableViewState="False">
                </telerik:RadWindowManager>
  
                <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Default">
                </telerik:RadAjaxLoadingPanel>
  
  
                  <telerik:RadCodeBlock ID="RadCodeBlock2" runat="server">
                        <script type="text/javascript">
                        <!--
  
                            function gridCommand(sender, args) {
                                if (args.get_commandName() == "Rapportino" || args.get_commandName() == "DownloadAttachment") {
                                    var manager = $find('<%= RadAjaxManager.GetCurrent(Page).ClientID %>');
                                    manager.set_enableAJAX(false);
  
                                    setTimeout(function () {
                                        manager.set_enableAJAX(true);
                                    }, 0);
                                }
                            }
  
                            function conditionalPostback(sender, eventArgs) {
                                var theRegexp = new RegExp("\.UpdateButton$|\.PerformInsertButton$", "ig");
                                var eventArgument = eventArgs.get_eventArgument();
  
                                if (eventArgument.indexOf("Update") > -1 || eventArgument.indexOf("PerformInsert") > -1) {
                                    if (upload && upload.getFileInputs()[0].value != "") {
                                        eventArgs.set_enableAjax(false);
                                    }
                                }
                            }
                            -->
                        </script>
                </telerik:RadCodeBlock>
  
  
                <telerik:RadGrid runat="server" ID="rgrAnalisi" Skin="Vista"
                        AllowPaging="True" AllowSorting="True" GridLines="None" PageSize="12"
                        style="margin-top: 100px; margin-left:27px;"  Width="900px" 
                        ShowGroupPanel="True"
                    ondetailtabledatabind="rgrAnalisi_DetailTableDataBind" 
                    oncolumncreated="rgrAnalisi_ColumnCreated" 
                    onitemdatabound="rgrAnalisi_ItemDataBound" 
                    onitemcommand="rgrAnalisi_ItemCommand">
  
                        <GroupingSettings CaseSensitive="false" />
                        <PagerStyle Mode="NumericPages"/>
                        <ClientSettings>
                        <Selecting  AllowRowSelect="true"/>
                        <ClientEvents OnCommand="gridCommand" />
                        </ClientSettings>
  
                        <MasterTableView ShowHeadersWhenNoRecords="true" >
                             <DetailTables>
                                <telerik:GridTableView Name="Customer" Width="100%">
                                    <Columns>
                                            <telerik:GridBoundColumn UniqueName="colCustomer" HeaderText="Cliente" Visible="false">
                                            </telerik:GridBoundColumn>
                                            <telerik:GridBoundColumn UniqueName="colComm" HeaderText="Commessa" Visible="false">
                                            </telerik:GridBoundColumn>
                                    </Columns>
                                    <DetailTables>
                                        <telerik:GridTableView Name="Commesse" Width="100%">
                                            <Columns>
                                            <telerik:GridBoundColumn UniqueName="colCustomer" HeaderText="Cliente" Visible="false">
                                            </telerik:GridBoundColumn>
                                            <telerik:GridBoundColumn UniqueName="colComm" HeaderText="Commessa" Visible="false">
                                            </telerik:GridBoundColumn>
                                            </Columns>
                                                <DetailTables>
                                                    <telerik:GridTableView Name="Rapportini" Width="100%">
                                                    <Columns>
                                                        <telerik:GridBoundColumn UniqueName="colCustomer" HeaderText="Cliente" Visible="false">
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridBoundColumn UniqueName="colComm" HeaderText="Commessa" Visible="false">
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridTemplateColumn UniqueName="colView" ItemStyle-HorizontalAlign="Center" AllowFiltering="false">
                                                            <ItemTemplate>
                                                                <asp:Image runat="server" ID="linkView" ImageUrl="~/images/Zoom.png">
                                                                </asp:Image>
                                                                <telerik:RadToolTip runat="server" Width="300" Height="300" RenderInPageRoot="true" ShowEvent="OnMouseOver"
                                                                        HideEvent="ManualClose" HideDelay="2" ID="Tooltip" Position="TopRight" Animation="Resize"
                                                                        RelativeTo="Element" >
                                                                </telerik:RadToolTip>
                                                            </ItemTemplate>
                                                        </telerik:GridTemplateColumn>
                                                        <telerik:GridTemplateColumn UniqueName="colView" ItemStyle-HorizontalAlign="Center" AllowFiltering="false">
                                                            <ItemTemplate>
                                                                <asp:LinkButton runat="server" ID="linkRappo" Text="Rapportino" CommandName="Rapportino">
                                                                </asp:LinkButton>
                                                            </ItemTemplate>
                                                        </telerik:GridTemplateColumn>
                                                    </Columns>
                                                    </telerik:GridTableView>
                                                </DetailTables>
                                        </telerik:GridTableView>
                                    </DetailTables>
                                </telerik:GridTableView>
                        </DetailTables>                  
                        <Columns>
                            <telerik:GridBoundColumn UniqueName="colMese" Visible="false">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn UniqueName="colEseguite" Visible="false">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn UniqueName="colAddebitare" Visible="false">
                            </telerik:GridBoundColumn>
                        </Columns>
                        </MasterTableView>
                </telerik:RadGrid>
protected void rgrAnalisi_ItemCommand(object source, GridCommandEventArgs e)
    {
        if (e.CommandName == "Rapportino")
        {
            GridDataItem item = e.Item as GridDataItem;
            short Year = short.Parse(txtYear.Text); ;
            int Number = int.Parse(item["NumeroRappo"].Text);
            Session.Add("RappoYear", Year);
            Session.Add("RappoNumber", Number);
            Session.Add("RappoProvenience", "Rapportini");
            RadWindowManager manager = new RadWindowManager();
            RadWindow newwindow = new RadWindow();
            newwindow.ID = "RadWindow2";
            newwindow.NavigateUrl = "Rapportino.aspx";
            newwindow.VisibleTitlebar = true;
            newwindow.Behaviors = WindowBehaviors.Close;
            newwindow.VisibleOnPageLoad = true;
            manager.Windows.Add(newwindow);  
        }
    }
Shinu
Top achievements
Rank 2
 answered on 13 Aug 2010
8 answers
529 views
I am un sure why I am getting this javascript error when trying to use the radopen java script functionality:

Error: Object doesn't support this property or method.

This sample code produces the error:

<head runat="server">

<title>Test Page</title>

<script>

function openWindow()

{

alert("openWindow Activated");

var oWnd = window.radopen("http://www.yahoo.ca", "RadWindow1");

}

</script>

</head>

<body>

<form id="form1" runat="server">

<div>

&nbsp;</div>

<asp:ScriptManager ID="ScriptManager1" runat="server">

</asp:ScriptManager>

<telerik:RadWindow ID="RadWindow1" runat="server">

</telerik:RadWindow>

<button onclick="openWindow();return false;" class="Button" style="WIDTH:190px">

Show window (using radopen)

</button>

</form>

</body>

</html>


Kyle

Deepak Zala
Top achievements
Rank 1
 answered on 13 Aug 2010
1 answer
63 views
as I can move keys in the radgrid
Princy
Top achievements
Rank 2
 answered on 13 Aug 2010
1 answer
121 views
Hey everyone,

I have a RadGrid that pops open the Insert/Edit form.  This at one point worked fine, but is now trying to download the ASPX file from the server.  When someone clicks on "Edit" or "Add new record", IE is trying to download the ASPX file and then giving an error that reads:

    Unable to download [File Name] from [Server Name]
    Unable to open this Internet site.  The requested site is either unavailable or cannot be found.
    Please try again later.

I don't believe there is anything special about the grid's definition, but I pasted it below in case I'm just not seeing something:

Thanks a lot,
Greg

<telerik:RadGrid ID="gridDelegates" runat="server" 
    AutoGenerateColumns="False" GridLines="Both"
    OnNeedDataSource="gridDelegates_NeedDataSource"
    OnInsertCommand="gridDelegates_InsertCommand"  
    OnUpdateCommand="gridDelegates_UpdateCommand" 
    OnDeleteCommand="gridDelegates_DeleteCommand">
      
    <MasterTableView AutoGenerateColumns="false" DataKeyNames="ID" CommandItemDisplay="Top" EditMode="PopUp">
        <NoRecordsTemplate>
            No delegates have been assigned.
        </NoRecordsTemplate>
        <RowIndicatorColumn>
            <HeaderStyle Width="20px"></HeaderStyle>
        </RowIndicatorColumn>
        <ExpandCollapseColumn>
            <HeaderStyle Width="20px"></HeaderStyle>
        </ExpandCollapseColumn>
          
        <Columns>
            <telerik:GridEditCommandColumn UniqueName="colEdit" />
            <telerik:GridBoundColumn HeaderText="Name" UniqueName="colNameOfDelegate" DataField="NameOfDelegate">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn HeaderText="Start Date" DataFormatString="{0:MM-dd-yyyy}"  UniqueName="colStartDate" DataField="StartDate">
                <ItemStyle Width="68px" />
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn HeaderText="End Date" DataFormatString="{0:MM-dd-yyyy}" UniqueName="colEndDate" DataField="EndDate">
                <ItemStyle Width="65px" />
            </telerik:GridBoundColumn>
              
            <telerik:GridBoundColumn UniqueName="colOffice" HeaderText="Office" DataField="Office">
                <ItemStyle Width="60px" />
            </telerik:GridBoundColumn>
              
            <telerik:GridTemplateColumn UniqueName="colFullDept" HeaderText="Department">
                <ItemStyle Width="60px" />
                <ItemTemplate>
                    <span><%# DataBinder.Eval(Container.DataItem, "Dept")%>-<%# DataBinder.Eval(Container.DataItem, "SubDept")%></span>
                </ItemTemplate>
            </telerik:GridTemplateColumn>
              
            <telerik:GridButtonColumn ConfirmText="Are you sure you want to delete this delegate? <br/><br/>Click 'OK' to delete.<br/><br/>" 
                                    ConfirmDialogType="RadWindow"
                                    ConfirmTitle="Delete Confirmation"
                                    ButtonType="ImageButton" 
                                    CommandName="Delete" Text="Delete"
                                    UniqueName="colDeleteColumn">
                            <ItemStyle HorizontalAlign="Center" Width="30px" />
             </telerik:GridButtonColumn>
              
            <telerik:GridBoundColumn UniqueName="colSupervisor" DataField="Supervisor" Visible="false" Display="false" />
            <telerik:GridBoundColumn UniqueName="colDelegate" DataField="Delegate" Visible="false" Display="false" />
            <telerik:GridBoundColumn UniqueName="colDept" DataField="Dept" Visible="false" Display="false" />
            <telerik:GridBoundColumn UniqueName="colSubDept" DataField="SubDept" Visible="false" Display="false" />
            <telerik:GridBoundColumn UniqueName="colIsActive" DataField="IsActive" Visible="false" Display="false" />
        </Columns>
          
        <EditFormSettings UserControlName="~/UserControls/DelegationEditor.ascx"
               EditFormType="WebUserControl"  CaptionDataField="NameOfDelegate" CaptionFormatString="Delegate rule for {0}"
               InsertCaption="New Delegate">
        </EditFormSettings>
    </MasterTableView>
</telerik:RadGrid>
Pavlina
Telerik team
 answered on 13 Aug 2010
3 answers
221 views

Can you invoke radalert or radconfirm or radprompt from code behind?

I am experimenting on the radpanel bar to be my menu items. I have the following code. When user choose delete, I would like to show radconfim and when user chooses to enter, I would like to show radprompt.  Can this be done with Radconfirm and Radprompt? If not please suggest if there is any way to achieve this?

Protected Sub RadPanelBar1_ItemClick(ByVal sender As Object, ByVal e As Telerik.Web.UI.RadPanelBarEventArgs) Handles RadPanelBar1.ItemClick
        If e.Item.Items.Count > 0 Then
            If e.Item.Text <> "Print" Then
                "You clicked on top level item. Click on the child item."
            End If
            If e.Item.Text <> "Issuance" Then
                "You clicked on top level item. Click on the child item."
            End If
        Else
            If e.Item.Value = "VIEW" Then
  
            ElseIf e.Item.Value = "UPDATE" Then

            ElseIf e.Item.Value = "SAVE" Then

            ElseIf e.Item.Value = "DELETE" Then

            ElseIf e.Item.Value = "ENTER" Then

         
            End If
        End If
    End Sub

Thank in advance.

Shinu
Top achievements
Rank 2
 answered on 13 Aug 2010
4 answers
168 views
Hi,

I have found a fault in the Scheduler layout - I'm using Timeline view with manual Resource setup and web service based appointments.

It appears that when there are only a few timelines on the grid, the visible part of the grid is too high. This results in the timelines being displayed too high (even though I have insert area switched off I get a double height line), and the resource label cells are actually the right size, but spaced apart from one another.

I have found that the rsVerticalHeaderWrapper has a calculated height of 162px as does the bare div directly beneath it. Removing this style closes up the gaps in the resource headers, but the grid itself does not get any flatter, so I guess that this is some sort of minimum height setting. I haven't seen a minimum height setting however.

The grid displays this behaviour when I remove all of my own CSS and client-side script.

Any Ideas?

Thanks for your help.
Peter
Telerik team
 answered on 13 Aug 2010
1 answer
172 views

Currently I'm having this kind of issue when creating a dynamic raddock and adding the treeview control on it. I also followed this demo http://demos.telerik.com/aspnet-ajax/dock/examples/myportal/defaultcs.aspx but still having a problem during expanding the treeview control or clicking on it.

The message says "The target 'ct100$ContentPlaceHolder1$RadDock3$C$Treeview1' for the callback could not be found or did not implement ICallBackEventHandler."

Please let me know how to find a way on this..

Here are my sample codes:

Private 

 

Sub LivelinkTreeView(ByVal treeview As RadTreeView)

 

 

 

 

 

 

Dim rootNode As New RadTreeNode()

 

rootNode.Text = hdnFundName.Value

rootNode.Value = hdnFundObjectID.Value

 

 

 

rootNode.ImageUrl = "~\App_Themes\Image\main.png"

 

 

 

 

 

 

rootNode.Width = "25"

 

 

 

 

 

 

rootNode.Height = "25"

 

 

 

 

 

 

rootNode.Expanded = True

 

 

 

 

 

 

rootNode.ExpandMode = TreeNodeExpandMode.ServerSideCallBack

 

treeview.Nodes.Add(rootNode)

 

 

 

End Sub 

 

 

 

 

 

Private Function CreateRadDock(ByVal c As Control, ByVal dockName As String, ByVal iCount As Integer) As RadDock 

 

 

 

Dim docksCount As Integer = CurrentDockStates.Count 

 

Dim dock As New RadDock()

 

 

 

dock.ID =

 

 

 

String.Format("RadDock" & iDockCount, iDockCount)

 

 

dock.Title =

 

 

 

String.Format(dockName)

 

 

dock.Font.Bold =

 

 

 

True

 

 

 

 

 

 

dock.UniqueName = Guid.NewGuid().ToString()

 

dock.Width = Unit.Percentage(100)

dock.Skin =

 

 

"Web20"

 

 

 

 

 

dock.OnClientInitialize = "OnClientInitialize"

 

 

 

 

 

 

dock.Attributes.Add("Style", "margin-top:10px;margin-left:10px")

 

 

dock.DefaultCommands = Telerik.Web.UI.Dock.DefaultCommands.ExpandCollapse

dock.EnableDrag =

 

 

 

False

 

 

 

 

 

 

dock.EnableRoundedCorners = True

 

 

 

 

 

 

dock.EnableAnimation = True

 

 

 

 

 

 

dock.ContentContainer.Controls.Add(c) 

 

 

 

 

Return dock

 

 

 

End Function

 

 

 


Private Sub CreateDockDocumentInformation() 

 

 

 

 

 

 

LivelinkTreeView(rtvLivelink)

 

 

 

 

Dim dock As RadDock = CreateRadDock(Treeview1, "Document Information", icnt)

 

 

RadDockZone1.Controls.Add(dock)

iDockCount += 1

 

 

 

CreateSaveStateTrigger(dock)

 

 

LoadWidget(dock)

 

 

 

 

 

 

 

 

End Sub

 

 

 


 

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

 

If Not IsPostBack Then

 

 

 

 

 

 

   CreateDockDocumentInformation()

 

 

 

 

 

 

End If

 

 

 

 

 

 

End Sub

 

 

 

 

 

 

 

 

 

 

Private Sub LoadWidget(ByVal dock As RadDock) 

 

If String.IsNullOrEmpty(dock.Tag) Then

 

 

 

 

 

 

Return

 

 

 

 

 

 

End If

 

 

 

 

 

 

Dim widget As Control = LoadControl(dock.Tag)

 

 

dock.ContentContainer.Controls.Add(widget)

 

 

 

 

End Sub

 

 

 

 

 

 

 

Private Sub CreateSaveStateTrigger(ByVal dock As RadDock)

 

 

 

 

 

dock.AutoPostBack = True

 

 

 

 

dock.CommandsAutoPostBack = True

 

 

 

 

 

Dim saveStateTrigger As New AsyncPostBackTrigger()

 

 

 

saveStateTrigger.ControlID = dock.ID

saveStateTrigger.EventName =

 

 

 

"DockPositionChanged"

 

 

 

 

 

 

UpdatePanel1.Triggers.Add(saveStateTrigger)

 

saveStateTrigger =

 

 

New AsyncPostBackTrigger()

 

 

saveStateTrigger.ControlID = dock.ID

saveStateTrigger.EventName =

 

 

"Command"

 

 

 

 

 

 

UpdatePanel1.Triggers.Add(saveStateTrigger)

 

 

 

 

End Sub

 

Is there any limitation on this on binding the treeview control on the dynamic raddock?

Thanks,
Allan
Petio Petkov
Telerik team
 answered on 13 Aug 2010
1 answer
248 views
Hi,

I use a RadGrid to show data. When there are +10 rows, the AllowScroll property is set to true to limit the maximum height of the grid.

When an item is selected, another page is loaded with the same grid (no postback). I would like the selected item to be visible, even when it is not 1 of the first 10 rows. The grid should thus scroll to the selected row.

Can this be achieved?

Kind regards,
Dries
Princy
Top achievements
Rank 2
 answered on 13 Aug 2010
3 answers
198 views
I have a code with a radajaxmanager on when enableajax="false" the jquery works a dream, but when I set it to true it doenst work.....  even if I put an alert('hello'); in at the first line it doesnt call it... any ideas:

Code reassables along the lines of:

<telerik:RadAjaxManager ID="ram" runat="server" DefaultLoadingPanelID="ralp" EnableAJAX="TRUE">
    <AjaxSettings>

<asp:MultiView ID="mv" runat="server" ActiveViewIndex="0">
<asp:View ID="viewHorseDetails" runat="server">
        <asp:Repeater ID="rptHorseDetails" runat="server">
            <ItemTemplate>
                        <li>
                            <label>
                                Remarks/Description<br />(Up to 100 words)</label>
                            <asp:TextBox ID="txtRemarks" runat="server" TextMode="MultiLine" Columns="40" Rows="8" CssClass="text"
                                Text="" ValidationGroup="HorseDetails" /><br />(this textbox accepts 100 characters)
                            <span id="spn" runat="server"></span><br />
                        </li>
                            <telerik:RadScriptBlock ID="rsbDesc" runat="server">
                                <script type="text/javascript">
                                    $(function () {
                                        /*alert('bleh');*/
                                        var limit = 10;
                                        var tb = $('textarea[id$=txtRemarks]');
                                        $(tb).keyup(function () {
                                            var len = $(this).val().length;
                                            if (len > limit) {
                                                //this.value = this.value.substring(0, 50);
                                                $(this).addClass('exceeded');
                                                $('#spn').text(len - limit + " characters exceeded");
                                            }
                                            else {
                                                $(this).removeClass('exceeded');
                                                $('#spn').text(limit - len + " characters left");
                                            }
                                        });

                                        $('input[id$=btnFinal]').click(function (e) {
                                            var len = $(tb).val().length;
                                            if (len > limit) {
                                                e.preventDefault();
                                            }
                                        });
                                    });
                                </script>
                            </telerik:RadScriptBlock>
                        <fieldset class="submit">
                            <asp:Button ID="btnNextHorse" runat="server" Text="Next Horse" CssClass="submit" CommandName="NextHorse" ValidationGroup="HorseDetails" />&nbsp;<asp:Button ID="btnFinal" CssClass="submit" runat="server" Text="This is the last horse I am entering" CommandName="FinalHorse" ValidationGroup="HorseDetails" />
                        </fieldset>

            </ItemTemplate>
        </asp:Repeater>
    </asp:View>   
</asp:MultiView>

Any ideas?

Thanks,
Chris
Missing User
 answered on 13 Aug 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?