Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
119 views
Hello,

I have a radcontextmenu that targets a RadDock and I'm trying to make the right click work for ipad. I saw the implementation in a radtree, but I'm trying to adopt it without success.

Thanks,

Rod

function pageLoad() {
                var isMobileSafari = (navigator.userAgent.search(/like\sMac\sOS\sX;.*Mobile\/\S+/) != -1)
                if (isMobileSafari) {
                    var ctx = document.getElementById("<%= RadDock1.ClientID "%>);
                    ctx.addEventListener('touchstart', handleTouchStart, false);
                    ctx.addEventListener('touchend', handleTouchEnd, false);
                }
            }
 
            var lastContext = null;
            var longTouchID = 0;
            var menuShown = false;
 
            function longTouch() {
                longTouchID = 0;
                menuShown = true;
 
                var ctx = document.getElementById("<%= radMenu1.ClientID "%>);
                ctx.show();
            }
 
            function handleTouchStart(e) {
                longTouchID = setTimeout(longTouch, 1000);
            }
 
            function handleClick(e) {
                if (menuShown) {
                    menuShown = false;
                    document.body.removeEventListener('click', handleClick, true);
                    e.stopPropagation();
                    e.preventDefault();
                }
            }
 
            function handleTouchEnd(e) {
                if (longTouchID != 0)
                    clearTimeout(longTouchID);
                if (menuShown) {
                    document.body.addEventListener('click', handleClick, true);
                    e.preventDefault();
                }
            }
AMS
Top achievements
Rank 1
 answered on 20 Nov 2012
3 answers
120 views
Hi,

I have an Issue in GridDropDownColumn .. I want to set the (DataSourceID ,, ListTextField ,, ListValueField)
in Code-behind Dynamicaly for each Row based on some Condition.

the following Code is Changing the values of each Property but It's not binding or Reflecting anything..

Designer:
<telerik:GridCheckBoxColumn DataField="IsCustomer" SortExpression="IsCustomer"
    UniqueName="IsCustomer" DataType="System.Boolean" ReadOnly="true" Visible="false" >
</telerik:GridCheckBoxColumn>
 
<telerik:GridDropDownColumn DataField="CustomerID" UniqueName="CustomerID" 
    EnableEmptyListItem="True" >
    <HeaderStyle Width="120px" />
    <ItemStyle Width="120px" />
</telerik:GridDropDownColumn>
 
<telerik:GridDropDownColumn DataField="ContactID" UniqueName="ContactID"
     EnableEmptyListItem="True" >
    <HeaderStyle Width="100px" />
    <ItemStyle Width="100px" />
</telerik:GridDropDownColumn>

Code :
Protected Sub rgOpportunities_ItemCreated(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles rgOpportunities.ItemDataBound
    If (TypeOf e.Item Is GridDataItem) Then
        'If (TypeOf e.Item Is GridEditFormItem AndAlso e.Item.IsInEditMode) Then
        Dim editFormItem As GridDataItem = CType(e.Item, GridDataItem)
        Dim Cus As GridDropDownColumn = CType(rgOpportunities.MasterTableView.Columns(8), GridDropDownColumn)
        Dim Con As GridDropDownColumn = CType(rgOpportunities.MasterTableView.Columns(9), GridDropDownColumn)
        If DirectCast(editFormItem("IsCustomer").Controls(0), CheckBox).Checked = True Then
            Cus.DataSourceID = "odsCustomer"
            Cus.ListTextField = "Name"
            Cus.ListValueField = "CustomerID"
            Con.DataSourceID = "odsContact"
            Con.ListTextField = "Name"
            Con.ListValueField = "ContactID"
        Else
            Cus.DataSourceID = "odsLeadHdr"
            Cus.ListTextField = "Name"
            Cus.ListValueField = "LeadHdrID"
            Con.DataSourceID = "odsLeadDtl"
            Con.ListTextField = "Name"
            Con.ListValueField = "LeadDtlID"
        End If
    End If
End Sub

Thanks..
Shinu
Top achievements
Rank 2
 answered on 20 Nov 2012
1 answer
209 views
I cannot get the events to fire??? Thoughts?


SERVER SIDE
protected void rtvLyst_NodeClick(object sender, Telerik.Web.UI.RadTreeNodeEventArgs e)
{
e.Node.Text = "NodeClick fired for this node";
}


CONTROL
<div class="lystList" style="display:none; min-width:100px; min-height:200px;">
<telerik:RadTreeView ID="rtvLyst" runat="server" OnClientNodeClicked="ClientNodeClicked" OnNodeClick="rtvLyst_NodeClick">

</telerik:RadTreeView>
</div>


CLIENT SIDE
function ClientNodeClicked(sender, eventArgs) {
var node = eventArgs.get_node();
alert("You clicked " + node.get_text());
}
Princy
Top achievements
Rank 2
 answered on 20 Nov 2012
1 answer
92 views
Hi,
I want to hide/disable the edit button dependent on what is in the row. Hypothetically speaking if there was one column (showing complete and uncomplete), and the edit button column, i only want the edit button to appear or be enabled on rows that were uncomplete.
Many Thanks
Ryan 
Shinu
Top achievements
Rank 2
 answered on 20 Nov 2012
3 answers
219 views
Hiya,
I am new to the Telerik tools.
 
Need to use LINQ with the RadGrid to present data in a parent/child view. Is this possible? I have spent quite while trying to get it to work. Single (parent) table works fine.

I have read the tutorial and searched the forums but cannot find a reference that says the LINQ is supported at this stage by RadGrid.

Brad
Tommy
Top achievements
Rank 1
 answered on 19 Nov 2012
2 answers
123 views
In the grid I'm running, the paging is mostly default.  The paging buttons are on the left hand side of the grid.  

On the far right hand side of the grid is the display of number of items in number of pages.

Is there any way to control that?  

(What I'd ideally like to do is have it left aligned, right up against the buttons.)
Boris
Top achievements
Rank 1
 answered on 19 Nov 2012
1 answer
84 views
I have a page that had one column that I had to provide a "(Un)Check All" in the header.  I used this code to select or unselect them all and it works fine:

Here is the js code:
    function SelectAllCheckedChanged() {

        var grid = window['<%= rgManufacturerDisplay.ClientID %>'];

        var inputElements = grid.MasterTableView.Control.getElementsByTagName("INPUT");

        var headerChecked = window.event.srcElement.checked;

        var index;

 

        for (index = 0; index < inputElements.length; index++) {

            //NOTE: The GetElementsByTagName("INPUT") will return ALL input controls in the grid, so we have

            //to filter to the ones that we specfically care about.           

            if (inputElements[index].id.indexOf("chkDistributor") != -1) {

                //If the id of the control is "chkDistributor" then this is the checkbox in the Select column

                //for the grid row and we need to check/uncheck it (only if it's enabled).

                if (!inputElements[index].disabled) {

                    inputElements[index].checked = headerChecked;

                }

            }

        }

    }  


However now I have to add a second column, and need it to do the same thing...that is select or unselect all the rows in THAT column.

I've tried a couple of things, but not yet had much success.  The second column ID is chkContractor.

Anyone got any ideas of how I would do this with JavaScript?

Thanks.
Rich
Top achievements
Rank 1
 answered on 19 Nov 2012
1 answer
93 views
I am running into issues when my dynamically bound grid has been sorted by Column A and on a post back, Column A is no longer present due to a user-preference change.  I would like to clear the sorting if the column no longer exists so that I don't get an error on the page.  Is there a way to do this?

Thanks!
<telerik:RadGrid ID="rg" runat="server" Skin="Office2010Silver" OnNeedDataSource="rg_NeedDataSource"
 
OnItemCommand="rgScores_ItemCommand">
 
<ExportSettings HideStructureColumns="true" />
 
<MasterTableView AllowPaging="true" AllowSorting="true" Width="100%" CommandItemDisplay="Top">
 
<CommandItemSettings ShowExportToExcelButton="true" ShowRefreshButton="false" ShowAddNewRecordButton="false" />
 
</MasterTableView>
 
</telerik:RadGrid>


Daniel
Top achievements
Rank 1
 answered on 19 Nov 2012
1 answer
78 views
Hi

I'm using an ajaxyfied radgrid and want to use the command buttons the grid offers for export.
But Clicking on one of them does not export it shows the generated output on the page.
What I understood from all reading about this is, I have to disable ajax
for the export something like this:
<script type="text/javascript">
           function RequestStart(sender, args)
           {
               if (args.EventTarget == "Button1")
               {
                   args.EnableAjax = false;
               }
           }
       </script>
On all the examples I've found a button, "Button1", is used to do this. How do I reference the internal buttons of the radgrid to do the same or is there a different way of doing this?
Thanks in advance

Hans-Dieter
Daniel
Telerik team
 answered on 19 Nov 2012
1 answer
62 views
Sir,
I have Imported Dlls in my project and when i use any Rad Controller it works fine but donot display with styles i mean layout not working Correctly do we have to work or iimport css files as well???
Thanks
Pavlina
Telerik team
 answered on 19 Nov 2012
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?