Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
143 views
Hi,

I've got another question about the scheduler control. The appointments are loaded from a WCF webservice and thus the AppointmentCreated event is not fired serverside. We've used the client-side double click event to attach an event handler to show a radwindow on doubleclicking an appointment. The window is showed as expected, but the default scheduler window is also showed by the scheduler control. If we throw an exception at the end of the 'show popup' JS function the schedulers' popup is killed, but I don't find that to be a correct solution. Is there a way to prevent the default popup from showing?
Peter
Telerik team
 answered on 10 Jun 2009
3 answers
574 views
Hi,

I am rolling out a consistent set of alert dialogs and controls across our systems and part of this task is to get rid of old error/informational messages and replace them with something better.

i like the radwindow alert and confirm dialogs and want to embed them in our existing codebase.

What we currently have is a method in our basepage called showAlert..

protected void ShowAlert(string msg) 
{ 
var myScript = string.format("alert('{0}');",msg); 
Page.ClientScript.RegisterStartupScript(this.GetType(), "SCR", myScript, true); 
} 

This just makes a basic javascript alert popup once the postback has finished and alerts the user.

I want to replace this with the radWindowManager and use the built in alerts.

How can i initiate the alert and confirm dialogs from the server side?  there seems to be no examples available.

I tried adding a radwindowManager to my page, then i modified the ShowAlert() method like so....

        protected void ShowAlert(string msg) 
        { 
            string myScript = string.Format("radalert('A string.', 200, 100,'{0}');", msg); 
            Page.ClientScript.RegisterStartupScript(this.GetType(), "SCR", myScript, true); 
        } 
 


but i get the following error...

_5 is undefined
radalert()("A string.", 200, 100, "hello")ScriptRe...=53f5b61a (line 8)
default.aspx()()default.aspx (line 135)
var _6=_5._getStandardPopup("alert",_1);

What am i doing wrong here?
Guy
Top achievements
Rank 1
 answered on 10 Jun 2009
1 answer
100 views
I have 2 menus on a simple ASPX page.  A top menu and a left menu.  The left menu is a subset of data from the item I click on in the top menu.

I can get this to work properly, but ONLY on the first item I click on in the top menu.  After that, the left menu only displays the initial data even though I rebind the menu with the new data set.

Here is my code:
ASPX: 
<telerik:RadScriptManager ID="RadScriptManager1" runat="server"> 
        </telerik:RadScriptManager> 
        <telerik:RadMenu ID="mainRadMenu" runat="server" DataSourceID="mainRadMenuXDS" DataTextField="title" OnItemClick="mainRadMenu_ItemClick" PostBackUrl="~/Test.aspx"> 
            <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> 
        </telerik:RadMenu> 
        <asp:XmlDataSource ID="mainRadMenuXDS" runat="server" DataFile="~/App_Data/XMLFile1.xml" XPath="/Items/Item" /> 
        <br /> 
        <br /> 
        <br /> 
        <br /> 
        <br /> 
        <telerik:RadMenu ID="leftRadMenu" runat="server" Flow="Vertical"> 
            <DefaultGroupSettings Flow="Horizontal" /> 
            <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> 
        </telerik:RadMenu> 
        <asp:XmlDataSource ID="leftRadMenuXDS" runat="server" XPath="/Items/Item" /> 
 
CS: 
protected void mainRadMenu_ItemClick(object sender, Telerik.Web.UI.RadMenuEventArgs e) 
        { 
            Session["MainMenu"] = e.Item.Text; 
 
            PopulateLeftMenu(); 
        } 
 
        protected void PopulateLeftMenu() 
        { 
            XmlDocument xmldoc = new XmlDocument(); 
            xmldoc.Load(Server.MapPath("~/App_Data/XMLFile1.xml")); 
 
 
            XmlNode mainMenuItem = xmldoc.SelectSingleNode(String.Format("//Items//Item[@title = '{0}']", Session["MainMenu"].ToString())); 
 
            XmlDocument leftMenuDocument = new XmlDocument(); 
            leftMenuDocument.LoadXml(String.Format("<Items>{0}</Items>", mainMenuItem.InnerXml.ToString())); 
 
            leftRadMenuXDS.Data = leftMenuDocument.InnerXml; 
            leftRadMenu.DataSourceID = leftRadMenuXDS.UniqueID; 
            leftRadMenu.DataTextField = "title"; 
            leftRadMenu.DataBind(); 
        } 
XML: 
<?xml version="1.0" encoding="utf-8" ?> 
<Items> 
    <Item title="Menu 1" description=""> 
        <Item title="Menu 1A" description="" /> 
        <Item title="Menu 1B" description=""> 
            <Item title="Menu 1B1" description="" /> 
            <Item title="Menu 1B2" description="" /> 
            <Item title="Menu 1B3" description="" /> 
            <Item title="Menu 1B4" description="" /> 
            <Item title="Menu 1B5" description="" /> 
        </Item> 
        <Item title="Menu 1C" description="" />      
    </Item> 
    <Item title="Menu 2" description=""> 
        <Item title="Menu 2A" description="" /> 
        <Item title="Menu 2B" description="" />      
    </Item> 
    <Item title="Menu 3" description=""> 
        <Item title="Menu 3A" description="" /> 
        <Item title="Menu 3B" description="" /> 
        <Item title="Menu 3C" description="" /> 
        <Item title="Menu 3D" description="" /> 
    </Item> 
    <Item title="Menu 4" description=""> 
        <Item title="Menu 4A" description="" /> 
        <Item title="Menu 4B" description="" /> 
        <Item title="Menu 4C" description="" /> 
        <Item title="Menu 4D" description="" /> 
    </Item> 
    <Item title="Menu 5" description="" /> 
</Items> 


I can see when I debug, that the left menu has no data in it and that the correct data is being databound to it, however I always end up with the inital data.

Any thoughts or suggestions would be GREATLY appreciated!
Paul
Telerik team
 answered on 10 Jun 2009
5 answers
132 views
I have a tree structure with more than 2300 nodes in it. Initially my treeview was set to ExpandMode= ClientSide, but the performance was very slow. Then I changed the ExpandMode= ServerSideCallBack and my page much more responsive but it started having the issue mentioned in:-

Is there a way to overcome this issue when ExpandMode= ServerSideCallBack?

Thanks
-sm.
Veselin Vasilev
Telerik team
 answered on 10 Jun 2009
4 answers
306 views
hi,
I have implemented

  Saving grid settings on a per user basis
but my grid is a hierarchical one.i want to keep detail tables' settings like sort order in the database on a per user basis

  the code for Saving grid settings on a per user basis

  'this method should be called on Pre_Render of grid  
        Public Function ReadSettings() As String  
            Try  
                Dim gridSettings() As Object = New Object((6) - 1) {}  
                'Save sort expressions  
                gridSettings(0) = CType(gridInstance.MasterTableView.SortExpressions, IStateManager).SaveViewState  
 
                'Save groupBy  
                Dim groupByExpressions As GridGroupByExpressionCollection = gridInstance.MasterTableView.GroupByExpressions  
                Dim groupExpressions() As Object = New Object((groupByExpressions.Count) - 1) {}  
                Dim count As Integer = 0 
                For Each expression As GridGroupByExpression In groupByExpressions  
                    groupExpressions(count) = CType(expression, IStateManager).SaveViewState  
                    count = (count + 1)  
                Next  
                gridSettings(1) = groupExpressions  
 
                'Save visible columns  
                Dim columnsLength As Integer = (gridInstance.MasterTableView.Columns.Count + gridInstance.MasterTableView.AutoGeneratedColumns.Length)  
                Dim columnOrder() As Pair = New Pair(columnsLength - 1) {}  
                Dim allColumns As ArrayList = New ArrayList(columnsLength)  
                Dim visibleColumns As ArrayList = New ArrayList(columnsLength)  
 
                allColumns.AddRange(gridInstance.MasterTableView.Columns)  
                allColumns.AddRange(gridInstance.MasterTableView.AutoGeneratedColumns)  
                Dim i As Integer = 0 
                For Each column As GridColumn In allColumns  
                    Dim p As Pair = New Pair  
                    p.First = column.OrderIndex  
                    p.Second = column.HeaderStyle.Width  
                    columnOrder(i) = p  
                    visibleColumns.Add(column.Visible)  
                    i = (i + 1)  
                Next  
                gridSettings(2) = columnOrder  
                gridSettings(3) = visibleColumns  
 
               'Save PageSize  
                gridSettings(4) = CType(gridInstance.PageSize, Object)  
                'Save detail grid sort expressions  
                Dim nextindextosave As Integer = 5 
                'If you have several detail tables at a level then you can get the count of the detailtables in the grid using the following code:  
 
                If gridInstance.MasterTableView.DetailTables.Count > 0 Then  
                    Dim j As Integer  
                    For j = 0 To gridInstance.MasterTableView.DetailTables.Count - 1  
                        'If you want to check the count of the detailtables at each level of the grid, then you would have to try the following code:  
                        If gridInstance.MasterTableView.DetailTables(j).DetailTables.Count > 0 Then  
                            ReDim gridSettings(gridSettings.Length + gridInstance.MasterTableView.DetailTables(j).DetailTables.Count)  
                        Else  
                 gridSettings(5) = CType(gridInstance.MasterTableView.DetailTables(j).SortExpressions, IStateManager).SaveViewState  
                          
                        End If  
                    Next  
                End If  
             Dim formatter As LosFormatter = New LosFormatter  
                Dim writer As StringWriter = New StringWriter  
                formatter.Serialize(writer, gridSettings)  
                Return writer.ToString  
              Catch ex As Exception  
                Throw ex  
            End Try  
        End Function  
 
 
        'this method should be called on PageInit  
        Public Function LoadSettings(ByVal settings As String)  
            Try  
                If ((settings = "") Or (settings Is DBNull.Value)) Then  
                    Return False  
                End If  
                Dim formatter As LosFormatter = New LosFormatter()  
                Dim reader As StringReader = New StringReader(settings)  
                Dim gridSettings() As Object = CType(formatter.Deserialize(reader), Object())  
 
                'Load sort expressions  
                Me.gridInstance.MasterTableView.SortExpressions.Clear()  
                CType(Me.gridInstance.MasterTableView.SortExpressions, IStateManager).LoadViewState(gridSettings(0))  
                'Load groupBy  
                Dim groupByExpressions As GridGroupByExpressionCollection = Me.gridInstance.MasterTableView.GroupByExpressions  
                groupByExpressions.Clear()  
                Dim groupExpressionsState As Object() = CType(gridSettings(1), Object())  
                Dim count As Integer = 0 
                For Each obj As Object In groupExpressionsState  
                    Dim expression As GridGroupByExpression = New GridGroupByExpression()  
                    CType(expression, IStateManager).LoadViewState(obj)  
                    groupByExpressions.Add(expression)  
                    countcount = count + 1  
                Next  
 
                'load visible columns  
                Dim columnsLength As Integer = (Me.gridInstance.MasterTableView.Columns.Count + Me.gridInstance.MasterTableView.AutoGeneratedColumns.Length)  
                Dim columnOrder() As Pair = CType(gridSettings(2), Pair())  
                Dim visibleCols As ArrayList = CType(gridSettings(3), ArrayList)  
 
                If columnsLength = columnOrder.Length Then  
                    Dim allColumns As ArrayList = New ArrayList(columnsLength)  
                    allColumns.AddRange(Me.gridInstance.MasterTableView.Columns)  
                    allColumns.AddRange(Me.gridInstance.MasterTableView.AutoGeneratedColumns)  
 
                    Dim i As Integer = 0 
                    For Each column As GridColumn In allColumns  
                        column.OrderIndex = CType(columnOrder(i).First, Integer)  
                        column.HeaderStyle.Width = CType(columnOrder(i).Second, Unit)  
                        column.Visible = CType(visibleCols(i), Boolean)  
                        ii = i + 1  
                    Next  
                End If  
                'Load page size  
                Me.gridInstance.PageSize = CType(gridSettings(4), Integer)  
 
                    If gridInstance.MasterTableView.DetailTables.Count > 0 Then  
                    Dim j As Integer  
                    For j = 0 To gridInstance.MasterTableView.DetailTables.Count - 1  
                        'If you want to check the count of the detailtables at each level of the grid, then you would have to try the following code:  
                        If gridInstance.MasterTableView.DetailTables(j).DetailTables.Count > 0 Then  
                            Me.gridInstance.MasterTableView.DetailTables(j).SortExpressions.Clear()  
                            CType(Me.gridInstance.MasterTableView.DetailTables(j).SortExpressions, IStateManager).LoadViewState(gridSettings(5))  
                            ReDim gridSettings(gridSettings.Length + gridInstance.MasterTableView.DetailTables(j).DetailTables.Count)  
                        Else  
                          Me.gridInstance.MasterTableView.DetailTables(j).SortExpressions.Clear()  
                            CType(Me.gridInstance.MasterTableView.DetailTables(j).SortExpressions, IStateManager).LoadViewState(gridSettings(5))  
 
                        End If  
                    Next  
                End If  
          Catch ex As Exception  
                Throw ex  
            End Try  
        End Function 

This is working fine for master grid..

But for detail table ie,gridsettings(5) its not working

plz help me

Tsvetoslav
Telerik team
 answered on 10 Jun 2009
1 answer
111 views

Hi all,

I am using "Grid/Edit on Double-click" rad grid then column type "GridDropDownColumn" does not show data in the first row.


http://demos.telerik.com/aspnet-ajax/grid/examples/dataediting/editondblclick/defaultcs.aspx

go through this link and see "In Stock" column in the radgrid. there are no data in first row. I am facing the same problem.
Please Help.


Thanks.
Pavlina
Telerik team
 answered on 10 Jun 2009
1 answer
91 views
I may have found an issue with RadGrid...?

I have a grid that has a GridEditCommandColumn, one visible editable GridBoundColumn, and some invisible GridBoundColumn data items.  The EditMode is InPlace.

If you put the row into edit mode, you can't click on the textbox to edit it.  You can tab to it, but you can't click it.  

If I add another visible editable column to the grid, the problem goes away.

And I can get around it by manually setting focus to the textbox in ItemDataBound.

--Eve

The grid declaration:

 

<telerik:RadGrid ID="ConfigGrid" runat="server" AutoGenerateColumns="False"

 

 

OnNeedDataSource="ConfigGrid_NeedDataSource"

 

 

OnUpdateCommand="ConfigGrid_UpdateCommand"

 

 

OnItemDataBound="ConfigGrid_ItemDataBound"

 

 

ShowStatusBar="True" AllowPaging="False" AllowSorting="true">

 

 

<pagerstyle mode="NextPrevNumericAndAdvanced" />

 

 

<mastertableview autogeneratecolumns="False" editmode="InPlace" commanditemdisplay="Top"

 

 

DataKeyNames="BELawSecCitationDetailID,RowVersion" AllowSorting="true" AllowMultiColumnSorting="true">

 

 

<SortExpressions>

 

 

<telerik:GridSortExpression FieldName="IsAssociated" SortOrder="Descending" />

 

 

<telerik:GridSortExpression FieldName="Citation" SortOrder="Ascending" />

 

 

</SortExpressions>

 

 

<EditFormSettings>

 

 

<EditColumn UniqueName="EditCommandColumn1">

 

 

</EditColumn>

 

 

</EditFormSettings>

 

 

<CommandItemTemplate>

 

 

<div style="float: right;">

 

 

<asp:LinkButton ID="RefreshRadGridLookupButton" runat="server" CommandName="RebindGrid"

 

 

SkinID="swGridRefreshLinkButton"></asp:LinkButton>

 

 

</div>

 

 

</CommandItemTemplate>

 

 

<Columns>

 

 

<telerik:GridEditCommandColumn ButtonType="ImageButton">

 

 

<HeaderStyle Width="40px" />

 

 

</telerik:GridEditCommandColumn>

 

 

<telerik:GridCheckBoxColumn DataField="IsAssociated" UniqueName="IsAssociated" DataType="System.Boolean"

 

 

HeaderText="Active?" Visible="false">

 

 

<HeaderStyle Width="40px" />

 

 

</telerik:GridCheckBoxColumn>

 

 

<telerik:GridBoundColumn DataField="Citation" UniqueName="Citation"

 

 

HeaderText="Law Citation Text" DataType="System.String">

 

 

</telerik:GridBoundColumn>

 

Mode

<telerik:GridBoundColumn DataField="BELawSecCitationDetailID" UniqueName="BELawSecCitationDetailID" Visible="false"

 

 

DataType="System.Int32" />

 

 

<telerik:GridBoundColumn DataField="RowVersion" UniqueName="RowVersion"

 

 

DataType="System.Int32" Visible="false">

 

 

</telerik:GridBoundColumn>

 

 

</Columns>

 

 

</mastertableview>

 

 

</telerik:RadGrid>

 

Nikolay Rusev
Telerik team
 answered on 10 Jun 2009
1 answer
126 views

Hi,

I'm setting the node text on databind, with some HTML tags in the text. This has been no problem, except recently. If there are one or more <span> tags in the text, I get a javascript error on mouseover:

Message: 'this._element' is null or not an object
Line: 178
Char: 1
Code: 0
URI: http://localhost:1360/ScriptResource.axd?d=DMsgcAGno5aOYK0aJwUvXdDJxcknSyeyRU4cG7Y7I2kuvLi_brGedLWr9i1aLqYyY_ZriuetXXzd7bzZtgAS4w2&t=633798049441157248


If I remove the <span> tags, everything works flawlessly. Is there any way I can fix this without removing my span tags?

Paul
Telerik team
 answered on 10 Jun 2009
1 answer
73 views
Using windows authentication method to view a secured page. The landing page is calling a master page with AJAX enabled.

On postback this error is generated.  "sys.webForms.pageRequestManagerParseErrorExecption"

Only occurs with windows authentication dialog windows and not other wise.

Kndly reply with a solution at the earliest.

Attached screenshot

Thanks,
SS
Pavlina
Telerik team
 answered on 10 Jun 2009
1 answer
118 views
Hi,
I have a master-child tables in radgrid as given below. When the page is loaded, only the child tables should be in editmode (not master table). I am not able to get it work. Any help is much appreciated.

 

<telerik:RadGrid ID="RadGrid1" OnPreRender="RadGrid1_PreRender" ShowStatusBar="true" DataSourceID="SqlDataSource1"

 

 

runat="server" AutoGenerateColumns="False" PageSize="7" AllowSorting="True" AllowMultiRowSelection="False"

 

 

AllowPaging="True" GridLines="None">

 

 

<PagerStyle Mode="NumericPages"></PagerStyle>

 

 

<MasterTableView DataSourceID="SqlDataSource1" DataKeyNames="OrderID" AllowMultiColumnSorting="True">

 

 

<ParentTableRelation>

 

 

<telerik:GridRelationFields DetailKeyField="OrderID" MasterKeyField="OrderID" />

 

 

</ParentTableRelation>

 

 

<DetailTables>

 

 

<telerik:GridTableView DataKeyNames="OrderID" DataSourceID="SqlDataSource3" Width="100%"

 

 

runat="server">

 

 

<ParentTableRelation>

 

 

<telerik:GridRelationFields DetailKeyField="OrderID" MasterKeyField="OrderID" />

 

 

</ParentTableRelation>

 

 

<Columns>

 

 

<telerik:GridBoundColumn SortExpression="UnitPrice" HeaderText="Unit Price" HeaderButtonType="TextButton"

 

 

DataField="UnitPrice" UniqueName="UnitPrice">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn SortExpression="Quantity" HeaderText="Quantity" HeaderButtonType="TextButton"

 

 

DataField="Quantity" UniqueName="Quantity">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn SortExpression="Discount" HeaderText="Discount" HeaderButtonType="TextButton"

 

 

DataField="Discount" UniqueName="Discount">

 

 

</telerik:GridBoundColumn>

 

 

</Columns>

 

 

<SortExpressions>

 

 

<telerik:GridSortExpression FieldName="Quantity" SortOrder="Descending"></telerik:GridSortExpression>

 

 

</SortExpressions>

 

 

</telerik:GridTableView>

 

 

</DetailTables>

 

 

<Columns>

 

 

<telerik:GridBoundColumn SortExpression="OrderID" HeaderText="OrderID" HeaderButtonType="TextButton"

 

 

DataField="OrderID" UniqueName="OrderID">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn SortExpression="OrderDate" HeaderText="Date Ordered" HeaderButtonType="TextButton"

 

 

DataField="OrderDate" UniqueName="OrderDate" DataFormatString="{0:D}">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn SortExpression="Freight" HeaderText="Freight" HeaderButtonType="TextButton"

 

 

DataField="Freight" UniqueName="Freight">

 

 

</telerik:GridBoundColumn>

 

 

</Columns>

 

 

</MasterTableView>

 

 

</telerik:RadGrid>

Thanks

Sujith

 

Princy
Top achievements
Rank 2
 answered on 10 Jun 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?