Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
96 views
Im looking for a suggestion on how to cause the first node to show expanded.  Im using a WCF service with load-on-demand and that works fine.  Its just that the tree is completely collapsed and id like to cause the 1st level to be shown.  

Ive thought about something like this.  Just look for the root node and cause expand it.
The question then is ...where to do this from?  On page load?  
http://www.telerik.com/help/aspnet-ajax/treeview-client-expand-parent-nodes.html
BitShift
Top achievements
Rank 1
Veteran
 answered on 09 Sep 2014
6 answers
319 views
Hi there,
   I've been testing the framework and I can successfully get values from GetScreenSize(userAgent), but GetScreenDimensions() always gives me 0x0
e.g. http://feniksdev-staging.azurewebsites.net/m/News/heyadamhey/~/12794542/11419166

the above url is using the following in the master page's OnInit event:
public DeviceScreenDimensions screenDimensions;
 
protected override void OnInit(EventArgs e)
{
    screenDimensions = Detector.GetScreenDimensions(Request.UserAgent);
}



in the Page's code behind :
protected void Page_Load(object sender, EventArgs e)
{
    var master = (this.Page.Master as Mobi);
    ScreenWidth = master.screenDimensions.Width;
    ScreenHeight = master.screenDimensions.Height;
    NewsContentFrame.Src = article.URL;
    NewsContentFrame.Attributes.Add("height", ScreenHeight-10 + "px");
    NewsContentFrame.Attributes.Add("width", ScreenWidth-100 + "px");
}

in the aspx:
<p>screen is <%= ScreenWidth%>x<%= ScreenHeight%></p>
<iframe runat="server" id="NewsContentFrame"></iframe>

whether I load the above URL on my pc or phone, I get 
"screen is 0x0"

I got the same result when following the examples here: http://www.telerik.com/help/aspnet-ajax/detection-framework.html


Thanks
Adam
Dimitar
Telerik team
 answered on 09 Sep 2014
1 answer
139 views
I have a Telerik RadGrid which uses the EditFormSettings like this:

    <EditFormSettings EditFormType="WebUserControl" UserControlName="~/UserControls/MyUserControl.ascx" >
        <EditColumn ButtonType="ImageButton" />
    </EditFormSettings>

Within MyUserControl.ascx, I have a button which I'd like to trigger an event handler when clicked. The two ways I know of doing this are as follows:

1.  `OnClick="btnOkay_Click"` as a button attribute, where the event handler is in the code behind
2.  `CommandName="Update"` as a button attribute, where this is handled by the event handler passed into the OnUpdateCommand attribute of the RadGrid

Both of these work. However my problem is that they stop working when the RadGrid is within a user control within a `Repeater` ASP.NET control. In this case, the button event handlers do not get fired (in either of the methods above).

I notice that when I bind my repeater:

    rpt.DataSource = Data
    rpt.DataBind()

If I wrap that in a `if(!Page.IsPostBack)`, then the edit form doesn't appear at all when I click on the RadGrid row's edit link. So I had to remove that `IsPostBack` check. I don't think think this is the cause of my problem, as I've tried explicitly not doing this when clicking my update button (by breaking into the debugger). I just thought I'd mention it incase it was related.

Can anyone think of a reason why this would break in a Repeater?
Dan
Top achievements
Rank 1
 answered on 09 Sep 2014
3 answers
297 views
I am getting a JavaScript exception everytime I close a window containing my Telerik combobox hosting Web page. Looks like Telerik is trying to unregister a 'mousedown' event handler but the object does not have this handler defined.

My ASPX page includes the following scripts:  jquery-1.10.2.js   and jquery-1.10.2.js
My RadScriptManager has the EnableEmbeddedjQuery="false"
I'm using Telerik version 2014.1.403.45

Any suggestions as to why this is happening?

Call stack:
commonScripts._removeHandler [Telerik.Web.UI.WebResource.axd] Line 560 Script
commonScripts.removeHandler [Telerik.Web.UI.WebResource.axd] Line 558 Script
b.RadComboBox.prototype._detachDocumentEvents [Telerik.Web.UI.WebResource.axd] Line 3990 Script
b.RadComboBox.prototype.dispose [Telerik.Web.UI.WebResource.axd] Line 4001 Script
Sys._Application.prototype.dispose [Telerik.Web.UI.WebResource.axd] Line 6 Script
Sys._Application.prototype._unloadHandler [Telerik.Web.UI.WebResource.axd] Line 6 Script
Anonymous function [Telerik.Web.UI.WebResource.axd] Line 6 Script
b [Telerik.Web.UI.WebResource.axd] Line 6 Script

Exception:
Unhandled exception at line 560, column 1 in http://localhost/Fieldpoint.Website/Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=radGlobalScriptManager_TSM&compress=1&_TSM_CombinedScripts_=;;System.Web.Extensions,+Version=4.0.0.0,+Culture=neutral,+PublicKeyToken=31bf3856ad364e35:en-US:5924cf72-83cf-477d-98eb-a608a92942c5:ea597d4b:b25378d2;Telerik.Web.UI:en-US:68d9452f-f268-45b2-8db7-8c3bbf305b8d:16e4e7cd:365331c3:24ee1bba:ed16cbdc:2003d0b8:f46195d3:88144a7a:1e771326:aa288e2d:258f1c72

0x800a138f - JavaScript runtime error: Unable to get property 'mousedown' of undefined or null referenceUnhandled exception at line 560, column 1 in http://localhost/Fieldpoint.Website/Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=radGlobalScriptManager_TSM&compress=1&_TSM_CombinedScripts_=;;System.Web.Extensions,+Version=4.0.0.0,+Culture=neutral,+PublicKeyToken=31bf3856ad364e35:en-US:5924cf72-83cf-477d-98eb-a608a92942c5:ea597d4b:b25378d2;Telerik.Web.UI:en-US:68d9452f-f268-45b2-8db7-8c3bbf305b8d:16e4e7cd:365331c3:24ee1bba:ed16cbdc:2003d0b8:f46195d3:88144a7a:1e771326:aa288e2d:258f1c72

0x800a138f - JavaScript runtime error: Unable to get property 'mousedown' of undefined or null reference
Nencho
Telerik team
 answered on 09 Sep 2014
1 answer
118 views
Telerik.Web.UI.dll, version 2014.1.225.40

using c#

I populate/bind my treeView using the DataSource property. When changes are made on the client, I use trackChanges / commitChanges per documentation. 

Upon postback to the server, how do I identify all changes made in the treeview control? Is there a built-in way to enumerate just changed nodes, then discern between which nodes need to be added, updated, deleted? I've seen lots of documentation on the importance of using trackChanges / commitChanges, but not much on what to do after that.

Thanks for any direction

Boyan Dimitrov
Telerik team
 answered on 09 Sep 2014
5 answers
307 views

Hi,

I'm doing some tests on a project with a iPad  with iOS5 and a iPad with iOS6, and I have some troubles with RadListBox.

First, when I scroll, it is lagging, a lot. On my desktop, everything run smoothly, without lag, but the same RadListbox on a iPad is just horrible.

Also, even if I scroll down at the middle of the list, I will be automatically redirect to the selectionned item, and it's so fast that I don't have the time to select another item. 

I've seen that when Telerik detect a touch screen, the class RadTouchExtender is assigned to every RadListBox in my project. Also, the style "overflow:hidden;" is added to the div.

My question is: Can I disable this detection, with a property on the ListBox, server-side or cliend-side or just at the loading of the project? 

The RadListBox use ItemTemplate to display items. Here an exemple:

<telerik:RadListBox ID="lbxPatDisponibles" PersistClientChanges="true" 
        runat="server" Height="300px" Width="335px" Visible="true" 
        TransferToID="lbxTraites" DataValueField="noauto" >
    <ItemTemplate>
        <div class="listeDispo patientTraite">
            <div class="dispoBouton" onclick="transfertPatient(<%# Eval("noauto") %>, false);">
                <img class="adminButton" src="Images/add.gif" alt="Add" height="32" style="padding:10px 0px;" />
            </div>
            <div class="dispoInfo">
                <div class="cboContent" style="display:block;">
                    <span style="font-weight: bold;">
                        <%#DataBinder.Eval(Container, "Attributes['enteteItem']")%>
                        <span style="font-size: 10px;">
                            <br /><%#DataBinder.Eval(Container, "Attributes['detailItem']")%>
                        </span>
                    </span>
                </div>
            </div>
        </div>
    </ItemTemplate>
</telerik:RadListBox>
 

Thank you

Visual studio 2008 .NET 3.5 SP1
Windows 7
Trouble with iOS browser (I can't test on a Android device, so I can't say if it's for every touch screen device)
Telerik ASP.NET AJAX 2012.1.301.2
VB.NET

Dimitar
Telerik team
 answered on 09 Sep 2014
7 answers
308 views
This problem has driven me crazy, and I hope anybody from the staff can help me about.

I was building a RadGrid with EditMode="InPlace", I decided to not auto generate columns. The grids datasource will be a list of an object with two properties "Quantity" and "MaxQuantity". The user can configure Quantity, but it should not get higher than MaxQuantity obviously. This became my grid:

<telerik:RadGrid ID="trgComponents" runat="server" AllowPaging="false" Culture="de-DE"
    CssClass="RadGrid Components" AllowSorting="false" AutoGenerateColumns="false" ShowStatusBar="false" PageSize="999999"
    OnNeedDataSource="trgComponents_NeedDataSource">
    <MasterTableView DataKeyNames="ID" CommandItemDisplay="Bottom" EditMode="InPlace">
        <Columns>
            <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditColumn" EditText="Bearbeiten">
                <HeaderStyle Width="20px" />
            </telerik:GridEditCommandColumn>
            <telerik:GridTemplateColumn UniqueName="Quantity" HeaderText="Anzahl" ItemStyle-CssClass="editableCell" ItemStyle-HorizontalAlign="Right">
                <HeaderStyle Width="80px" />
                <ItemTemplate>
                    <asp:Label ID="lQuantity" runat="server" Text='<%# Eval("Quantity") %>' />
                </ItemTemplate>
                <EditItemTemplate>
                    <telerik:RadNumericTextBox ID="trntbQuantity" runat="server" Type="Number" MinValue="0" MaxValue='<%# Convert.ToDouble(Eval("MaxQuantity")) %>' Text='<%# Bind("Quantity") %>' Width="77" ShowSpinButtons="true" NumberFormat-DecimalDigits="0" EnabledStyle-HorizontalAlign="Right" />
                </EditItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridNumericColumn UniqueName="MaxQuantity" HeaderText="Max. Anzahl" DataField="MaxQuantity" DataType="System.Int32" ItemStyle-HorizontalAlign="Right" ReadOnly="true">
                <HeaderStyle Width="80px" />
            </telerik:GridNumericColumn>
        </Columns>
    </MasterTableView>
</telerik:RadGrid>

For test purposes there is a static list of an object with ID-, Quantity- and MaxQuantity-Property that will be bound in the NeedDataSource event, so not really any logic in the code behind.
As you can see I use a TemplateColumn in the markup and eval the MaxQuantity in the MaxValue field. This works! I've set row one in edit mode programmically and I could not increase the RadNumericTextBox value across the MaxQuantity value, as desired.


Now I decided I want to use EditMode="Batch" with EditType="Cell", so I modified my RadGrid a bit:

<telerik:RadGrid ID="trgComponents" runat="server" AllowPaging="false" Culture="de-DE"
    CssClass="RadGrid Components" AllowSorting="false" AutoGenerateColumns="false" ShowStatusBar="false" PageSize="999999"
    OnNeedDataSource="trgComponents_NeedDataSource"
    OnPreRender="trgComponents_PreRender">
    <MasterTableView DataKeyNames="ID" CommandItemDisplay="Bottom" EditMode="Batch">
        <BatchEditingSettings EditType="Cell" OpenEditingEvent="Click" />
        <Columns>
            <telerik:GridTemplateColumn UniqueName="Quantity" HeaderText="Anzahl" ItemStyle-CssClass="editableCell" ItemStyle-HorizontalAlign="Right">
                <HeaderStyle Width="80px" />
                <ItemTemplate>
                    <asp:Label ID="lQuantity" runat="server" Text='<%# Eval("Quantity") %>' />
                </ItemTemplate>
                <EditItemTemplate>
                    <telerik:RadNumericTextBox ID="trntbQuantity" runat="server" Type="Number" MinValue="0" MaxValue='<%# Convert.ToDouble(Eval("MaxQuantity")) %>' Text='<%# Bind("Quantity") %>' Width="77" ShowSpinButtons="true" NumberFormat-DecimalDigits="0" EnabledStyle-HorizontalAlign="Right" />
                </EditItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridNumericColumn UniqueName="MaxQuantity" HeaderText="Max. Anzahl" DataField="MaxQuantity" DataType="System.Int32" ItemStyle-HorizontalAlign="Right" ReadOnly="true">
                <HeaderStyle Width="80px" />
            </telerik:GridNumericColumn>
        </Columns>
    </MasterTableView>
</telerik:RadGrid>

Now the problem appears: When I click on a cell and the RadNumericTextBox appears its MaxValue will be set to 70368744177664 internally, the constructed value. Hence, it will not take care when I cross the MaxQuantity value.

I was experimenting a bit, and it turns out, when I change to cell batch mode, it will only assign static values to my RadNumericTextBox. It will not run any binding expression. Instead, no matter I set the Text property of the RadNumericTextBox or not, when I click the cell it will take the Text from the Label in the ItemTemplate node and pass it to the Text property of the RadNumericTextBox in the EditItemTemplate.


How can I get rid of that, as I need to limit the Quantity amount based on the MaxQuantity amount on the specified object.


Thanks in advice!
Martin
Top achievements
Rank 1
 answered on 09 Sep 2014
1 answer
125 views
I am having issues referencing a related GridBoundColumn to set its value based upon the selection of a RadComboBox inside the Insert Mode row.

Picture this:

A RadComboBox, followed by 6 GridBoundColumns in InPlace Insert Mode on a RadGrid.

When the value of the RadComboBox has changed, the OnSelectedIndexChanged event fires off, and I retrieve the values for placing into the 6 GridBoundColumns based upon the value of the RadComboBox in code behind. In that same event handler, I would like to take the values from the data retrieval and set the GridBoundColumns text values prior to the user selecting the Insert button control on the grid.

I am struggling with the proper sequence of code to access and set these 6 GridBoundColumns text values from within the handler for the OnSelectedIndexChanged event.

Can anyone give me a example snippet of code to perform this action? The Accessing cells and rows page (www.telerik.com/help/aspnet-ajax/grid-accessing-cells-and-rows.html) does not go enough into detail with the proper sequence of code to do this. It is too broken up to follow and it is mostly based upon grid handlers (i.e. ItemCreated, ItemDataBound, ItemCommand, UpdateCommand, InsertCommand or DeleteCommand) and not on a specific control's handler (i.e. OnSelectedIndexChanged of a RadComboBox).
 
Whoever replies to this thread, I thank you in advance for your help.

Eyup
Telerik team
 answered on 09 Sep 2014
1 answer
110 views
Hi, I'm using a tag like

<telerik:RadCalendar FirstDayOfWeek="Monday" ShowOtherMonthsDays="false">

to hide other days in the month. However, the space is still taken. so, for a month like September, there is an empty first row. What's the logic behind this. Can an empty first row be hidden?
Viktor Tachev
Telerik team
 answered on 09 Sep 2014
1 answer
408 views
Hi,

I have used AllowFilteringByColumn in the radgrid and the normal filtering is working ok. Now, one of the column of the grid is FirstName and the data type is string and normal filtering is working. When a firstname contains Leading Space and the filter criteria is 'Equal To' then no result shows  but when the criteria is 'contains' then it shows result. I want to show the show the 'Equal To' criteria result also.
So, how to handle leading space in the filter criteria is 'Equal To'.
Pl, help.

Thanks,

G.Sen
Viktor Tachev
Telerik team
 answered on 09 Sep 2014
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?