Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
663 views

Hi,

I've not been using Telerik for very long, so this may be an obvious one...

I’m using a Grid control to display some percentages, which are stored in the database as decimal values  (0.02, 0.33, etc.)

I have set the DataFormatString of the appropriate columns in my grid to a percentage format - {0:0.00%} so that the values are displayed as whole percentages rather than decimals.

However, when the user opens up my edit form, I want to replicate the same behaviour in the RadNumericTextBoxes so that the user sees a percentage value (e.g.  ā€œ20%ā€), can input a new percentage, but the textbox will return the decimal value back to the data source (0.02).

Is this possible with the existing control, or do I have to create a specialised custom control?


Thanks,

Shane
Daniel
Telerik team
 answered on 09 Jul 2010
3 answers
285 views
Some context to this particular task;

I have a news system I am updating with the ability to see comments and to post comment in a RadWindow.  So far, I have been able to get the "show comments" to work by using a combination of the "select" command and session variables, but when I try to wire up the other LinkButton to open another RadWindow to insert a new comment into the database, it seems to default to the code I have done for the selectedItem instead.  I'm hoping someone can help me figure this one out.

the *.aspx:
<!-- Windows Begin --> 
<telerik:RadWindowManager ID="TrackWindowManager" runat="server" ShowContentDuringLoad="False">  
    <Windows> 
        <telerik:RadWindow runat="server" ID="CommentsWindow" 
            VisibleOnPageLoad="false" 
            Title="Comments Window" 
            Width="600" Height="500" 
            NavigateUrl="~/NewsComments.aspx" /> 
        <telerik:RadWindow runat="server" ID="PostCommentWindow" 
            VisibleOnPageLoad="false" 
            Title="Post Comments" 
            Width="600" Height="500" 
            NavigateUrl="~/PostNewsComment.aspx" /> 
    </Windows> 
</telerik:RadWindowManager> 
<!-- Windows End --> 
 
<!-- RadOpen Javascript begins --> 
<script type="text/javascript">  
    function openRadWin()   
        {  
            radopen(null, "CommentsWindow");  
        }                                                                        
</script> 
<!-- RadOpen Javascript ends --> 
 
<telerik:RadListView ID="RadListView1" runat="server"   
    DataSourceID="dsNews" 
    DataKeyNames="NewsID">  
    <ItemTemplate> 
        <table cellpadding="0" cellspacing="0" class="NewsTable">  
            <tr> 
                <td class="NewsHeader">  
                    <asp:Label ID="lblTitle" runat="server" Text='<%# Eval("Title") %>' />&nbsp;-  
                    <asp:Label ID="lblDate" runat="server" Text='<%# Eval("ActDate") %>' /> 
                </td> 
            </tr> 
            <tr> 
                <td class="NewsContent">  
                    <asp:Label ID="lblStory" runat="server" Text='<%# Eval("NewsContent") %>' /> 
                    <asp:Label ID="lblNewsID" runat="server" Text='<%# Eval("NewsID") %>' Visible="false" /> 
                </td> 
            </tr> 
            <tr> 
                <td> 
                    <asp:LinkButton ID="lbShowComments" runat="server"   
                        Text="Show Comments" 
                        CommandName="Select" />&nbsp;  
                    <asp:LinkButton ID="lbPostComment" runat="server" 
                        CommandName="PostComment" 
                        Text="Post Comment" /> 
                </td> 
            </tr> 
        </table>          
    </ItemTemplate> 
    <SelectedItemTemplate> 
        <table cellpadding="0" cellspacing="0" class="NewsTable">  
            <tr> 
                <td class="NewsHeader">  
                    <asp:Label ID="lblTitle" runat="server" Text='<%# Eval("Title") %>' />&nbsp;-  
                    <asp:Label ID="lblDate" runat="server" Text='<%# Eval("ActDate") %>' /> 
                </td> 
            </tr> 
            <tr> 
                <td class="NewsContent">  
                    <asp:Label ID="lblStory" runat="server" Text='<%# Eval("NewsContent") %>' /> 
                    <asp:Label ID="lblNewsID" runat="server" Text='<%# Eval("NewsID") %>' Visible="false" /> 
                </td> 
            </tr> 
            <tr> 
                <td> 
                    <asp:LinkButton ID="lbShowComments" runat="server"   
                        Text="Show Comments" 
                        CommandName="Select" />&nbsp;  
                    <asp:LinkButton ID="lbPostComment" runat="server" 
                        CommandName="PostComment" 
                        Text="Post Comment" /> 
                </td> 
            </tr> 
        </table>     
    </SelectedItemTemplate> 
</telerik:RadListView> 

and here's the VB.NET code:
    Private Sub RadListView1_SelectedIndexChanged(ByVal sender As ObjectByVal e As System.EventArgs) Handles RadListView1.SelectedIndexChanged  
 
        Dim NewsIdent As Label  
 
        NewsIdent = RadListView1.SelectedItems(0).FindControl("lblNewsID")  
        Session.Add("NewsID", NewsIdent.Text)  
        Me.CommentsWindow.VisibleOnPageLoad = True 
 
    End Sub 
 
    Sub PostComment()  
 
        Dim NewsIdent As Label  
 
        NewsIdent = RadListView1.SelectedItems(0).FindControl("lblNewsID")  
        Session.Add("NewsID", NewsIdent.Text)  
        PostCommentWindow.VisibleOnPageLoad = True 
 
    End Sub 
Rosen
Telerik team
 answered on 09 Jul 2010
2 answers
106 views
I am using RadMenu to display an all-image root menu.  To accomplish my HTML design, I need to place an image directly to the left of my all-image RadMenu.  The problem I'm running into is that RadMenu is wrapped by a DIV (id of "dnn_dnnRADMENU_RadMenu1") which causes a line break and my "nav_left.jpg" image to sit on a line ABOVE the Radmenu.  I've tried applying "display:inline" to the nav_left.jpg image element as well as the RadMenu DIV wrapper but I don't see anything change. 

How can I get this image to sit on the same line as the RadMenu and avoid the wrapping that is shown in the attached screenshot?

Many thanks for your help!

<div id="topnav"
    <img src="/dotnetnuke/Portals/0/Skins/CL/images/nav_left.jpg" width="55" height="110" hspace="0" vspace="0" border="0" /> 
     
     
    <!-- Content emitted by Navigation module...cannot change this HTML --> 
    <div id="dnn_dnnRADMENU_RadMenu1" class="RadMenu RadMenu_"
        <ul class="rmHorizontal rmRootGroup"
            <li class="rmItem rmFirst"><href="http://cms.CL.com/dotnetnuke/About.aspx" class="rmLink"><img alt="" src="Portals/0/Skins/Choicelunch/images/About.jpg" class="rmLeftImage" /><span class="rmText"></span></a
                <div class="rmSlide"
                    <ul class="rmVertical rmGroup rmLevel1"
                        <li class="rmItem rmFirst"><href="http://cms.CL.com/dotnetnuke/About/AboutUs1.aspx" class="rmLink"><span class="rmText">About Us 1</span></a></li> 
                        <li class="rmItem rmLast"><href="http://cms.CL.com/dotnetnuke/About/AboutUs2.aspx" class="rmLink"><span class="rmText">About Us 2</span></a></li> 
                    </ul> 
                </div> 
            </li> 

Ryan Mariotti
Top achievements
Rank 1
 answered on 09 Jul 2010
1 answer
492 views

I have a web page that shows a parameters grid for each parameter group.
To achieve this result I want to use an asp Repeater. I can see the grid correctly but the radGrid update seems not to work. I think the grid cannot find the datasource at the update event.

This is the part on my page:

<table width="100%;">  
        <tr> 
            <td> 
                <div style="width: 7cm;">  
                </div> 
            </td> 
            <td style="text-align: right;">  
            <asp:Label ID="LabelGruppo" runat="server" Text="Label"></asp:Label> 
                <telerik:RadComboBox ID="RadComboBoxGruppo" runat="server" DataSourceID="ObjectDataSourceGruppiParametriComboBox" 
                    DataTextField="NomeGruppo" DataValueField="IdGruppo" AutoPostBack="True" 
                    AppendDataBoundItems="True">  
                    <Items> 
                        <telerik:RadComboBoxItem runat="server" Text="---" Value="-1" /> 
                    </Items> 
                </telerik:RadComboBox> 
                <asp:ObjectDataSource ID="ObjectDataSourceGruppiParametriComboBox"   
                    runat="server" SelectMethod="getAll"   
                    TypeName="MachinaWeb.Services.BO_ConfigurazioneProgramma_GruppoParametri">  
                    <SelectParameters> 
                        <asp:ControlParameter ControlID="HiddenFieldIdCultura" Name="_idCultura"   
                            PropertyName="Value" Type="Int64" /> 
                    </SelectParameters> 
                </asp:ObjectDataSource> 
            </td> 
        </tr> 
    </table> 
    <asp:Repeater ID="Repeater1" runat="server" DataSourceID="ObjectDataSourceGruppiParametri" 
        OnItemDataBound="ParentRepeater_ItemDataBound">  
        <HeaderTemplate> 
        </HeaderTemplate> 
        <FooterTemplate> 
        </FooterTemplate> 
        <ItemTemplate> 
            <div id="IntestazioneGruppo" style="background-color: Orange; border: 1px solid black;  
                text-align: center; margin-bottom: 11px;"> 
                <%# Eval("NomeGruppo") %></div>  
            </b> 
            <telerik:RadGrid ID="RadGridParametriConfigurazione" runat="server" EnableEmbeddedSkins="False" 
                GridLines="None" Skin="MachinaWeb" AllowPaging="true" PageSize="15" AllowAutomaticUpdates="true">  
                <ClientSettings> 
                    <Selecting EnableDragToSelectRows="False" AllowRowSelect="True" /> 
                </ClientSettings> 
                <MasterTableView AutoGenerateColumns="False">  
                    <RowIndicatorColumn> 
                        <HeaderStyle Width="20px"></HeaderStyle> 
                    </RowIndicatorColumn> 
                    <ExpandCollapseColumn> 
                        <HeaderStyle Width="20px"></HeaderStyle> 
                    </ExpandCollapseColumn> 
                    <Columns> 
                        <telerik:GridEditCommandColumn ButtonType="ImageButton" CancelImageUrl="~/Images/ImagesGrid/Cancel.gif" 
                            EditImageUrl="~/Images/ImagesGrid/Edit.gif" UpdateImageUrl="~/Images/ImagesGrid/Update.gif" 
                            InsertImageUrl="~/Images/ImagesGrid/Update.gif" UniqueName="EditCommandColumn" ItemStyle-Width="40px" /> 
                        <telerik:GridBoundColumn DataField="IdParametro" DataType="System.Int64" HeaderText="IdParametro" 
                            SortExpression="IdParametro" UniqueName="IdParametro" Visible="false">  
                        </telerik:GridBoundColumn> 
                        <telerik:GridBoundColumn DataField="IdCultura" DataType="System.Int64" HeaderText="IdCultura" 
                            SortExpression="IdCultura" UniqueName="IdCultura" Visible="false">  
                        </telerik:GridBoundColumn> 
                        <telerik:GridBoundColumn DataField="DescrizioneParametro" HeaderText="DescrizioneParametro" 
                            SortExpression="DescrizioneParametro" UniqueName="DescrizioneParametro">  
                        </telerik:GridBoundColumn> 
                    </Columns> 
                    <EditFormSettings> 
                        <EditColumn> 
                        </EditColumn> 
                    </EditFormSettings> 
                </MasterTableView> 
            </telerik:RadGrid> 
            <asp:ObjectDataSource ID="ObjectDataSourceParametri" runat="server" SelectMethod="getAll" 
        TypeName="MachinaWeb.Services.BO_ConfigurazioneProgramma_Parametro">  
        <SelectParameters> 
            <asp:Parameter Name="_idGruppoParametro" Type="Int64" /> 
            <asp:ControlParameter ControlID="HiddenFieldIdCultura" Name="_idCultura" PropertyName="Value" 
                Type="Int64" /> 
        </SelectParameters> 
    </asp:ObjectDataSource> 
            <asp:HiddenField ID="HiddenFieldIdGruppo" runat="server" Value='<%# DataBinder.Eval(Container.DataItem,"IdGruppo")%>' /> 
        </ItemTemplate> 
        <SeparatorTemplate> 
            <%----- fine gruppo -----%> 
            <div style="margin-bottom: 20px;">  
            </div> 
        </SeparatorTemplate> 
    </asp:Repeater> 
    <asp:ObjectDataSource ID="ObjectDataSourceGruppiParametri" runat="server" SelectMethod="getAll" 
        TypeName="MachinaWeb.Services.BO_ConfigurazioneProgramma_GruppoParametri">  
        <SelectParameters> 
            <asp:ControlParameter ControlID="HiddenFieldIdCultura" Name="_idCultura" PropertyName="Value" 
                Type="Int64" /> 
            <asp:ControlParameter ControlID="RadComboBoxGruppo" Name="_idGruppoSelezionato" PropertyName="SelectedValue" 
                Type="Int64" /> 
        </SelectParameters> 
    </asp:ObjectDataSource> 
    <asp:HiddenField ID="HiddenFieldIdCultura" runat="server" /> 

And this is code:
protected void Page_Load(object sender, EventArgs e)  
    {  
        HiddenFieldIdCultura.Value = ((SessionInformation)Session["sessionData"]).IdCultura.ToString();  
 
        BO_Azienda bo_azienda = new BO_Azienda(((SessionInformation)Session["sessionData"]).IdAzienda);  
        LabelNomeAzienda.Text = bo_azienda.NomeAzienda;  
        LabelIntestazioneAzienda.Text = bo_azienda.Intestazione;  
    }  
 
    protected void ParentRepeater_ItemDataBound(object sender, RepeaterItemEventArgs e)  
    {  
        if ((e.Item.ItemType == ListItemType.Item) || (e.Item.ItemType == ListItemType.AlternatingItem))  
        {  
 
            RadGrid radGrid = (RadGrid)e.Item.FindControl("RadGridParametriConfigurazione");  
            ObjectDataSource ObjectDataSourceParametri = (ObjectDataSource)e.Item.FindControl("ObjectDataSourceParametri");  
            ObjectDataSourceParametri.SelectParameters["_idGruppoParametro"].DefaultValue = ((HiddenField)e.Item.FindControl("HiddenFieldIdGruppo")).Value;  
 
            radGrid.DataSource = ObjectDataSourceParametri;  
            radGrid.DataBind();  
        }  
    } 

Iana Tsolova
Telerik team
 answered on 09 Jul 2010
2 answers
269 views
Hi, I'm trying to use some of the client events of the DateInput in the RadDatePicker and anytime I assign any of the client events a function, not only do they not work, but the date validation stops running and clicking the calendar icon does not bring up the calendar.

One example is as follows:

<telerik:RadDatePicker ID="rdpNotifyDate" runat="server">
    <Calendar UseColumnHeadersAsSelectors="False" UseRowHeadersAsSelectors="False" ViewSelectorText="x"></Calendar>
    <DatePopupButton HoverImageUrl="" ImageUrl="" />
    <DateInput DateFormat="M/d/yyyy" DisplayDateFormat="M/d/yyyy">
        <ClientEvents OnBlur="blur();" />
    </DateInput>
</telerik:RadDatePicker>

I can put any code in the blur() function, none of them work (alerts, changing the values of controls on the page, even nothing at all).  Just having that assignment to do something OnBlur stops the control from working. 

I've tried using the OnFocus and OnValueChanged clientevents as well, with the same results.

Just for fun I even tried to create a new RadDatePicker on a different page:

<telerik:RadDatePicker ID="rdp" runat="server" ClientEvents-OnDateSelected="alert('hello');"></telerik:RadDatePicker>

Without the client event, it works.  With the event, nothing works.. no calendar popup, no date validation.

Thanks in advance,

Chris
Chris McGrath
Top achievements
Rank 1
 answered on 09 Jul 2010
3 answers
332 views
Hello,
When we copy lengthy text into the MS Excel cell then it is automatically overflow to the next cell if it is empty and it does not wrap or hide.

I wana achieve the same above behavior in RadGrid cell when user will copy paste text into the cell.

Please advise

Thanks
Dimo
Telerik team
 answered on 09 Jul 2010
3 answers
146 views

Hi

I wantto use RadToolTipManager/RadToolTip in our project to show warningmessages/tooltip, there is requirement to show more than one tooltip at a time.

Could you please suggest me to show more no of tooltips at a time using clientside code.

Thanks

Balaji Velasiri

Svetlina Anati
Telerik team
 answered on 09 Jul 2010
2 answers
125 views
Could not load file or assembly 'Telerik.Web.Design, Version=2009.3.1208.20, Culture=neutral, PublicKeyToken=121fae78165ba3d4' or one of its dependencies. The system cannot find the file specified.


For some reason I am getting this error on the server.  The application only has the assemblies in the BIN folder.  The version is says it can't load is the version in the BIN. 

Nothing specific to this project has changed.  The only thing I know that recently we upgraded to SQL Server 2008 on that server.

Any ideas of what might be going on??

Robert
Top achievements
Rank 1
 answered on 09 Jul 2010
7 answers
585 views
I have 2 listboxes and would like allow only one way transfers. By default both right and left button show up. Is it possible to disable/remove one of them .

Thanks

Bradley Fitzpatrick
Top achievements
Rank 1
 answered on 09 Jul 2010
1 answer
194 views
Hello everyone,
I've been getting a js error lately that i want to get rid of:

Error: Sys.InvalidOperationException: Two components with the same id 'ctl00_ContentSelections_radContentSelections_i0_i0_subErgonomics120_lstContentSelectionsSubpane' can't be added to the application.
Source File: http://localhost:54435/DeskActive.Client.WebClient/ScriptResource.axd?d=ZZ-uWVOQLk4iKpDOvcKKEpsfax_tLKMv1L3WPP2LUwF4v7bvjA7Z-zekEk9fPhCHk2XNJP_8B994TL8dds4CE_llnczGrBE5mAD5jlOobV41&t=ffffffff9e001c21
Line: 4044

I'll describe the scenario with more details:
I have a menu bar and a radPanelBar.
When a menu item on the menu is clicked the radPanelBar contents change. Each item of the bar has a child item with a List View.
The problem occurs if I'm watching menu item 1, go to menu item 2, and COME back to menu item 1. If I keep going to item 3, 4 or 5 it does not happen..

Thanks in advance!!

Sergio

P.S: there is an image attached to help visualize the idea.
Iana Tsolova
Telerik team
 answered on 09 Jul 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?