Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
395 views
Hello,

When binding a combobox I am setting every other item's BackColor to "Gainsboro".  However, when I click the combobox and hover the items in the combobox the items backcolor I changed aren't highlighing blue anymore

for(var i=0; i < 10;i++)
 {
     // bind result to control
     var comboBoxItem = new RadComboBoxItem(i.ToString(), i.ToString());
     // add alternating row color
     if (i % 2 == 0)
         comboBoxItem.BackColor = Color.Gainsboro;
     comboBox.Items.Add(comboBoxItem);
 }

Attached is a picture of what Im seeing:

I would like all items to Highlight blue.

Thanks,

Dan Harvey
Top achievements
Rank 2
 answered on 26 Mar 2012
4 answers
153 views
Hi,

I use a ToolTipManager for a RadChart. The problem is that, I have a grid also on the same page and there is unwanted tooltip added on the grid because of the ToolTipManager. I set the ToolTipZoneID to my ChartID and It affect my Grid for I don't know why.

Here is my code:

<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Labos.aspx.vb" Inherits="GESPHARxLite_2.Labos" %>
 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Charting" TagPrefix="telerik" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<script src="Scripts/jquery-1.7.min.js" type="text/javascript"></script>
 
<script src="Scripts/Resizer.js" type="text/javascript"></script>
 
<head runat="server">
    <title></title>
    <link href="css/GESPHARxLite.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
        html, body, form
        {
            margin: 0;
            height: 100%;
            overflow: hidden;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
        <Scripts>
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js">
            </asp:ScriptReference>
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js">
            </asp:ScriptReference>
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js">
            </asp:ScriptReference>
        </Scripts>
    </telerik:RadScriptManager>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="gridLabos">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="chartLabos" LoadingPanelID="RadAjaxLoadingPanel1"
                        UpdatePanelHeight="100%" />
                    <telerik:AjaxUpdatedControl ControlID="gridLabos" LoadingPanelID="RadAjaxLoadingPanel1"
                        UpdatePanelHeight="100%" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="chartLabos" />
                    <telerik:AjaxUpdatedControl ControlID="isInitialLoad" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Default">
    </telerik:RadAjaxLoadingPanel>
    <div id="hiddenFields">
        <input id="isInitialLoad" type="hidden" runat="server" value="1" />
    </div>
    <div id="gridDiv">
        <telerik:RadGrid ID="gridLabos" runat="server" Height="200px">
            <FilterMenu EnableImageSprites="False">
            </FilterMenu>
            <ClientSettings>
                <Selecting CellSelectionMode="None"></Selecting>
            </ClientSettings>
            <MasterTableView>
                <CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>
                <RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column">
                    <HeaderStyle Width="20px"></HeaderStyle>
                </RowIndicatorColumn>
                <ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column">
                    <HeaderStyle Width="20px"></HeaderStyle>
                </ExpandCollapseColumn>
                <Columns>
                    <telerik:GridBoundColumn DataField="labo_noauto" FilterControlAltText="Filter colHeure column"
                        HeaderText="NoAuto" ShowFilterIcon="False" UniqueName="colNoAuto" Visible="false"
                        ReadOnly="true" FilterControlWidth="100%">
                    </telerik:GridBoundColumn>
                    <telerik:GridImageColumn FilterControlAltText="Filter colStatutImg column" AllowFiltering="false"
                        HeaderText="" ImageHeight="" ImageWidth="" UniqueName="colStatutImg" HeaderStyle-Width="30">
                        <HeaderStyle Width="30px" ></HeaderStyle>
                    </telerik:GridImageColumn>
                    <telerik:GridDateTimeColumn DataField="Date" FilterControlAltText="Filter colDate column"
                        HeaderText="Date" UniqueName="colDate" ShowFilterIcon="False" CurrentFilterFunction="StartsWith"
                        FilterDelay="700" FilterControlWidth="100%">
                    </telerik:GridDateTimeColumn>
                    <telerik:GridBoundColumn DataField="labo_heure" FilterControlAltText="Filter colHeure column"
                        HeaderText="Heure" ShowFilterIcon="False" UniqueName="colHeure" FilterControlWidth="100%">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="labt_numero" FilterControlAltText="Filter colTypeTest column"
                        HeaderText="Type de test" ShowFilterIcon="False" UniqueName="colTypeTest" CurrentFilterFunction="StartsWith"
                        FilterDelay="700" FilterControlWidth="100%">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="labt_description" FilterControlAltText="Filter colDescription column"
                        HeaderText="Description" ShowFilterIcon="False" UniqueName="colDescription" CurrentFilterFunction="StartsWith"
                        FilterDelay="700" FilterControlWidth="100%">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="labo_valeur" FilterControlAltText="Filter colValeur column"
                        HeaderText="Valeur" ShowFilterIcon="False" UniqueName="colValeur" CurrentFilterFunction="StartsWith"
                        FilterDelay="700" FilterControlWidth="100%">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="unim_code" FilterControlAltText="Filter colMesure column"
                        HeaderText="Unité mesure" ShowFilterIcon="False" UniqueName="colMesure" CurrentFilterFunction="StartsWith"
                        FilterDelay="700" FilterControlWidth="100%">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="labo_normal_min" FilterControlAltText="Filter colMin column"
                        HeaderText="Minimum" ShowFilterIcon="False" UniqueName="colMin" CurrentFilterFunction="StartsWith"
                        FilterDelay="700" FilterControlWidth="100%">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="labo_normal_max" FilterControlAltText="Filter colMax column"
                        HeaderText="Maximum" ShowFilterIcon="False" UniqueName="colMax" CurrentFilterFunction="StartsWith"
                        FilterDelay="700" FilterControlWidth="100%">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="labo_statut" FilterControlAltText="Filter colStatut column"
                        HeaderText="Statut" ShowFilterIcon="False" UniqueName="colStatut" CurrentFilterFunction="StartsWith"
                        FilterDelay="700" FilterControlWidth="100%">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="labo_usager" FilterControlAltText="Filter colUsager column"
                        HeaderText="Usager" ShowFilterIcon="False" UniqueName="colUsager" CurrentFilterFunction="StartsWith"
                        FilterDelay="700" FilterControlWidth="100%">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="labo_commentaire" FilterControlAltText="Filter colCommentaire column"
                        HeaderText="Commentaire" ShowFilterIcon="False" UniqueName="colCommentaire" CurrentFilterFunction="StartsWith"
                        FilterDelay="700" FilterControlWidth="100%">
                    </telerik:GridBoundColumn>
                </Columns>
                <SortExpressions>
                    <telerik:GridSortExpression FieldName="Date" SortOrder="Descending" />
                </SortExpressions>
                <EditFormSettings>
                    <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                    </EditColumn>
                </EditFormSettings>
                <FilterItemStyle Width="100%" />
            </MasterTableView>
            <ClientSettings EnablePostBackOnRowClick="true">
            </ClientSettings>
        </telerik:RadGrid>
    </div>
    <div id="chartDiv">
        <telerik:RadChart ID="chartLabos" runat="server" Skin="Mac" DefaultType="Line" Style="width: 100%;"
            IntelligentLabelsEnabled="True">
            <ChartTitle>
                <Appearance Position-AlignedPosition="Top">
                    <FillStyle MainColor="">
                    </FillStyle>
                </Appearance>
                <TextBlock Text="Évolution des résultats">
                    <Appearance TextProperties-Font="Tahoma, 13pt">
                    </Appearance>
                </TextBlock>
            </ChartTitle>
            <Appearance TextQuality="AntiAlias">
                <FillStyle FillType="Image">
                    <FillSettings ImageDrawMode="Flip" BackgroundImage="{chart}" ImageFlip="FlipX">
                    </FillSettings>
                </FillStyle>
                <Border Color="138, 138, 138"></Border>
            </Appearance>
            <PlotArea>
                <EmptySeriesMessage Visible="True">
                    <TextBlock Text="Sélectionnez un test pour voir l'évolution des résultats">
                    </TextBlock>
                </EmptySeriesMessage>
                <XAxis LayoutMode="Inside" AutoScale="false" LabelStep="5" IsZeroBased="false">
                    <Appearance ValueFormat="ShortDate">
                        <MajorGridLines PenStyle="Solid" Color="209, 222, 227"></MajorGridLines>
                        <LabelAppearance RotationAngle="45" Position-AlignedPosition="Top">
                        </LabelAppearance>
                        <TextAppearance TextProperties-Color="51, 51, 51">
                        </TextAppearance>
                    </Appearance>
                    <AxisLabel>
                        <TextBlock>
                            <Appearance TextProperties-Color="51, 51, 51">
                            </Appearance>
                        </TextBlock>
                    </AxisLabel>
                </XAxis>
                <YAxis AxisMode="Extended">
                    <Appearance Color="134, 134, 134" MinorTick-Color="134, 134, 134" MinorTick-Width="0"
                        MajorTick-Color="134, 134, 134">
                        <MajorGridLines Color="209, 222, 227"></MajorGridLines>
                        <MinorGridLines Color="233, 239, 241"></MinorGridLines>
                        <TextAppearance TextProperties-Color="51, 51, 51">
                        </TextAppearance>
                    </Appearance>
                    <AxisLabel>
                        <TextBlock>
                            <Appearance TextProperties-Color="51, 51, 51">
                            </Appearance>
                        </TextBlock>
                    </AxisLabel>
                </YAxis>
                <Appearance Dimensions-Margins="60, 60, 90, 60">
                    <FillStyle MainColor="White" FillType="Solid">
                    </FillStyle>
                    <Border Color="134, 134, 134"></Border>
                </Appearance>
            </PlotArea>
            <Legend Visible="false">
                <Appearance Position-AlignedPosition="TopRight" Dimensions-Margins="0%, 3%, 1px, 1px">
                    <ItemMarkerAppearance Figure="Square">
                        <Border Color="134, 134, 134"></Border>
                    </ItemMarkerAppearance>
                    <FillStyle MainColor="">
                    </FillStyle>
                    <Border Color="Transparent"></Border>
                </Appearance>
            </Legend>
        </telerik:RadChart>
        <telerik:RadToolTipManager ID="RadToolTipManager1" runat="server" Skin="Telerik"
            Width="200px" Animation="Slide" Position="TopCenter" EnableShadow="true" ToolTipZoneID="chartLabos"
            AutoTooltipify="true">
        </telerik:RadToolTipManager>
    </div>
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
 
        <script type="text/javascript">
        <!--
            function Resize()
            {
                var ajaxManager = $find("<%= RadAjaxManager1.ClientID %>");
                var arg1 = $(document).width();
                var arg2 = $(document).height() - $("#gridLabos").height() - 2;
                ajaxManager.ajaxRequest(arg1 + "," + arg2);
            }
        -->
        </script>
 
    </telerik:RadCodeBlock>
    </form>
</body>
</html>

Thanks.
Jocelyn
Top achievements
Rank 1
 answered on 26 Mar 2012
1 answer
239 views
My version is 915, I'm not looking for help just wanted to let someone know.

What I'm doing is saving the users selection when a particular view is clicked, like day, week, month, etc.  The next time they are on the site I'm grabbing their previously selected view and using it, so for example, if the user prefers the month view, I want the program to remember that.


So, what I found is:

When setting the selected view with SchedulerViewType.TimelineView, Timeline View = 4.

When saving the selected view using SchedulerNavigationCommand.SwitchToTimelineView, Timeline View = 3.

My program crashes when on the next visit I try to set the SchedulerViewType.TimelineView to 3, because that's not a valid choice.

Just an FYI.
Peter
Telerik team
 answered on 26 Mar 2012
1 answer
143 views
I recently upgraded from a 2011 release to Q1 2012 and my RadWindows no longer scroll on IOS5.  In the previous version, the iframe just expanded outside the bounds of the window, allowing scrolling to be achieved by scrolling the page.  Is there a fix for this, and if it is an implementation choice, is there a workaround, even if this means just falling back to expanding outside the bounds of the window?
Marin Bratanov
Telerik team
 answered on 26 Mar 2012
2 answers
90 views
Hi,

I have been trying to customize the FilterMenu items for different columns in a RadGrid. I want it based on the Data Field associated with the column. I am able to implement it but the problem is with the behavior of the menu items. Items seem to be clipped inside the menu. I mean the hover effect is not properly setting the background color of the current item. Although, on removing the javascript code (to hide the filter functions), the filter menu behaves as expected.

I am attaching the snapshots. I have used the code used in this demo :
http://www.telerik.com/help/aspnet-ajax/grid-reducing-filtermenu-options.html

I want to customize the FilterMenu items based on the column name, Left align them and have a constant look and feel(as described in snapshots) for the hover effect.
Any form of help will be appreciated.

Regards,
Anup
Anup
Top achievements
Rank 1
 answered on 26 Mar 2012
3 answers
81 views
Hello, If i use a Custom Provider with the fileexplorer i can Not select Files in the fileview. This also does Not work in the examples. Any workaround? Tanks Thorsten
Dobromir
Telerik team
 answered on 26 Mar 2012
1 answer
196 views
'I want do download the corresponding file when i click the grid Image button
'Here i paste my code. it shows this bug(shows in attachment)


Protected
Sub ExplorerGrid_ItemCommand(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles VersionGrid.ItemCommand
        Dim objGridDataItem As GridDataItem = CType(e.Item, GridDataItem)
 
        Dim stringVersion As String
        stringVersion = objGridDataItem.Item("Version").Text
 
        Dim stringPath As String = Request.QueryString("filepath")
        Dim temppath As String = stringPath.Substring(0, stringPath.LastIndexOf("\"))
        Dim filename As String = stringPath.Substring(stringPath.LastIndexOf("\") + 1)
        filename = filename.Replace("'", "''")
        Dim sqlcon As New SqlConnection(ConfigurationManager.ConnectionStrings("MyConnection").ToString())
 
        Dim objSqlDASec As New SqlDataAdapter("select * from Sample where [DocumentName]= '" + filename + "'", sqlcon)
        objSqlDASec.SelectCommand.CommandTimeout = 1200
 
        Dim objDTSec As New DataSet
        objDTSec.Clear()
 
        objSqlDASec.Fill(objDTSec)
 
        Dim buffer As Byte()
 
        buffer = objDTSec.Tables(0).Rows(0)("Document")
 
        Try
 
            Dim req As New WebClient
            Dim response As HttpResponse
            response = HttpContext.Current.Response
            response.Clear()
            response.ClearContent()
            response.ClearHeaders()
            response.Buffer = True
            response.AddHeader("Content-Disposition", "attachment; filename=" + filename)
            response.ContentType = "application/octet-stream"
            response.BinaryWrite(buffer)
            response.Flush()
            response.End()
 
 
        Catch ex As Exception
 
        End Try
    End Sub
Pavlina
Telerik team
 answered on 26 Mar 2012
6 answers
221 views
Hi,

im trying to extract the value of a radcombobox. Previously this value was stored in a regular asp textbox, then I could do like this to get the last part of the string value in js.

Right(document.getElementById('Mybox').value, 5) < 1000

this number is built up like so. 'project-module-1xxx'

I.E I only want to get values that are higher than 1000. How can I get the same functionality from a radcombobox ?

I tried with

Right($find("Mybox").get_text(), 5) < 1000) but that didnt recognize the right functionality.

all help appreciated,

 

 


Terje Sondresen
Top achievements
Rank 1
 answered on 26 Mar 2012
2 answers
174 views
Hi all.

I have the list and grid view and using the designer is okay however on numerous occasions if you click on edit web part, the view selected changes and shows the wrong title in edit mode receive regular errors like;

Server Error in '/' Application.
--------------------------------------------------------------------------------
 
The specified view is invalid.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
 
Exception Details: System.ArgumentException: The specified view is invalid.
 
Source Error:
 
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. 
 
Stack Trace:
 
 
[ArgumentException: The specified view is invalid.]
   Microsoft.SharePoint.SPViewCollection.get_Item(Guid guid) +26039668
   Telerik.Ajax.SharePoint.TelerikDataBoundWebPart.get_CurrentView() +321
   Telerik.Ajax.SharePoint.SPListBoundRadControlToolPart.SetUpListViewCombo() +725
   System.Web.UI.Control.EnsureChildControls() +146
   System.Web.UI.Control.PreRenderRecursiveInternal() +61
   System.Web.UI.Control.PreRenderRecursiveInternal() +224
   System.Web.UI.Control.PreRenderRecursiveInternal() +224
   System.Web.UI.Control.PreRenderRecursiveInternal() +224
   System.Web.UI.Control.PreRenderRecursiveInternal() +224
   System.Web.UI.Control.PreRenderRecursiveInternal() +224
   System.Web.UI.Control.PreRenderRecursiveInternal() +224
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3394
 
  
 
 
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.4963; ASP.NET Version:2.0.50727.4971

Marin
Telerik team
 answered on 26 Mar 2012
2 answers
82 views
Hi all,

I'm using RadTreeView1.GetXml to save the state of my TreeView and repopulate it after postbacks.

I've done a test by replaceing text in a node, and based on that I can tell that saving and repopulating the TreeView is working fine.

The problem is that when I contract some of the nodes, then select(Click on) a node, there is a posteback, and all the nodes are revertted to thier expanded state again.

Expanding and contracting nodes seems to be happening on the client side,  as there is no postback when this happens.
The postback dose happen when I click on a spesific node, that is when I use GetXml to save the state, but it dose not seem to be saving the updated state on the nodes.

Here is the code, Please let me know what I am missing here.
<telerik:RadTreeView ID="RadTreeView1" Runat="server"
    OnNodeClick="RadTreeView1_NodeClick" EnableDragAndDrop="True" Skin="Vista"
    OnContextMenuItemClick="RadTreeView1_ContextMenuItemClick"
    OnNodeEdit="RadTreeView1_NodeEdit" OnNodeDrop="RadTreeView1_HandleDrop"
    SingleExpandPath="True" EnableViewState="true" >
    <ContextMenus>
             <telerik:RadTreeViewContextMenu ID="RightClick" runat="server">
                <Items>
                <telerik:RadMenuItem Value="NewParentNode" Text="Create New Parent Folder" >
                    </telerik:RadMenuItem>
                    <telerik:RadMenuItem Value="NewNode" Text="Create New Folder" >
                    </telerik:RadMenuItem>
                    <telerik:RadMenuItem IsSeparator="true">
                    </telerik:RadMenuItem>
                    <telerik:RadMenuItem Value="NewVirtualDocument" Text="New Virtual Document" >
                    </telerik:RadMenuItem>
                    <telerik:RadMenuItem Value="UploadPDF" Text="Upload PDF" >
                    </telerik:RadMenuItem>
                    <telerik:RadMenuItem IsSeparator="true">
                    </telerik:RadMenuItem>
                    <telerik:RadMenuItem Value="DeleteNode" Text="Delete Folder" >
                    </telerik:RadMenuItem>
                </Items>
                <CollapseAnimation Type="none" />
            </telerik:RadTreeViewContextMenu>
      </ContextMenus>
</telerik:RadTreeView>
and server side
protected void RadTreeView1_NodeClick(object sender, RadTreeNodeEventArgs NodeEvent)
{
    clickedNode = NodeEvent.Node;
    ViewState["ClickedNode"] = clickedNode.Value.ToString();
    createDynamicTable(Convert.ToInt32(ViewState["ClickedNode"].ToString()));
 
    string savetreeViewState = RadTreeView1.GetXml();
    savetreeViewState = savetreeViewState.Replace("South Africa", "save state is working");
    Session["myTreeView"] = savetreeViewState;
 }

Thank you for your time.
Carl
Top achievements
Rank 1
 answered on 26 Mar 2012
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?