Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
100 views
Because the context menu on the rad editor does not support nested menus, I have added a custom item to the context menu.  When the user mouses over the custom menu item it shows and positions the new rad menu accordingly.  It seems to be working very nicely except when the user shows the new rad menu but does not select anything it does not hide.  I tried 
contextMenu.add_hide(function (sender, args) {
            var menu = $find("<%=NestedContextMenu.ClientID %>");
            menu.hide();
            alert('hiding');
        });

and it works fine.  But if I have the above code and the following code:
var editor = $find("<%=TemplateEditor.ClientID%>");
 
menu.add_itemClicked(function (sender, args) {
    var menuItemValue = args.get_item()._getData().text;
    var editor = $find("<%=TemplateEditor.ClientID%>");
    editor.setFocus();
    editor.pasteHtml('hello');
    });

the item click event never fires.  I have tried everything.  Does anyone have any suggestions?
Rumen
Telerik team
 answered on 02 Nov 2010
1 answer
84 views
PagerText is not displaying - not sure why - updated the controls to 929.20

Is this the string format for the text or has it changed?
"Navigate pages {4} Page {0} from {1}, rows {2} to {3} from {5}"

Thanks

Martin
Pavlina
Telerik team
 answered on 02 Nov 2010
7 answers
340 views
I have an issue with the RADBinaryImage control, basically I'm using .net code behind to rotate the image but on every rotate the image halfs in size, yet if I refresh the page the image comes back to the correct size...if I remove ResizeMode="Fit" property it dosen't half the image size but I need this property set.

My vb.net code:

Try
          Dim p As SmartPortalLibrary.SurveyPhoto = SmartPortalLibrary.SurveyPhoto.GetPhoto(photoId)
          Dim ms As MemoryStream = New MemoryStream(p.PhotoData)
          Dim image As Bitmap = Bitmap.FromStream(ms)
          image.RotateFlip(RotateFlipType.Rotate90FlipNone)
          ms.Close()
          ms.Dispose()
          ms = New IO.MemoryStream
          image.Save(ms, ImageFormat.Jpeg)
          ms.Seek(0, SeekOrigin.Begin)
          p.SetImage(ms.ToArray)
          p = p.Save
          RadBinaryImage1.DataValue = ms.ToArray
          ms.Close()
      Catch ex As Exception
          'lblMsg.Text = "Error Rotating Image: " & ex.Message
          'lblMsg.CssClass = "lblHeaderRed"
      End Try


RADBinaryImage:
<telerik:RadBinaryImage AutoAdjustImageControlSize="true" ResizeMode="Fit" Width="1000px" Height="600px" runat="server" ID="RadBinaryImage1" />            


Orginal Image screenshot:
1

When I have rotated the image 180degrees (as you can see it has halfed size!)
2


Craig Mellon
Top achievements
Rank 1
 answered on 02 Nov 2010
2 answers
190 views
I tried to use custom css class for RadTab, I defined two classes for normal/selected tab
.SelectedTab
{
    font-weight: bold !important;
    background-image: url('../../Images/Navi_Buttons/01_Selected.png');
    background-repeat: no-repeat;
    width: 164px;
    height: 22px;
    text-align: center;
    color: White;
}
.CustomTab
{
    font-weight: bold !important;
    background-image: url('../../Images/Navi_Buttons/02_NotSelected.png');
    background-repeat: no-repeat;
    width: 164px;
    height: 22px;
    text-align: center;
    color: White;
}

and in my aspx, I set the property for tab control
<telerik:RadTabStrip ID="RadTabStrip1" runat="server" MultiPageID="RadMultiPage1"
                    SelectedIndex="0" Skin="" EnableEmbeddedSkins="false">
                    <Tabs>
                        <telerik:RadTab Text="AAA" SelectedCssClass="SelectedTab" CssClass="CustomTab" >
                        </telerik:RadTab>
                        <telerik:RadTab Text="BBB" SelectedCssClass="SelectedTab" CssClass="CustomTab">
                        </telerik:RadTab>
                    </Tabs>
                </telerik:RadTabStrip>

All tabs are displayed as CustomTab, and I see in the html, the selected tab has both of SelectedTab and CustomTab
<li class="rtsLI rtsFirst"><a class="rtsLink CustomTab rtsSelected SelectedTab" href="#">

Please help to check it. Thanks
he
Top achievements
Rank 1
 answered on 02 Nov 2010
1 answer
108 views
Hello,

I have a problem to find button from RadToolBarSplitButton.   (in c#)
pls Help
Shinu
Top achievements
Rank 2
 answered on 02 Nov 2010
2 answers
149 views
Hi,
I've run into a display problem using RadEditor in IE when ToolbarMode="ShowOnFocus". Everything's OK in Firefox, but in IE 7 or 8, when you click in the editor content area, the entire content area gets pushed downwards a few pixels when the toolbars display. Although it doesn't sound a big problem, it's having a ripple effect on the rest of my page's content.

I assumed it was likely to be a CSS interefence problem from my application's CSS but the problem persists even in the basic test page below:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="editor.aspx.cs" Inherits="Editor" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server"/>
    <h1>Heading</h1>
    <h1>Heading</h1>
    <h1>Heading</h1>
    <telerik:RadEditor ID="RadEditor1" runat="server" ToolbarMode="ShowOnFocus" />
    </form>
</body>
</html>

I'm running ASP.NET Controls v2010.2.713.40 and using the Net 4.0 library. Any ideas how I can overcome this?
Regards, Ian
Ian
Top achievements
Rank 1
 answered on 02 Nov 2010
1 answer
80 views

When I change the order of the items/rows in the grid using client side code, I would like to find the new order representation.
I used the MasterTableView.Items collection and I end up with the original order, as when I bind the grid with the data. 

What is the correct collection property to iterate through to retrieve the current row order of the rearranged grid?

  <telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
        <script type="text/javascript">
            var _selectedRow;
            function radgvAddress_RowSelected(sender, args) {
                _selectedRow = $get(args.get_id());

            }

            function moveRowUp() {
                if (_selectedRow && _selectedRow.sectionRowIndex > 0) {
                    swapRows(_selectedRow, _selectedRow.parentNode.rows[_selectedRow.sectionRowIndex - 1])
                }
            }

            function moveRowDown() {
                if (_selectedRow && _selectedRow.sectionRowIndex < _selectedRow.parentNode.rows.length - 1) {

                    swapRows(_selectedRow, _selectedRow.parentNode.rows[_selectedRow.sectionRowIndex + 1])
                }
            }

            function serializeChanges(index1, index2) {
                var reorderInput = document.getElementById("ReorderChanges");
                if (reorderInput) {
                    reorderInput.value += index1 + "," + index2 + ";";
                }
            }

            function swapRows(sourceRow, targetRow) {
                for (var i = 0; i < sourceRow.cells.length; i++) {
                    var cellContent1 = targetRow.cells[i].innerHTML;
                    var cellContent2 = sourceRow.cells[i].innerHTML;
                    targetRow.cells[i].innerHTML = cellContent2;
                    sourceRow.cells[i].innerHTML = cellContent1;
                }
                $find("<%= radgvAddress.MasterTableView.ClientID %>").selectItem(targetRow);
                serializeChanges(sourceRow.sectionRowIndex, targetRow.sectionRowIndex);
            }
        </script>
    </telerik:RadScriptBlock>



//// I've used a foreach statement also but then I figured it was the collection.  radgvAddress.MasterTableView.Items return the orginal order for us.

for (int i = radgvAddress.Items.Count; i > 0; i--)
                {
                    //int PatientAddressID = Convert.ToInt32(radgvAddress.Items[i - 1].OwnerTableView.DataKeyValues[radgvAddress.Items[i - 1].ItemIndex]["PatientAddressID"]);
                    int PatientAddressID = Convert.ToInt32(radgvAddress.MasterTableView.Items[i - 1].GetDataKeyValue("PatientAddressID"));
                    QuickviewPMS_BO.PatientAddress PatientAddressObj = QuickviewPMS_BO.PatientAddress.GetPatientAddress(PatientAddressID, SessionHelper.SessionUserObjectsInfo.ClientId);
                    PatientAddressObj.AddressOrder = i;
                    if (!PatientAddressObj.IsValid)
                    {
                        GlobalHelper.ShowMessage(lblMessage, GlobalHelper.GetBrokenRules(PatientAddressObj), GlobalHelper.MessageType.Error);
                        return;
                    }
                    PatientAddressObj.Save();
                                 } 
  radgvAddress.Rebind();

            }

Iana Tsolova
Telerik team
 answered on 02 Nov 2010
1 answer
285 views
Hey everyone

i have a RadNumericTextbox inside grid edit form--
<telerik:RadNumericTextBox ID="txtQuantityE" autocomplete="off" runat="server" Skin="Hay"
                                                                EmptyMessage="Enter Quantity" SelectionOnFocus="CaretToEnd" ToolTip="Enter Quantity to place Order"
                                                                Culture="English (United States)" Height="14px" Width="141px" MaxValue="9999"
                                                                MinValue="1">
                                                                <NumberFormat GroupSeparator="" DecimalDigits="0" AllowRounding="true" KeepNotRoundedValue="false" />
                                                                <ClientEvents OnKeyPress="KeyPress" />
                                                            </telerik:RadNumericTextBox>
javascript --
function show(txtQuantityE, lblRate, lblAmount, Amount)
            {
               var txtQuantityE = $find(txtQuantityE);
               var lblRate = document.getElementById(lblRate);
               var lblAmount = document.getElementById(lblAmount);
               var Amount = document.getElementById(Amount);
               Amount.value = parseInt(txtQuantityE.get_value()) * parseInt(lblRate.innerHTML);
               lblAmount.innerHTML = parseInt(txtQuantityE.get_value()) * parseInt(lblRate.innerHTML);
            }
            function KeyPress(sender, args)
            {
                if (args.get_keyCharacter() == sender.get_numberFormat().DecimalSeparator) {
                    args.set_cancel(true);
                }
                if(args.get_keyCode() == 45)
                {
                alert("Enter non-negative numbers only");
                args.set_cancel(true);
                
            }
codebehind--
txtQauntityE.Attributes.Add("onblur", "return show('" + txtQauntityE.ClientID + "','" + lblRate.ClientID + "','" + lblAmount.ClientID + "','" + Amount.ClientID + "')");
is it possible to get the product on label on text change of textbox,by keypress event?....i want the text of label to change with text change of textbox.

Thanks
Amit
Dimo
Telerik team
 answered on 02 Nov 2010
3 answers
309 views
Hello,

I have a problem with handling a simple radlistview control.
The result must be like Image1.jpg (attached).

My aspx code:
<asp:Panel ID="Panel3" Width="112px" BorderWidth="1px" runat="server">
            <telerik:RadListView runat="server" ID="RadListView1" DataSourceID="SMapXmlDataSource" >
                <ItemTemplate>
                    <asp:Panel class="rlvI" ID="Panel1" BorderWidth="2px" BorderColor="Red" style="vertical-align:middle;"  Height="35px" Width="52px" runat="server">
                        <asp:ImageButton ID="SMapImageButton" runat="server" CommandArgument='<%# XPath("@name") %>' ImageUrl='<%# string.Format("~/Common/Img/Cities/{0}/SmallMaps/{1}.jpg", City, XPath("@name").ToString())  %>' 
                                            CommandName="SmallMaps" Height="32px"  BackColor="Blue" OnCommand="CommonSmallMapImageButton_Command" Width="50px" />
                    </asp:Panel>
                </ItemTemplate>
                <LayoutTemplate>
                    <div class="RadListView RadListViewFloated RadListView_<%# Container.Skin %>" >
                        <div  class="rlvFloated rlvAutoScroll">
                            <div id="itemPlaceholder" runat="server">
                               
                            </div>
                        </div>
                    </div>
                </LayoutTemplate>
         </telerik:RadListView>
     </asp:Panel>

The above code result is shown in image2.jpg.

As you can see there is a space above and bellow every small map. how can I remove this space. I tried to play with Panel1 height (I changed it to 32px), but it is not solving the problem but it displays a scroolbars as it shown is Image3.jpg.

Please, what is wrong with my code in order. I need to get the result which is shown in Image1.jpg.
It is apprecited to send me the modified code.

Regards,
Bader
Dimo
Telerik team
 answered on 02 Nov 2010
2 answers
84 views
I have a very basic Grid with a GridRatingColumn. I have applied the WebBlue skin to the Grid. However, only the very last record enables the GradRatingColumn to diplay the correct skin colors. Here is a link to a screen shot.

Rad Grid Issue

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default3.aspx.vb" Inherits="Default3" %>
  
<%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %>
  
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  
  
</head>
<body>
    <form id="form1" runat="server">
 <telerik:RadGrid ID="rgd_MyRequests" runat="server" DataSourceID="sds_MyRequests" 
 GridLines="None" Skin="WebBlue" Width="800px">
<MasterTableView AutoGenerateColumns="False" DataSourceID="sds_MyRequests">
<CommandItemSettings ExportToPdfText="Export to Pdf"></CommandItemSettings>
  
<RowIndicatorColumn>
<HeaderStyle Width="20px"></HeaderStyle>
</RowIndicatorColumn>
  
<ExpandCollapseColumn>
<HeaderStyle Width="20px"></HeaderStyle>
</ExpandCollapseColumn>
    <Columns>
        <telerik:GridBoundColumn DataField="EnteredDate" DataType="System.DateTime" 
            HeaderText="Entered Date" SortExpression="EnteredDate" 
            UniqueName="EnteredDate" ItemStyle-Width="75px" DataFormatString="{0:MM/dd/yyyy}" ItemStyle-HorizontalAlign="Center">
<ItemStyle HorizontalAlign="Center" Width="75px"></ItemStyle>
        </telerik:GridBoundColumn>
        <telerik:GridRatingColumn DataField="Priority" UniqueName="column" 
            ReadOnly="True" HeaderText="Priority">
            <ItemStyle Width="70px" Wrap="False" />
        </telerik:GridRatingColumn>
        <telerik:GridBoundColumn DataField="Status" 
            DataType="System.Int32" HeaderText="Status" SortExpression="Status" 
            UniqueName="Status" ItemStyle-Width="25px" ItemStyle-HorizontalAlign="Center">
<ItemStyle HorizontalAlign="Center" Width="25px"></ItemStyle>
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="CategoryName" HeaderText="Issue Category" 
            SortExpression="CategoryName" UniqueName="CategoryName" 
            DataType="System.Int32" ItemStyle-Width="75px">
<ItemStyle Width="75px"></ItemStyle>
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="Subject" HeaderText="Subject" 
            SortExpression="Subject" UniqueName="Subject">
        </telerik:GridBoundColumn>
    </Columns>
    <HeaderStyle Font-Bold="False" Font-Italic="False" Font-Overline="False" 
        Font-Strikeout="False" Font-Underline="False" HorizontalAlign="Center" 
        Wrap="True" />
</MasterTableView>
</telerik:RadGrid>
      
  
    <asp:SqlDataSource ID="sds_MyRequests" runat="server" 
        ConnectionString="<%$ ConnectionStrings:IT_CentralConnectionString %>" 
        SelectCommand="SELECT [EnteredDate], [Priority], [Status], [CategoryName], [Subject] FROM [vw_ITC_Ticket_Details] WHERE [RequestorUserName] = 'hpotter' AND (CompletedDate IS NULL) ORDER BY [EnteredDate]">
        </asp:SqlDataSource>
  
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
    </telerik:RadScriptManager>
    </form>
</body>
</html>
Dimo
Telerik team
 answered on 02 Nov 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Hiba
Top achievements
Rank 1
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Hiba
Top achievements
Rank 1
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?