Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
172 views
I have made a dataTableAdapter and defined it as a source for my radGrid. Everything is fine, I am getting all columns from my table but have changed datetime format using DATEADD(dd, 0, DATEDIFF(dd, 0, DateTime)).  Now i just need to sort all my records in descending order (thats it latest ones first). So I have tried sorting it in my query using Order By clause and through sortExpressions in radGrid as well. But its not working...please help me!
Iana Tsolova
Telerik team
 answered on 08 Dec 2008
6 answers
107 views

Hi,
I'm trying to do the following :
If the user decides to press x of the Explorer (close)  , while running my web application , I added a message asking is he sure
want to do it.

But my problem was that each button pressed on screen , caused this message to apper.

So , what I did is wrote the following functions and used them in order to prevent appearance of the message

In each button that appears on the page i added event :

 

OnClientClick

="javascript:ToggleBeforeUnload();"

 

 

BUT WHEN I'M TRYING TO SORT COLUMNS IN GRID , I STILL GET THE MESSAGE  :(

I need your advise please on which even I must run  ToggleBeforeUnload() or is there another solution ?

Thanks a lot !


--------- The functions I've wrote -------------

var

suppressWarningMsg = false;

 

 

Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(BeginRequestHandler);

 

 

function BeginRequestHandler(sender, eventArgs)

 

{

    suppressWarningMsg =

true;

 

}

Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);

 

 


function
EndRequestHandler(sender, eventArgs)

 

{

suppressWarningMsg =

false;

 

}

 

 

function ConfirmExit()

 

{

 

        if (!suppressWarningMsg)

 

       {

 

                  return 'SURE WANNA EXIT ?;

 

       }

}

 

window.onbeforeunload = ConfirmExit;

 

var onOff = false;

 

 

 

function ToggleBeforeUnload(onOff)

 

{

 

 

if (onOff == true)

 

{

window.onbeforeunload = ConfirmExit;

// Activate beforeunload event handler

 

}

 

else

 

{

window.onbeforeunload =

null;

 

}

}

Rosen
Telerik team
 answered on 08 Dec 2008
1 answer
110 views
Hi,

I am using telerik menu in my application.  In firefox the dropdown for menu is not getting visible. But in IE it works fine. I saw in some forums to make position as absolute, so I gave like that for the td which contains this menu, Then it was looking good in firefox but then not looking good in IE. Is there any solution by which it can work in both?

Jincy
Yana
Telerik team
 answered on 08 Dec 2008
4 answers
211 views
Hello,
I have a RadEditor which I am filling with html content server side on the page initial load and I also disable it server side on page initial load so that it will show as a regular label. I have AutoResizeHeight="true" and I don't have a height set and the text inside of it is overlapping controls below it. Here is the code I am using. Please tell me what I am doing wrong.

        <div style="margin-bottom: 12px;"
            <div style="margin-bottom: 8px;"
                Describe the reason: 
                <asp:RequiredFieldValidator ID="rfvSituation" ControlToValidate="situation" runat="server" ErrorMessage="Please enter the reason.">*</asp:RequiredFieldValidator> 
            </div> 
            <telerik:RadEditor ID="situation" runat="server" ToolsFile="~/App_Data/RadEditor/BasicTools.xml" ContentAreaCssFile="~/css/RadEditorContentArea.css" Skin="Vista" Width="100%" EnableResize="true" AutoResizeHeight="true"
                <Content> 
                </Content> 
                <SpellCheckSettings DictionaryPath="~/App_Data/RadSpell" SpellCheckProvider="PhoneticProvider" DictionaryLanguage="en-US" /> 
            </telerik:RadEditor> 
        </div> 

Rumen
Telerik team
 answered on 08 Dec 2008
1 answer
156 views

I thought this was addressed in Q2 as stated in the following thread http://www.telerik.com/community/forums/aspnet-ajax/ajax/radajaxmanager-and-asp-net-validators.aspx

but i am stilling haveing the same problem,
to repo the problem
I undrestaned that if i set enableclientside... it will work but this is not an option for me.

1. fill out both textboxes (page valid)
2. click the button (all good)
3. remove content of text boxes(one or both),
4. click button and no validation summary

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="Button1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="vldSummary2" LoadingPanelID="LoadingPanel3" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <telerik:RadAjaxLoadingPanel ID="LoadingPanel3" runat="server">
        <img alt='' src='<%= RadAjaxLoadingPanel.GetWebResourceUrl(Page, "Telerik.Web.UI.Skins.Default.Ajax.loading1.gif") %>' />
    </telerik:RadAjaxLoadingPanel>
    <asp:ValidationSummary ID="vldSummary2" runat="server" />
    <table>
        <tr>
            <td>
                <asp:Label ID="Label2" runat="server" Text="first"></asp:Label>
                <asp:RequiredFieldValidator ID="vldFirstNameSearc" runat="server" ControlToValidate="txtFirstNameSearch"
                    ErrorMessage="first required" Display="None">
                                          
                </asp:RequiredFieldValidator>
            </td>
            <td>
                <asp:Label ID="Label3" runat="server" Text="last"></asp:Label>
                <asp:RequiredFieldValidator ID="vldLastNameSearch" runat="server" ControlToValidate="txtLastNameSearch"
                    ErrorMessage="last requried" Display="None">
                                         
                </asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td>
                <asp:TextBox ID="txtFirstNameSearch" runat="server" MaxLength="50" Width="85px"></asp:TextBox>
            </td>
            <td>
                <asp:TextBox ID="txtLastNameSearch" runat="server" MaxLength="50" Width="85px"></asp:TextBox>
            </td>
        </tr>
    </table>
    <asp:Button ID="Button1" runat="server" Text="Next" />
    <telerik:RadMultiPage ID="mpRes" runat="server" SelectedIndex="0">
        <telerik:RadPageView ID="pvSearch" runat="server">
        </telerik:RadPageView>
    </telerik:RadMultiPage>
    </form>
</body>
</html>

Maria Ilieva
Telerik team
 answered on 08 Dec 2008
1 answer
177 views
Greetings,

I downloaded the ASP.NET AJAX trial and I'm trying to use the grid control. I set up my web.config for AJAX 3.5, added the Telerik.Web.UI to the GAC, and added the necessary <SafeControls> to the web.config.

I'm trying to make a Sharepoint web part that just displays the grid. I'm following along in the help file but I've run into a problem. When I make any referece to a Telerik object Sharepoint display the very helpful error page. 

"An unexpected error has occurred."

I've sifted though all the log files that I can possibly locate and have found absolutely nothing to go on. 

Here is the code that I'm using for the OnInit. This right out of the help file. 

Protected Overloads Overrides Sub OnInit(ByVal e As EventArgs)
            MyBase.OnInit(e)
            Page.ClientScript.RegisterStartupScript(GetType(DealerPortal), Me.ID, "_spOriginalFormAction = document.forms[0].action;_spSuppressFormOnSubmitWrapper=true;", True)
            If Me.Page.Form IsNot Nothing Then
                Dim formOnSubmitAtt As String = Me.Page.Form.Attributes("onsubmit")
                If Not String.IsNullOrEmpty(formOnSubmitAtt) AndAlso formOnSubmitAtt = "return _spFormOnSubmitWrapper();" Then
                    Me.Page.Form.Attributes("onsubmit") = "_spFormOnSubmitWrapper();"
                End If
            End If
            Dim scriptManager As ScriptManager = scriptManager.GetCurrent(Me.Page)
            If scriptManager Is Nothing Then
                scriptManager = New RadScriptManager()
                Me.Page.Form.Controls.AddAt(0, scriptManager)
            End If
If I comment out the "RadScriptManager()" call then the web part will show up just fine. Otherwise I get the dreaded Sharepoint error page. 

I haven't even got to exposing the RadGird yet. It's gotten that bad. 

I've added the necessary reference and Imports statement to the class object. 

Does ANYONE have ANY ideas? 

Thanks,

-Matt

One other question:

Do I have to use the AJAX version? Can I just use the ASP.NET version? AJAX sounds exciting and all, but this is horrible. 

Thanks again.

Rosen
Telerik team
 answered on 08 Dec 2008
3 answers
128 views
Hi,

I got this error when I press FS quickly to refresh page when the loading panel is displaying but the content of tooltip doesn't show.
I'm using tooltipmanager.

I get the same error on your example page.

/aspnet-ajax/tooltip/examples/tooltipversustooltipmanager/defaultcs.aspx

Any idea?

Thanks,

-S
Svetlina Anati
Telerik team
 answered on 08 Dec 2008
2 answers
261 views
I have a GridButtonColumn in a hierarchical RadGrid that fires a custom update via the ItemCommand event. The update sets the value of an "OrderStatus" field to "X".

My problem is that while the update does correctly set the value in the db row, the column in the grid still shows the old value, even if I use "rebind".

The ItemCommand handler is:

    Protected Sub RadGrid1_ItemCommand(ByVal source As Object, ByVal e As GridCommandEventArgs)  
        If e.CommandName = "CancelOrder" Then  
            Dim item As GridDataItem = DirectCast(e.Item, GridDataItem)  
            Dim OrderID As String = item.OwnerTableView.DataKeyValues(item.ItemIndex)("OrderID").ToString()  
            AccessDataSource2.UpdateCommand = "UPDATE [Orders] SET [OrderStatus] = 'X' WHERE [OrderID] = " & OrderID  
            AccessDataSource2.Update()  
        End If  
    End Sub  
 

And the GridButtonColumn:

    <telerik:GridButtonColumn  
        CommandName="CancelOrder" 
        Text="Cancel" 
        UniqueName="OrderCancelColumn"   
        ConfirmText="Are you sure you want to cancel this order?"   
        DataTextFormatString="Cancel" 
        DataTextField="OrderID">   
    </telerik:GridButtonColumn> 
 

Can anyone see what I'm doing wrong? I tried turning off Ajax, but that didn't change anything. I also tried using an SqlCommand, but no change. I tried explicitly rebinding with RadGrid1.MasterTableView.DetailTables(0).Rebind() but that didn't work either.

I think this problem is because I'm using a hierarchy, because when I don't use a hierarchy, it all works as expected. 

Many thanks, Steve

PS the full page is here, it just needs the Nwind.mdb Access database to run, with an extra column OrderStatus in the Orders table:

<%@ Page Language="VB"  ValidateRequest="false" %> 
 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> 
 
<script runat="server">  
 
    Protected Sub RadGrid1_ItemCommand(ByVal source As Object, ByVal e As GridCommandEventArgs)  
        If e.CommandName = "CancelOrder" Then  
            Dim item As GridDataItem = DirectCast(e.Item, GridDataItem)  
            Dim OrderID As String = item.OwnerTableView.DataKeyValues(item.ItemIndex)("OrderID").ToString()  
            AccessDataSource2.UpdateCommand = "UPDATE [Orders] SET [OrderStatus] = 'X' WHERE [OrderID] = " & OrderID  
            AccessDataSource2.Update()  
        End If  
    End Sub  
 
</script> 
 
<html xmlns="http://www.w3.org/1999/xhtml">  
<head runat="server">  
    <title>Untitled Page</title> 
</head> 
<body> 
    <form id="form1" runat="server">  
        <asp:ScriptManager ID="ScriptManager1" runat="server" /> 
        <div> 
            <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">  
                <AjaxSettings> 
                    <telerik:AjaxSetting AjaxControlID="RadGrid1">  
                        <UpdatedControls> 
                            <telerik:AjaxUpdatedControl ControlID="RadGrid1" /> 
                        </UpdatedControls> 
                    </telerik:AjaxSetting> 
                </AjaxSettings> 
            </telerik:RadAjaxManager> 
            <telerik:RadGrid ID="RadGrid1" runat="server"   
                AutoGenerateColumns="False"   
                Skin="Telerik" 
                PageSize="3"   
                AllowSorting="True"   
                AllowPaging="True"   
                DataSourceID="AccessDataSource1" 
                OnItemCommand="RadGrid1_ItemCommand">  
                <MasterTableView   
                    DataKeyNames="CustomerID" Width="100%"   
                    HierarchyLoadMode="Client" 
                    Name="Customers"   
                    DataSourceID="AccessDataSource1">  
                    <DetailTables> 
                        <telerik:GridTableView   
                            DataKeyNames="OrderID"   
                            Name="Orders" Width="100%"   
                            HierarchyLoadMode="Client" 
                            DataSourceID="AccessDataSource2">  
                            <ParentTableRelation> 
                                <telerik:GridRelationFields DetailKeyField="CustomerID" MasterKeyField="CustomerID" /> 
                            </ParentTableRelation> 
                            <DetailTables> 
                                <telerik:GridTableView   
                                    DataKeyNames="OrderID"   
                                    Name="OrderDetails" Width="100%"   
                                    DataSourceID="AccessDataSource3">  
                                    <ParentTableRelation> 
                                        <telerik:GridRelationFields DetailKeyField="OrderID" MasterKeyField="OrderID" /> 
                                    </ParentTableRelation> 
                                    <Columns> 
                                        <telerik:GridBoundColumn SortExpression="UnitPrice" HeaderText="Unit Price" HeaderButtonType="TextButton" 
                                            DataField="UnitPrice">  
                                        </telerik:GridBoundColumn> 
                                        <telerik:GridBoundColumn SortExpression="Quantity" HeaderText="Quantity" HeaderButtonType="TextButton" 
                                            DataField="Quantity">  
                                        </telerik:GridBoundColumn> 
                                        <telerik:GridBoundColumn SortExpression="Discount" HeaderText="Discount" HeaderButtonType="TextButton" 
                                            DataField="Discount">  
                                        </telerik:GridBoundColumn> 
                                    </Columns> 
                                </telerik:GridTableView> 
                            </DetailTables> 
                            <Columns> 
                                <telerik:GridBoundColumn SortExpression="OrderID" HeaderText="OrderID" HeaderButtonType="TextButton" 
                                    DataField="OrderID">  
                                </telerik:GridBoundColumn> 
                                <telerik:GridBoundColumn SortExpression="OrderDate" HeaderText="Date Ordered" HeaderButtonType="TextButton" 
                                    DataField="OrderDate">  
                                </telerik:GridBoundColumn> 
                                <telerik:GridBoundColumn SortExpression="Freight" HeaderText="Freight" HeaderButtonType="TextButton" 
                                    DataField="Freight">  
                                </telerik:GridBoundColumn> 
                                <telerik:GridBoundColumn SortExpression="OrderStatus" HeaderText="Status" HeaderButtonType="TextButton" 
                                    DataField="OrderStatus">  
                                </telerik:GridBoundColumn> 
                                <telerik:GridButtonColumn  
                                    CommandName="CancelOrder" 
                                    Text="Cancel" 
                                    UniqueName="OrderCancelColumn"   
                                    ConfirmText="Are you sure you want to cancel this order?"   
                                    DataTextFormatString="Cancel" 
                                    DataTextField="OrderID">   
                                </telerik:GridButtonColumn> 
 
                            </Columns> 
                        </telerik:GridTableView> 
                    </DetailTables> 
                    <Columns> 
                        <telerik:GridBoundColumn SortExpression="CustomerID" HeaderText="CustomerID" HeaderButtonType="TextButton" 
                            DataField="CustomerID">  
                        </telerik:GridBoundColumn> 
                        <telerik:GridBoundColumn SortExpression="ContactName" HeaderText="Contact Name" HeaderButtonType="TextButton" 
                            DataField="ContactName">  
                        </telerik:GridBoundColumn> 
                        <telerik:GridBoundColumn SortExpression="CompanyName" HeaderText="Company" HeaderButtonType="TextButton" 
                            DataField="CompanyName">  
                        </telerik:GridBoundColumn> 
                    </Columns> 
                </MasterTableView> 
                <ClientSettings AllowExpandCollapse="true">  
                </ClientSettings> 
            </telerik:RadGrid> 
              
             <asp:AccessDataSource ID="AccessDataSource1" DataFile="~/App_Data/Nwind.mdb" 
                SelectCommand="SELECT * FROM Customers" runat="server">  
            </asp:AccessDataSource> 
              
            <asp:AccessDataSource ID="AccessDataSource2" runat="server" DataFile="~/App_Data/Nwind.mdb" 
                SelectCommand="SELECT * FROM Orders Where CustomerID = ?">  
                <SelectParameters> 
                    <asp:SessionParameter Name="CustomerID" SessionField="CustomerID" Type="string" /> 
                </SelectParameters> 
            </asp:AccessDataSource> 
              
            <asp:AccessDataSource ID="AccessDataSource3" DataFile="~/App_Data/Nwind.mdb" 
                SelectCommand="SELECT * FROM [Order Details] where OrderID = ?" runat="server">  
                <SelectParameters> 
                    <asp:SessionParameter Name="OrderID" SessionField="OrderID" Type="Int32" /> 
                </SelectParameters> 
            </asp:AccessDataSource> 
              
        </div> 
    </form> 
</body> 
</html> 
 

Iana Tsolova
Telerik team
 answered on 08 Dec 2008
1 answer
99 views
Is there a way to change the default tab alignment in Sliding panes. For intance, I have a sliding pane which has SlideDirection="Bottom". In other words, the pane is at the top of the page. The pane title (when pinned/expanded) and the pane tab (when un-pinned), are both justified to the left. I would like to right-justify these, so the pane title appears next to the pin/unpin icon and the pane tab (when unpinned) is all the way to the right.
Svetlina Anati
Telerik team
 answered on 08 Dec 2008
1 answer
161 views
Hi Guys

Having some fun with the sliding zone, basically I have five sliding panes horizontal at the top of the page expanding downwards quite happily.

What I want to acheive is to set the 1st sliding pane to be docked when the page loads.

and for both the 1st and 2nd sliding panes to fill the screen height when they slide downwards, including when the 1st tab is docked at page load.

this also needs to account for when the browser is resized

really struggling to acheive this however so any help would be appreciated

thanks
Rob
Svetlina Anati
Telerik team
 answered on 08 Dec 2008
Narrow your results
Selected tags
Tags
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?