Telerik Forums
UI for ASP.NET AJAX Forum
0 answers
69 views
version: Q3 2012
I'm using context menu in RadGrid control in an iframe. But some items seem to be out of the screen, so I can't click them. Codes for js and RadGrid:
function RowContextMenu(sender, eventArgs) {
                var menu = $find("<%=RadMenu1.ClientID %>");
                var evt = eventArgs.get_domEvent();
 
                if (evt.target.tagName == "INPUT" || evt.target.tagName == "A") {
                    return;
                }
                var index = eventArgs.get_itemIndexHierarchical();
                //document.getElementById("radGridClickedRowIndex").value = index;
                iSelectRow = index;
 
                radGrid1 = sender;
                var mt = sender.get_masterTableView();
                var row = mt.get_dataItems()[iSelectRow];
                var sStatus = row.findElement("hfStatus").value;
                var item;
                var allItems = menu.get_allItems();
                var childItem = new Telerik.Web.UI.RadMenuItem();
                menu.trackChanges();
                for (var i = allItems.length - 1; i >= 6; i--) {
                    item = allItems[i];
                    menu.get_items().remove(item);
                }
                switch (sStatus) {
                    case "U":
                        childItem = new Telerik.Web.UI.RadMenuItem();
                        childItem.set_text("编辑测试"); menu.get_items().add(childItem);
                        childItem = new Telerik.Web.UI.RadMenuItem();
                        childItem.set_isSeparator("True"); menu.get_items().add(childItem);
                        childItem = new Telerik.Web.UI.RadMenuItem();
                        childItem.set_text("收样"); menu.get_items().add(childItem);
                        childItem = new Telerik.Web.UI.RadMenuItem();
                        childItem.set_text("暂停"); menu.get_items().add(childItem);
                        childItem = new Telerik.Web.UI.RadMenuItem();
                        childItem.set_text("取消"); menu.get_items().add(childItem);
                        break;
                    case "V":
                        childItem = new Telerik.Web.UI.RadMenuItem();
                        childItem.set_text("编辑测试"); menu.get_items().add(childItem);
                        childItem = new Telerik.Web.UI.RadMenuItem();
                        childItem.set_text("结果录入"); menu.get_items().add(childItem);
                        childItem = new Telerik.Web.UI.RadMenuItem();
                        childItem.set_text("生成工作单"); menu.get_items().add(childItem);
                        childItem = new Telerik.Web.UI.RadMenuItem();
                        childItem.set_isSeparator("True"); menu.get_items().add(childItem);
                        childItem = new Telerik.Web.UI.RadMenuItem();
                        childItem.set_text("完成"); menu.get_items().add(childItem);
                        childItem = new Telerik.Web.UI.RadMenuItem();
                        childItem.set_text("暂停"); menu.get_items().add(childItem);
                        childItem = new Telerik.Web.UI.RadMenuItem();
                        childItem.set_text("取消"); menu.get_items().add(childItem);
                        break;
                    case "C":
                        childItem = new Telerik.Web.UI.RadMenuItem();
                        childItem.set_text("编辑测试"); menu.get_items().add(childItem);
                        childItem = new Telerik.Web.UI.RadMenuItem();
                        childItem.set_text("结果录入"); menu.get_items().add(childItem);
                        childItem = new Telerik.Web.UI.RadMenuItem();
                        childItem.set_isSeparator("True"); menu.get_items().add(childItem);
                        childItem = new Telerik.Web.UI.RadMenuItem();
                        childItem.set_text("认可"); menu.get_items().add(childItem);
                        childItem = new Telerik.Web.UI.RadMenuItem();
                        childItem.set_text("暂停"); menu.get_items().add(childItem);
                        childItem = new Telerik.Web.UI.RadMenuItem();
                        childItem.set_text("取消"); menu.get_items().add(childItem);
                        break;
                    case "A":
                        childItem = new Telerik.Web.UI.RadMenuItem();
                        childItem.set_isSeparator("True"); menu.get_items().add(childItem);
                        childItem = new Telerik.Web.UI.RadMenuItem();
                        childItem.set_text("激活认可"); menu.get_items().add(childItem);
                        childItem = new Telerik.Web.UI.RadMenuItem();
                        childItem.set_text("重新采样"); menu.get_items().add(childItem);
                        break;
                    case "S":
                        childItem = new Telerik.Web.UI.RadMenuItem();
                        childItem.set_isSeparator("True"); menu.get_items().add(childItem);
                        childItem = new Telerik.Web.UI.RadMenuItem();
                        childItem.set_text("释放暂停"); menu.get_items().add(childItem);
                        break;
                    case "X":
                        childItem = new Telerik.Web.UI.RadMenuItem();
                        childItem.set_isSeparator("True"); menu.get_items().add(childItem);
                        childItem = new Telerik.Web.UI.RadMenuItem();
                        childItem.set_text("恢复取消"); menu.get_items().add(childItem);
                        break;
                    default:
                }
                menu.commitChanges();
                menu.show(evt);
 
                evt.cancelBubble = true;
                evt.returnValue = false;
 
                if (evt.stopPropagation) {
                    evt.stopPropagation();
                    evt.preventDefault();
                }
            }

<telerik:RadGrid ID="rgDatas" runat="server" AllowSorting="True" GridLines="None"
                AllowMultiRowSelection="true" OnSortCommand="rgDatas_SortCommand" OnPreRender="rgDatas_PreRender" ShowStatusBar="True">
                <ClientSettings EnableRowHoverStyle="true">
                    <Selecting AllowRowSelect="true"></Selecting>
                    <Resizing AllowColumnResize="True" />
                    <Scrolling AllowScroll="true" UseStaticHeaders="true" />
                    <ClientEvents OnGridCreated="GridCreated" OnRowContextMenu="RowContextMenu" OnRowSelected="RowSelected" />
                </ClientSettings>
                <ExportSettings IgnorePaging="true" OpenInNewWindow="true">
                    <Pdf PageTitle="样品列表" DefaultFontFamily="Arial Unicode MS" PageWidth="297mm" PageHeight="210mm" />
                </ExportSettings>
                <MasterTableView AutoGenerateColumns="false">
                    <Columns>
                        <telerik:GridTemplateColumn HeaderText="样品代号" DataField="SampleID" SortExpression="SampleID"
                            HeaderStyle-Width="150px" ItemStyle-Width="150px" HeaderTooltip="点击排序" UniqueName="SampleID">
                            <ItemTemplate>
                                <asp:Image ID="imgStatus" runat="server" ImageAlign="Middle" />
                                <asp:LinkButton ID="PKID" runat="server" Text='<%# Eval("SampleID"%>' Font-Underline="true"
                                    ForeColor="Blue" />
                                <asp:HiddenField ID="hfStatus" runat="server" Value='<%# Eval("Status"%>' />
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridBoundColumn DataField="JobName" HeaderText="任务代号" SortExpression="JobName"
                            HeaderStyle-Width="150px" ItemStyle-Width="150px" HeaderTooltip="点击排序" UniqueName="JobName" />
                        <telerik:GridBoundColumn DataField="SampleName" HeaderText="样品名称" SortExpression="SampleName"
                            HeaderTooltip="点击排序" UniqueName="SampleName" HeaderStyle-Width="150px" />
                        <telerik:GridTemplateColumn HeaderText="状态" DataField="Status" SortExpression="Status"
                            HeaderStyle-Width="80px" ItemStyle-Width="80px" HeaderTooltip="点击排序" UniqueName="Status">
                            <ItemTemplate>
                                <asp:Label ID="Status" runat="server" Text='<%# Eval("Status"%>'></asp:Label>
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridBoundColumn DataField="TemplateID" HeaderText="样品模板代号" SortExpression="TemplateID"
                            HeaderStyle-Width="100px" ItemStyle-Width="100px" HeaderTooltip="点击排序" UniqueName="TemplateID" />
                        <telerik:GridBoundColumn DataField="LoginDate" HeaderText="送样时间" SortExpression="LoginDate"
                            HeaderStyle-Width="130px" ItemStyle-Width="130px" HeaderTooltip="点击排序" UniqueName="LoginDate" />
                    </Columns>
                    <NoRecordsTemplate>
                    </NoRecordsTemplate>
                </MasterTableView>
            </telerik:RadGrid>
Ghost
Top achievements
Rank 1
 asked on 11 Dec 2013
1 answer
48 views

Would you please let me know how to change the Insert and Cancel at the bottom of Edit to be something else

maybe button or image button link







Here is what I want to change



http://www.prikachi.com/images/262/6838262D.jpg



Shinu
Top achievements
Rank 2
 answered on 11 Dec 2013
1 answer
99 views
After upgrading to 2013 Q3 to 2013 Q3 SP1 , something is off with RadTextBox & MultiLine. Code that was working to split the multi lines into an array no longer works and I have to use a standard ASP TextBox. See code as follows.

<asp:TextBox id="AddhocBatchDates2" TextMode="multiline" runat="server" width="100px" Height="400px"/>
<%--<telerik:RadTextBox ID="AddhocBatchDates" Runat="server" width="100px" TextMode="MultiLine" Height="400px"> </telerik:RadTextBox>--%>
//string BatchDates = AddhocBatchDates.Text;
string BatchDates = AddhocBatchDates2.Text;
 
//None of these work on the telerik control, They all work on the standard asp control
//string[] AllBatchDates = BatchDates.Split('\n');
//string[] AllBatchDates = BatchDates.Split(new string[] { Environment.NewLine }, StringSplitOptions.None);
string[] AllBatchDates = BatchDates.Split(new string[] { "\r\n", "\n" }, StringSplitOptions.None);

Princy
Top achievements
Rank 2
 answered on 11 Dec 2013
1 answer
273 views

I have a grid that has a GridButtonColumn in it.  I have a command name set and call the command name on the grid_itemCommand.  I have a hidden field called PKEY that I need to get the value of when the button on that row it clicked.  How can I get the value of that hidden field?  Right now all I get is &nbsp;, but if I set the visibility to True I get the value.

Princy
Top achievements
Rank 2
 answered on 11 Dec 2013
2 answers
50 views
Hey,
     My SplitButton in Ribbonbar has been "Cover" by the RadPane.
How to solve this problem? 

Thanks a lot..
Yo
Top achievements
Rank 1
 answered on 11 Dec 2013
2 answers
350 views
Hello, all,
  I think that my question might seem silly to many.  I have a request from a Client who would like to change the Text displayed in the Submit Button.  At present, I have not been able to determine how to do this.  Any ideas?

Thank you,
  Dan
Dan
Top achievements
Rank 1
 answered on 10 Dec 2013
7 answers
905 views
Hello,

If we try to display a large amount of items in de radhtmlchart, the x axis item labels overlap and are unreadable. (see attachment)
The size of the chart has to be this small because it is displayed within an iFrame.

Is there a way to "alternate" the visibillity; e.g. the first label is visible, fitfth label is visible, 10th label is visible... and all others in between would be invisible so there would'nt be any overlapping.

Or is there any other solution to such a problem? As mentioned before, width has to remain as is.

Many thanks
Avs8686
Top achievements
Rank 1
 answered on 10 Dec 2013
3 answers
107 views
I have a RadMaskedTextBox with a RegularExpressionValidator. I want to allow users to enter a U.S. style phone number in the correct format, but the phone number field is not required. When the page initially loads, the functionality works as expected; the field only fails validation if the user provided input, and that input is invalid. However, if the page fires any Ajax (RadAjaxManager), the validator fires (and fails), even if no input is provided in this field on submit.  It will work is proper input is provided, essentially making it the field behave as if a RequiredFieldValidator was placed on it.

<telerik:RadMaskedTextBox  ID="txtPhone" runat="server"  Mask="(###) ###-####" TabIndex="29" Width="175px" meta:resourcekey="txtPhoneResource1" ViewStateMode="Enabled" DisplayMask="(###) ###-####" LabelWidth="70px" Rows="1"></telerik:RadMaskedTextBox>
 <asp:RegularExpressionValidator ID="txtPhoneRegularExpressionValidator"
    runat="server" ErrorMessage="Format is (###) ###-####" ControlToValidate="txtPhone"
    ValidationExpression="\(\d{3}\)\s\d{3}-\d{4}" SetFocusOnError="True"></asp:RegularExpressionValidator>
John
Top achievements
Rank 2
 answered on 10 Dec 2013
1 answer
101 views
Hi
How to have a expand button on header to expand all rows?
Princy
Top achievements
Rank 2
 answered on 10 Dec 2013
3 answers
75 views
I am using DropDownTree on a page to display hierarchical data with filtering functionality and I want to filter a only particular level of nodes. Like if I am displaying Customers and their branch offices in hierarchy, then I just want to filter customer on the basis of filter provided.

Can you help me in this??

Thanks in advance.
Plamen
Telerik team
 answered on 10 Dec 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?