Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
153 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
81 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
294 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
315 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
90 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
1 answer
123 views
The scenario :
My customer wants the tree node text to be edited after some button the page clicked. The scenario is as follows:
1 button clicked
2 selected node in tree became editable (displayed inside textbox)
3 after losing focus the changes are saved

My Code :
When i populate the tree nodes i set the

AllowEdit property to false - to prevent node became editable when clicked.
in the button_Click eventhandler i put call to

 

startNodeInEditMode function

 

as in the following code:

public void startNodeInEditMode(string nodeValue)
{
                 
    string js = "Sys.Application.add_load(editNode); function editNode(){ ";
    js += "var tree = $find(\"" + RadTreeView1.ClientID + "\");";
    js += "var node = tree.get_selectedNode();";
    js += "if (node) node.startEdit();";
    js += "Sys.Application.remove_load(editNode);};";
    RadScriptManager.RegisterStartupScript(Page, Page.GetType(), "nodeEdit", js, true);           
}
protected void RadTreeView1_NodeEdit(object sender, RadTreeNodeEditEventArgs e)
{

     e.Node.Text = e.Text;


The Problem :
The changed  text of the node returns back to old version of text (the changes suddenly disappear after few seconds and old text appear)
Althougt i see that changes are saved in db inside the RadTreeView1_NodeEdit function.


Please help








shootermv
Top achievements
Rank 1
 answered on 02 Nov 2010
1 answer
100 views
Hi,

I'm creating a RadGrid totally programmatically in the code behind in a server control.  This grid contains a GridButtonColumn that triggers a routine in the code behind.  It works, but the first time the page is rendered, the button requires two clicks.  It does postback on the first click, but the command handler is not called.  On the second click, the command handler is called.  Any ideas what I'm doing wrong.  Thanks in advance for your help.
Princy
Top achievements
Rank 2
 answered on 02 Nov 2010
1 answer
225 views
Required functionality, on upload from the file explorer upload dialog if the document being uploaded already exists(and overwrite files is not selected), automatically rename the document with a new version number, and upload it.  How do I cancel the validation that happens between the ItemCommand() and custom content provider method StoreFile()?  Currently, ItemCommand() method fires, I am not able to change the upload.filename (read only) in this method.  The validation then fires preventing the StoreFile() method, so I am not able to modify the filename in this method either.  I would really like to remove this automated validation, and add my own.

Thanks!
Michelle
Fiko
Telerik team
 answered on 02 Nov 2010
1 answer
173 views

I have a requirement for a project that I'm having some difficulty getting to work.  I've looked at the following post, http://www.telerik.com/community/forums/aspnet-ajax/grid/client-side-expand-collapse-of-group.aspx, but it only takes me so far.  For my page, I have a grid that is configured for client-side grouping.  I have a requirement that the expanded groups are persisted on grid rebind.  There is a control on the page that allows the user to select from a list of items that translate to the groups in the grid.  So, the user selects 3 items in the list and there are 3 groups of those selected items in the grid, the user selects 5 items from the list and there are 5 groups in the grid, etc.  In other words the number of groups is variable based on user selection. 
I've set up a web service to handle the persisting of the group information via ajax callback from the page, and that all works fine.  The problem I'm having is that there isn't any way to get the selected group information in the OnGroupExpanded or OnGroupCollapsed events.  It appears that the sender is the grid itself and the event args are empty?  I currently have the following code, based on the link above:


                               


<telerik:RadGrid ...>
    <ClientSettings EnableRowHoverStyle="false">
        <ClientEvents OnGroupExpanded="groupExpanded" />
    </ClientSettings>
    ...
</telerik:RadGrid>

                                               


function
groupExpanded(sender, e) {
var grid = $find(sender.get_id());
var expandedGroupItems = grid._expandedGroupItems;
var lastItemId = expandedGroupItems[expandedGroupItems.length - 1];
alert("Owner TableView: " + lastItemId.split('!')[0]);
alert("Table Row Index : " + lastItemId.split('!')[1]);
}


In the example, it shows getting the row index by parsing the item ID and then this ID can be used server-side to set the row expansion.  However with variable groups, that ID is also variable (I've tested as such, the IDs change as groups are added or removed).  Is there really no way to get at the group item that was expanded or collapsed directly?  What I'd like, is to use our own internal unique id for the group, but it doesn't look like any group information is exposed at all in these events.


Also, I'd like to say that the documentation for OnGroupsExpanded and OnGroupsCollapsed is incorrect.  It states that the sender is a GridDataItem, when in fact it is the grid itself.  It is a bit confusing.


Any and all help would be greatly appreciated.



Thanks,

-Matt.


Radoslav
Telerik team
 answered on 02 Nov 2010
1 answer
81 views
when i m trying to show image in calender control,the day vale can not  seen.
Shinu
Top achievements
Rank 2
 answered on 02 Nov 2010
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?