Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
193 views
I have a DataListView that contains a panelbar and the panelbar contains a textbox and button. I have the ListView bound to a SQL Datasource and the panelbar is not bound to anything. Inside the panel bar I need to set values to these controls using the Eval() command. However, it is returning null. If I move the textbox and button outside of the panelbar they can grab the data no problem. Once inside it's null. I know it's because they're looking for the datasource of the panelbar... is there anyway to override this? I want the textbox and button to get their values from the datasource of the listview.

<telerik:RadListView ID="wall" runat="server" Skin="Metro" AllowPaging="True" PageSize="200"
                    DataSourceID="WallSource">
                    <ItemTemplate>
                        <div class="wallPostPicture">
                            <telerik:RadBinaryImage ID="imgPosterPic" runat="server" DataValue='<%# Eval("Image") %>'
                                Height="50px" Width="50px" AutoAdjustImageControlSize="false" CssClass="friend" />
                            <telerik:RadToolTip ID="WallTip" runat="server" Position="MiddleRight" RelativeTo="Element"
                                Skin="Metro" TargetControlID="imgPosterPic" ShowEvent="OnMouseOver" HideEvent="LeaveTargetAndToolTip"
                                Animation="Resize" AutoCloseDelay="0" Title='<%# string.Format("{0} {1}", Eval("FirstName").ToString(), Eval("LastName").ToString())%>'>
                                <div>
                                    <div>
                                        <asp:Label ID="lblStatus" runat="server" Text='<%# Eval("Status") %>' /></div>
                                </div>
                            </telerik:RadToolTip>
                        </div>
                        <div style="float: right; padding-top: 10px;">
                            <asp:Label ID="lblCounter" runat="server" Text="0" CssClass="CounterText" ForeColor="LightGray" />
                        </div>
                        <div class="wallPostTitle">
                            <%# string.Format("{0} {1}", Eval("FirstName").ToString(), Eval("LastName").ToString())%></div>
                        <div class="wallPostDate">
                            <%# Eval("Date").ToString().ToLower() %></div>
                        <div class="wallPostDate" style="text-decoration: 'underline'">
                            <asp:LinkButton ID="lbtnRepost" runat="server" Text="repost" /> <b>·</b> <asp:LinkButton
                                ID="LinkButton1" runat="server" Text="upvote" /></div>
                        <div class="wallPostValue">
                            <%# Eval("Value") %></div>
                        <div class="wallPostComments">
                            <telerik:RadPanelBar runat="server" ID="RadPanelBar1" ExpandMode="SingleExpandedItem"
                                AllowCollapseAllItems="true" Skin="Metro" Width="100%" PersistStateInCookie="true">
                                <Items>
                                    <telerik:RadPanelItem Text='comments' Expanded="False" runat="server">
                                        <ContentTemplate>
                                            <telerik:RadListView runat="server" ID="listComments" Skin="Metro" AllowPaging="true"
                                                PageSize="15" DataSourceID="commentSource">
                                                <ItemTemplate>
                                                    <div class="commentBlock">
                                                        <div class="wallPostPicture">
                                                            <telerik:RadBinaryImage ID="imgPosterPic" runat="server" DataValue='<%# Eval("Image") %>'
                                                                Height="40px" Width="40px" AutoAdjustImageControlSize="false" CssClass="friend" />
                                                        </div>
                                                        <div class="wallPostTitle">
                                                            <%# string.Format("{0} {1}", Eval("FirstName").ToString(), Eval("LastName").ToString())%>
                                                        </div>
                                                        <div class="wallPostDate">
                                                            <%# Eval("Date").ToString() %>
                                                        </div>
                                                        <div class="wallPostValue">
                                                            <%# Eval("Value") %>
                                                        </div>
                                                    </div>
                                                </ItemTemplate>
                                            </telerik:RadListView>
                                            <span style="float: right; padding: 0px 10px 0px 0px;">
                                                <asp:Button ID="btnPostComment" runat="server" CssClass="blueButton" Text="post" CommandArgument='<%# Eval("PostId") %>' OnCommand="btnPostComment_Click" /></span>
                                            <div class="boxStatusmng" style="margin: 5px 0px 10px 0px; padding-left: 10px;">
                                                <span class="bannerStatusMngInput">
                                                    <asp:TextBox ID="txtCommentIt" runat="server" CssClass="statusbox" Height="35px" Text='<%# Eval("PostId") %>' /></span>
                                                    <asp:HiddenField runat="server" ID="hideWallId" Value='<%# Eval("PostId") %>' />
                                                <ajaxToolkit:TextBoxWatermarkExtender ID="wmComment" runat="server" TargetControlID="txtCommentIt"
                                                    WatermarkCssClass="statusboxwm" WatermarkText="say something..." />
                                            </div>
                                        </ContentTemplate>
                                    </telerik:RadPanelItem>
                                </Items>
                            </telerik:RadPanelBar>
                        </div>
                        <asp:SqlDataSource runat="server" ID="commentSource" ConnectionString="<%$ ConnectionStrings:MySqlConnection %>"
                            SelectCommand='<%# string.Format("SELECT * FROM Comments, UserDetails WHERE PostTargetId = {0} AND UserDetails.UserId = Comments.PosterUserId",  Eval("PostId")) %>' />
                    </ItemTemplate>
                </telerik:RadListView>
                <asp:SqlDataSource ID="WallSource" runat="server" ConnectionString="<%$ ConnectionStrings:MySqlConnection %>"
                    SelectCommand="SELECT FirstName, LastName, Status, Image, Poster, Value, Date, WallUserId, PostId FROM UserDetails, Wall WHERE Wall.WallUserId = @WallUserId AND UserDetails.UserId = Wall.Poster ORDER BY Wall.Date DESC">
                    <SelectParameters>
                        <asp:ControlParameter ControlID="hideme" Name="WallUserId" PropertyName="Value" Type="String" />
                    </SelectParameters>
                </asp:SqlDataSource>
                <asp:HiddenField ID="hideme" runat="server" />
Peter
Telerik team
 answered on 31 May 2012
3 answers
330 views
Hi,

Is there anyway to have a radgrid to keep the same width even if I resize its columns. For example when resizing a specific column automatically resize the other columns to maintain the table width?

Thanks in advance
Pavlina
Telerik team
 answered on 31 May 2012
1 answer
87 views


I am very new to Telerick and having issue in displaying a user control. The element that is being cut off 'Legend' of fieldset. The page gets rendered fine in Firefox or Chrome. But the problem is there with IE.Here with i am attaching four docs. (part of .aspx page, images showing proper , in-correct rendering and part of user control .aspx file. Any help is greatly appreciated
Dobromir
Telerik team
 answered on 31 May 2012
2 answers
126 views
I am trying to get the value of one of RadNumericTextBoxes in a RadListView via javascript and am having issues.  I have had to hardcode the value in the javascript and am looking for a better solution..  Here is the relevant code:
This is the RadListView.  There are repeating text boxes, then there is a total text box.  I have a javascript function that gets the values of the updated text box, then updates the total.
        <telerik:RadListView ID="rlvApproval" runat="server">
            <LayoutTemplate>
                <table>
                    <tr>
                        <td style="width: 250px;">
                        </td>
                        <td style="width: 200px; font-weight: bold;">
                        </td>
                    </tr>
                </table>
                <asp:PlaceHolder ID="itemplaceholder" runat="server" />
                <table>
                                        <tr>
                        <td style="width: 250px;">
                            <asp:Label ID="lblName" runat="server" Text="Total" Font-Bold="true" />
                        </td>
                        <td style="width: 200px; font-weight: bold;">
                            <telerik:RadNumericTextBox ID="txtTotalValue" runat="server" ReadOnly="true" DataType="System.Decimal"
                                Skin="Web20">
                                <NumberFormat DecimalDigits="0" />
                            </telerik:RadNumericTextBox>
                        </td>
                    </tr>
                      
                </table>
            </LayoutTemplate>
            <ItemTemplate>
                <table>
                    <tr>
                        <td style="width: 250px;">
                            <asp:Label ID="lblName" runat="server" Text='<%# Eval("name") %>' />
                        </td>
                        <td style="width: 250px;">
<%--                            <telerik:RadNumericTextBox ID="txtValue" runat="server" DataType="System.Decimal"
                                Skin="Web20" DbValue='<%# DataBinder.Eval(Container.DataItem, "value") %>' MaxValue="100"
                                MinValue="0" AutoPostBack="false">
                                <NumberFormat DecimalDigits="0" />
                            </telerik:RadNumericTextBox>--%>
                                                        <telerik:RadNumericTextBox ID="txtValue" runat="server" DataType="System.Decimal"
                                Skin="Web20" DbValue='<%# DataBinder.Eval(Container.DataItem, "value") %>' MaxValue="100"
                                MinValue="0" AutoPostBack="false" >
                                <NumberFormat DecimalDigits="0" />
                                <ClientEvents OnValueChanged="ValidateWeighting" />
                            </telerik:RadNumericTextBox>
                        </td>
                    </tr>
                </table>
            </ItemTemplate>
            <EmptyDataTemplate>
                <div class="message">
                    <asp:Label ID="lblEmptyMessage" runat="server" SkinID="messageBig" Text="Error loading approval information..." />
                </div>
            </EmptyDataTemplate>
        </telerik:RadListView>
The javascript function is:
function ValidateWeighting(sender, eventArgs) {
    var object = document.getElementById('ctl00_ContentPlaceHolder1_Weighting1_rlvApproval_txtTotalValue');
    //var object = $find(sender.get_id().replace("txtValue", "txtTotalValue"));
    var object2 = document.getElementById('<%= rlvApproval.ClientID %>');
    var current = eval(object.value);
    var old = eventArgs.get_oldValue();
    var newval = eventArgs.get_newValue();
    var tmp = current + (newval - old);
    if (tmp == 100) {
        document.getElementById('<%= btnSave.ClientID %>').disabled = false;
    }
    else {
        document.getElementById('<%= btnSave.ClientID %>').disabled = true;
    }
    object.value = tmp;
}

How do I get the value of txtTotalValue.  I have tried the solution I have seen elsewhere, but am getting errors.  Any idea?
Sam Bronchetti
Top achievements
Rank 1
 answered on 31 May 2012
29 answers
1.1K+ views
0 answers
102 views
Hi,

I have the following problem:

I developed a holiday module for a selfdeveloped Intranet, where you can display holidays of different countries either in a RadCalendar or in a RadGrid.
You can change between the displaymodes with a RadioButtonList with the Items Calendar and List.
The Calendar is surrounded by a div-tag called divCalendar, the List by a div-tag called divList.
I use Skin-Files called Calendar.skin with the SkinID = "DefaultRadCalendar" and GridView.skin with the SkinID = "DefaultRad" with for the controls and I bind them with the controls via the SkinID-property. Everything gets displayed correctly. To change between the displaymodes without a PostBack, I use the RadAjaxManagerProxy. When I change from Calendar to List, everything is allright - the RadGrid gets displayed correctly. When I change back to Calendarmode, the RadCalendar gets displayed incorrectly. It is a mix of an integrated Skin (f.e. Sunset - I use some integrated Skins for other Controls) and my own Skin. When I do a PostBack, everything gets displayed correctly, it's only in the combination with Ajax. It doesn't matter, if I disable embedded Skins, Basestylesheets or AjaxSkinRendering in my RadCalendar or not, appearance is the same. Here is some Code:

AjaxManager
<telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server">
   <AjaxSettings>
      <telerik:AjaxSetting AjaxControlID="CalendarList_RadiobuttonList">
         <UpdatedControls>
            <telerik:AjaxUpdatedControl ControlID="chkCalendar" />
            <telerik:AjaxUpdatedControl ControlID="chkList" />
            <telerik:AjaxUpdatedControl ControlID="divCalendar" />
            <telerik:AjaxUpdatedControl ControlID="divList" />
            <telerik:AjaxUpdatedControl ControlID="CalendarList_RadiobuttonList" />
         </UpdatedControls>
      </telerik:AjaxSetting>
      <telerik:AjaxSetting AjaxControlID="RadComboBox1">
         <UpdatedControls>
            <telerik:AjaxUpdatedControl ControlID="divCalendar" />
            <telerik:AjaxUpdatedControl ControlID="divList" />
         </UpdatedControls>
      </telerik:AjaxSetting>
      <telerik:AjaxSetting AjaxControlID="divCalendar">
         <UpdatedControls>
            <telerik:AjaxUpdatedControl ControlID="divCalendar" />
            <telerik:AjaxUpdatedControl ControlID="RadCalendar1"/>
         </UpdatedControls>
      </telerik:AjaxSetting>
      <telerik:AjaxSetting AjaxControlID="divList">
         <UpdatedControls>
            <telerik:AjaxUpdatedControl ControlID="divList" />
            <telerik:AjaxUpdatedControl ControlID="RadGrid1" />
         </UpdatedControls>
      </telerik:AjaxSetting>
   </AjaxSettings>
</telerik:RadAjaxManagerProxy>


<div ID="divCalendar" runat="server" class="calendar">
              <telerik:RadCalendar ID="RadCalendar1" SkinID="DefaultRadCalendar"
                AutoPostBack="true" runat="server" CultureInfo="de-AT"
                 Width="100%" EnableMultiSelect="False" FocusedDate="2000-01-01"
                 OnDayRender="RadCalendar1_DayRender"
                 OnSelectionChanged="RadCalendar1_SelectionChanged"
                 RangeMaxDate="2099-12-31" RangeMinDate="2000-01-01"
                 SelectedDate="" ViewSelectorText="x"
                 OnDefaultViewChanged="RadCalendar1_DefaultViewChanged">
                <CalendarDayTemplates></CalendarDayTemplates>
              </telerik:RadCalendar>
</div>

It's not possible to send you the module, because it's part of the Intranet and needs other components to run.

Thanks in advance

Martin Holoubek
Martin
Top achievements
Rank 1
 asked on 31 May 2012
1 answer
445 views
i have a BooundColumn in my telerik RadGrid like below :  

<telerik:GridBoundColumn DataField="Status" FilterControlAltText="Filter Status column"
    HeaderText="Status" SortExpression="Status" UniqueName="Status"
    FilterImageToolTip="Filter">
    <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
    <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
</telerik:GridBoundColumn>

Status Column in my sql server 2008 database can accept null values and RadGrid shows them with an empty string.
so i replaced those Empty Strings with the codes below ?  

protected void grdSMS_ItemDataBound(object sender, GridItemEventArgs e)
{
    if (e.Item is GridDataItem)
    {
        GridDataItem item = (GridDataItem)e.Item;
        if (item["Status"].Text == " ")
        {
            item["Status"].ForeColor = Color.Red;
            item["Status"].Text = "Empty";
        }
    }
}

now my problem is i can not filter Empty Columns.  
how can i fix this issue? 

Note:
In the codes upper if (item["Status"].Text == " ") Correction Isif (item["Status"].Text == "&nbsp;")

thanks in advance
Princy
Top achievements
Rank 2
 answered on 31 May 2012
4 answers
97 views

I have a RadEditor in a tooltip which is opened from a RadWindow. When the RadEditor is Enabled, I have added some event handlers to restrict the number of characters entered in the RadEditor (LimitCharacter code from http://www.telerik.com/community/forums/aspnet-ajax/chart/charector-limit-in-rad-editor.aspx). If the browser is refreshed while the editor is in Enabled mode, I get the error:

“Unable to get value of the property 'removeChild': object is null or undefined” .
This seems to happen after
$telerik.removeExternalHandler is called (what I saw in the debug).
I’m not sure what I need to do to handle this, but I have not been able to find a solution. I use the exact same code but without the RadWindow, and it works.
Please let me know if you have any ideas as to what the problem might be.

RadEditor definition:
<telerik:RadEditor runat="server" ID="RadEditor1" OnClientLoad="LimitCharacters" OnClientPasteHtml="OnClientPasteHtml" MaxTextLength="100" EditModes="All"

 

ToolsFile="~/EditorToolBar/Tools.xml" Width="600px" Height="100px" OnInit="RadEditor1_Init" ForeColor="Black" Font-Bold="true" Font-Size="Small" Content='<%# (Eval("Notes") == DBNull.Value || Eval("Notes") == "" || Eval("Notes").ToString() == "null") ? "" : Eval("Notes") %>'>

    <CssFiles>

        <telerik:EditorCssFile Value="~/Styles/RadEditorStyleOverrides.css" />

     </CssFiles>

</telerik:RadEditor>


RadWindow definition (in a different file):
<telerik:RadWindow ID="RadWindow_ConsRecDocs" runat="server" Behaviors="Move,Resize,Close"

NavigateUrl="ConsRecDocs.aspx" Skin="Windows7" Width="900" Height="700" AutoSize="false">

</telerik:RadWindow>

 

Rumen
Telerik team
 answered on 31 May 2012
1 answer
87 views
Hi,

I'm showing all employers in a webpage by orgchart. This works fine. But now I have to show it on telerik report page. How can i do that? 

If I cant do that, let me know how can I show all employers hierarchie on telerik report page?

Thanks..
Peter Filipov
Telerik team
 answered on 31 May 2012
1 answer
149 views
What should i do to automatically close the rad window after 10 seconds?
Princy
Top achievements
Rank 2
 answered on 31 May 2012
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?