Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
142 views
Hi,

I change the Theme of the radcontrols dynamically at the runtime. I also want to change the images of the pannel bar.
Pls. guide me how to change the image in the pannel bar dynamically.

Thanks
Jidesh Guptha
Top achievements
Rank 1
 answered on 10 Jun 2009
3 answers
263 views
Dear Sir,
I have a query during export to excel in a radgrid.
I return 20 columns from the database in the form of a dataset and bind that dataset to radgrid. But in the radgrid, I am not displaying all 20 columns. I am displaying only 5 columns out of that 20 columns. Now, when I export to excel, only records for that 5 columns get exported to excel. I want to export all the 20 columns during export to excel.
I want to display only 5 columns but want to export all the 20 columns returned to me from the dataset from the database.
Please help?
Manish
Top achievements
Rank 1
 answered on 10 Jun 2009
3 answers
92 views
Hi,

I have a 2 RadEditors in my page. The first editor loads up correctly with the custom paragraphy styles I defined. However, the second editor paragraph styles is using a default styles instead of the styles that I defined when using it with ToolProviderID. It works fine if I am not using the ToolProviderID.



Thanks.
Rumen
Telerik team
 answered on 10 Jun 2009
1 answer
40 views
Hi
I dont know why my RadScheduler doesnt have < ResourceStyles > property?
and it gives me an error:
Error: 'Telerik.Web.UI.RadScheduler' does not have a public property named 'ResourceStyles'. C:\Documents and Settings\User\My Documents\Visual Studio 2008\WebSites\Courses\Schedule.aspx 241

Peter
Telerik team
 answered on 10 Jun 2009
4 answers
194 views
I copied a sample code from your demo:
http://demos.telerik.com/aspnet-ajax/grid/examples/programming/webmail/defaultvb.aspx

<
telerik:GridTemplateColumn UniqueName="TemplateColumn3" Groupable="False">
   <HeaderStyle Width="20px"></HeaderStyle>
   <ItemStyle Height="35px"></ItemStyle>
   <ItemTemplate>
<asp:ImageButton ID="MailFlagImageButton" BorderWidth="0px" CommandName="ChangeFlag"
ImageUrl='<%# Convert.ToBoolean(DataBinder.Eval(Container.DataItem, "Flagged"))? "img/MailFlagRed.gif" : "img/MailFlag.gif" %>'

    AlternateText="Change Flag" Style="float: right; cursor: pointer;" runat="server">
    </asp:ImageButton>
    </ItemTemplate>
</telerik:GridTemplateColumn>

I this demo it shows that an image is being used to flag the item....
--------
In the beginning of the page I have a grid that have nothing in it. The user will select items above the grid then when i press purchase, the item selected will be displayed in the grid...

My problem is that when I display the items in the grid no image will display.. (note: the header of the ItemTemplate shows, but does not have any picture below it.)

the grid was rebinded.
The main problem is that the image does not display......
I tried using telerik:GridButtonColumn and made its type into image but the problem is still their no image is displayed
How can i solve this problem......

Sebastian
Telerik team
 answered on 10 Jun 2009
1 answer
137 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
561 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
97 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
124 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
294 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
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?