Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
68 views

We have a page which has a div at the top with some links and a Telerik Calendar control.  Below we have a large grid of divs in a layout mimicking a spreadsheet. 

When the page loads for the first time everything works fine.  Then when you click on the "More" button, the js makes a remote scripting call back to the server to get more rows for our scrolling spreadsheet.  The page returns and fills the divs associated with the "spreadsheet" with the updated data.  The problem is that now when the user mouses over the calendar, the whole div that contains the calendar jumps down 3 lines or so.  When debugging the page, I've noticed that the call that seems to be throwing off the alignment is the call to the following code.

Is there any way stop the code I've pasted below from firing when mousing over the calendar control or else to stop this code from disrupting the layout of the divs on an update the the divs in the DOM?

Sys.UI.DomEvent = function Sys$UI$DomEvent(eventObject) {
    /// <summary locid="M:J#Sys.UI.DomEvent.#ctor" />
    /// <param name="eventObject"></param>
    /// <field name="altKey" type="Boolean" locid="F:J#Sys.UI.DomEvent.altKey"></field>
    /// <field name="button" type="Sys.UI.MouseButton" locid="F:J#Sys.UI.DomEvent.button"></field>
    /// <field name="charCode" type="Number" integer="true" locid="F:J#Sys.UI.DomEvent.charCode"></field>
    /// <field name="clientX" type="Number" integer="true" locid="F:J#Sys.UI.DomEvent.clientX"></field>
    /// <field name="clientY" type="Number" integer="true" locid="F:J#Sys.UI.DomEvent.clientY"></field>
    /// <field name="ctrlKey" type="Boolean" locid="F:J#Sys.UI.DomEvent.ctrlKey"></field>
    /// <field name="keyCode" type="Number" integer="true" locid="F:J#Sys.UI.DomEvent.keyCode"></field>
    /// <field name="offsetX" type="Number" integer="true" locid="F:J#Sys.UI.DomEvent.offsetX"></field>
    /// <field name="offsetY" type="Number" integer="true" locid="F:J#Sys.UI.DomEvent.offsetY"></field>
    /// <field name="screenX" type="Number" integer="true" locid="F:J#Sys.UI.DomEvent.screenX"></field>
    /// <field name="screenY" type="Number" integer="true" locid="F:J#Sys.UI.DomEvent.screenY"></field>
    /// <field name="shiftKey" type="Boolean" locid="F:J#Sys.UI.DomEvent.shiftKey"></field>
    /// <field name="target" locid="F:J#Sys.UI.DomEvent.target"></field>
    /// <field name="type" type="String" locid="F:J#Sys.UI.DomEvent.type"></field>
    var e = Function._validateParams(arguments, [
        {name: "eventObject"}
    ]);
    if (e) throw e;
    var ev = eventObject;
    var etype = this.type = ev.type.toLowerCase();
    this.rawEvent = ev;
    this.altKey = ev.altKey;
    if (typeof(ev.button) !== 'undefined') {
        this.button = (typeof(ev.which) !== 'undefined') ? ev.button :
            (ev.button === 4) ? Sys.UI.MouseButton.middleButton :
            (ev.button === 2) ? Sys.UI.MouseButton.rightButton :
            Sys.UI.MouseButton.leftButton;
    }
    if (etype === 'keypress') {
        this.charCode = ev.charCode || ev.keyCode;
    }
    else if (ev.keyCode && (ev.keyCode === 46)) {
        this.keyCode = 127;
    }
    else {
        this.keyCode = ev.keyCode;
    }
    this.clientX = ev.clientX;
    this.clientY = ev.clientY;
    this.ctrlKey = ev.ctrlKey;
    this.target = ev.target ? ev.target : ev.srcElement;
    if (!etype.startsWith('key')) {
        if ((typeof(ev.offsetX) !== 'undefined') && (typeof(ev.offsetY) !== 'undefined')) {
            this.offsetX = ev.offsetX;
            this.offsetY = ev.offsetY;
        }
        else if (this.target && (this.target.nodeType !== 3) && (typeof(ev.clientX) === 'number')) {
            var loc = Sys.UI.DomElement.getLocation(this.target);
            var w = Sys.UI.DomElement._getWindow(this.target);
            this.offsetX = (w.pageXOffset || 0) + ev.clientX - loc.x;
            this.offsetY = (w.pageYOffset || 0) + ev.clientY - loc.y;
        }
    }
    this.screenX = ev.screenX;
    this.screenY = ev.screenY;
    this.shiftKey = ev.shiftKey;
}

 

 

 

I've been wrestling with this for several day now, so any thoughts or ideas are much appreciated!

Daniel

Konstantin Dikov
Telerik team
 answered on 28 Apr 2015
4 answers
1.9K+ views
Scenario: Users want to be able to specify a comma delimited-set of values to search for.

Solution: Convert "EqualsTo" query with a comma to a "IN { 'a','b','c' }" list style query. Bit hackish.

I'm using the sample in the Forum post as the base (it allows me to have a pre-specified/default filter and then add to it): http://www.telerik.com/forums/grid-filter-and-the-entitydatasource-control-whereparameters

Use a standard (or in my case Calculated) column, but with the field defined, with standard "EqualsTo" field defined:

<telerik:GridTemplateColumn DataField="CustomerTypeCode" UniqueName="CustomerType" HeaderText="Customer Type" SortExpression="CustomerTypeCode" CurrentFilterFunction="EqualTo" AutoPostBackOnFilter="true" ShowFilterIcon="false" FilterControlWidth="130px">
                    <HeaderStyle Width="150px" />
                    <ItemStyle Width="150px" />
                    <ItemTemplate>
                        <%# string.Format("{0} - {1}", Eval("CustomerTypeCode"), Eval("CustomerTypeDescription")) %>
                    </ItemTemplate>                   
                </telerik:GridTemplateColumn>

You "Selecting" event on the Entity Data Source is handled as per above sample:

protected void edsCustomers_Selecting(object sender, EntityDataSourceSelectingEventArgs e)
        {
            // Get the filtered data source (if applicable) and then append/pre-pend default filter
            EntityDataSource dataSource = e.DataSource;
            AddParameters(dataSource);
            BuildWhere(dataSource);
        }

Here's the crazy hack to rewrite the EqualsTo / Contains (LIKE) to a "IN" clause style query:

private void BuildWhere(IDynamicDataSource dataSource)
        {
            string filter = FilterDefault;
 
            // Parse filters with commas - convert LIKE and Equals (=) queries to IN query
            string gridFilters = dataSource.Where;
            if (!string.IsNullOrEmpty(gridFilters))
            {
                if (gridFilters.Contains(","))
                {
                    // Find filter fields (either Equals = or LIKE) with data inside quotes and rewrite to an "IN" query
                    // Looks for it.[Field] = "a,b" (or it.[Field] LIKE "%a,b%") etc                    
                    Regex regexCommaValues = new Regex("it\\.\\w*.....\\s([\"'])(?:(?=(\\\\?))\\2.)*?\\1");
                    var matches = regexCommaValues.Matches(gridFilters);
                    foreach (Match match in matches)
                    {
                        string value = match.Value;
                        value = value.Replace("LIKE \"", "IN {'");
                        value= value.Replace("%", "");
                        value = value.Replace("= \"", "IN {'");
                        value= value.Replace(",", "','");
                        value= value.Replace("\"", "'}");
 
                        // Replace original match with modified string
                        gridFilters = gridFilters.Replace(match.Value, value);
                    }
                }
 
                filter += " AND " + gridFilters;
            }
 
            // If custom filtering enabled, pre-pend with our default parameter
            dataSource.Where = filter;           
        }

Enjoy the hack. 

Please - if you can improve the solution or the regex, let me know!
Viktor Tachev
Telerik team
 answered on 28 Apr 2015
5 answers
340 views
Hello,

I created a web application, in which using control RadNumericTextBox. The code snippet is like below.
<telerik:RadNumericTextBox ID="MaxChildAge" runat="server" Type="Number" ShowSpinButtons="True"
            ButtonsPosition="Right" IncrementSettings-InterceptArrowKeys="True"
            IncrementSettings-Step="1" MaxValue="21" MinValue="0" MaxLength="2" NumberFormat-DecimalDigits="0">
            <EnabledStyle HorizontalAlign="Right" />
        </telerik:RadNumericTextBox>

However, when I browse this page thru IE/chrome, the spin buttons are not visible but it can work if I click mouse on the spin button area.

Thanks!
Maria Ilieva
Telerik team
 answered on 28 Apr 2015
5 answers
934 views
Hi,

When testing my code on my development box, I am attempting to find a radgrid in javascript (on the client) using the command:

$find("<%= RadGrid1.ClientID %>")


This returns an object and I have no problems.

When I deploy my code to our web server, this returns a null.  My question is whether the web server needs to have a Telerik license installed or can the binaries be deployed and the code should work.

The current deployed binaries are:
Telerik.Web.UI.XML
Telerik.Web.Device.Detection.xml
Telerik.Web.Design.dll
Telerik.Web.Device.Detection.dll
Telerik.Web.UI.dll
Telerik.Web.UI.Skins.dll

Thanks,
Viktor Tachev
Telerik team
 answered on 28 Apr 2015
1 answer
89 views

We have 3 tab RadTabStrip and each of the tab has radtabs. We have radchart inside these tabs. 

The chart gets loaded correctly onload. But it gets shrinked when i move from one tab to other.

 I have noticed that 'd' attribute in 'path' element inside the 'g' element('svg') of radchart gets changed on moving from tabs to tabs.

Danail Vasilev
Telerik team
 answered on 28 Apr 2015
10 answers
231 views

Hi all,

I have a number of grids in my project(s).  In many cases it is neccessary/helpful for users to 

  • print the grids' content
  • copy to clipbord (for further analysis in e.g. Excel)
  • export data to a Excel readable file or PDF

I have set my sights on creating a user control containing a Radgrid (of course) and a toolbar of some sort which buttons can be enabled/disabled as needed (see attached mock-up picture where the toolbar replaces a pager's fuctionality plus has some tools).  I have the feeling that this feature can be valuable to many users as it would provide a uniform approach to these common tasks.

I have be searching the forum for ideas and code snippets for my (dream) user control and I am stuck at the first stage.  The print instructions in http://www.telerik.com/community/code-library/aspnet-ajax/grid/print-radgrid-contents.aspx do not work right out of the box (with or without skins).

I suspect that I am not the first one to have abovementioned need.  Perhaps this functionality can already be found in some code library I have not stumbled on yet.  But anyway... please point out to me the resources (complete code, snippets, problems) and might help me realize my user control.

Thank you!   

Kostadin
Telerik team
 answered on 28 Apr 2015
2 answers
79 views

Hi All,

 I am facing a problem with tooltip, that the rollover keeps showing and does not be updated to the content. I can see the response contains the html code of the content ready for showing, but the rollover keeps showing and does not be changed to the html content.

 I am using the version 3.5.0.0. and here is the settings:

<telerik:RadToolTipManager runat="server" AnimationDuration="150" ShowDelay="200" OnClientResponseError="OnClientResponseError"<br>    HideDelay="10" HideEvent="LeaveToolTip" Position="TopCenter" RenderMode="Classic" ID="radTooltipMgr" Width="660px" Height="390px" RelativeTo="Element"<br>    Animation="Fade" OnAjaxUpdate="OnAjaxUpdate" EnableDataCaching="True" AutoCloseDelay="0" RenderInPageRoot="True" Skin="BlackMetroTouch"><br></telerik:RadToolTipManager>

Does someone have the same problem with me?

Thanks for any suggestion!

Marin Bratanov
Telerik team
 answered on 28 Apr 2015
8 answers
791 views
Hello All,

I have been through and through many examples and postings and, for the life of me, do not understand what I am doing wrong. 

I am trying to get the values out of the update template to use in an update statement in the code behind. When I set the var values, it is setting the original text box value and not the edited value. 

For example the original value is "Lake Erie Spring Bass Tournament". If I edit and change this value, my var t is set to the original value. 

Any info is greatly appreciated.

Thank you,
Mike

Here is my code:
<telerik:RadGrid ID="RadGrid1" runat="server" AllowSorting="True"  
    AutoGenerateColumns="False" GridLines="None" AutoGenerateEditColumn="True" > 
<HeaderContextMenu EnableAutoScroll="True"></HeaderContextMenu> 
 
<MasterTableView DataKeyNames="ID" > 
    <Columns> 
         <telerik:GridBoundColumn DataField="ID" HeaderText="ID"  
            UniqueName="column51" SortExpression="ID" Visible="false"  
             DataType="System.Int32" ReadOnly="True" > 
        </telerik:GridBoundColumn> 
        <telerik:GridBoundColumn DataField="Tournament" HeaderText="Tournament"  
            UniqueName="Tournament" SortExpression="Tournament"
        </telerik:GridBoundColumn> 
        <telerik:GridBoundColumn DataField="Date" HeaderText="Date"  
            UniqueName="Date" SortExpression="Date"
        </telerik:GridBoundColumn> 
        <telerik:GridBoundColumn DataField="Boats" HeaderText="Boats"  
            UniqueName="Boats" SortExpression="Boats"
        </telerik:GridBoundColumn> 
        <telerik:GridBoundColumn DataField="Finished" HeaderText="Finished"  
            UniqueName="Finished" SortExpression="Finished"
        </telerik:GridBoundColumn> 
        <telerik:GridBoundColumn DataField="Fee" HeaderText="Fee" UniqueName="Fee"  
            SortExpression="Fee"
        </telerik:GridBoundColumn> 
        <telerik:GridBoundColumn DataField="Winnings" HeaderText="Winnings"  
            UniqueName="Winnings" SortExpression="Winnings"
        </telerik:GridBoundColumn> 
    </Columns> 
 
</MasterTableView> 
</telerik:RadGrid> 



    Protected Sub RadGrid1_UpdateCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles RadGrid1.UpdateCommand 
 
        Dim edititem As GridEditableItem = DirectCast(e.Item, GridEditableItem) 
        Dim id As String = edititem.GetDataKeyValue("ID").ToString() 
        Dim t As String = (TryCast(edititem("Tournament").Controls(0), TextBox)).Text 
 
 
        ' dbinteractions.UpdateTournTrackerRecordByID(id, t) 
 
    End Sub

Maria Ilieva
Telerik team
 answered on 28 Apr 2015
1 answer
96 views

hi all,

i m new to telerik controls.. please help me.. i want to know whether we can display the table  value from database side by side like i shown below.. if it is possible how can we do that using telerik. 

   Name:abx              Place  :xxx                  
no         list                no         list
1           aa                 2           cc
3           ss                 4           dd

 

Thanks in Advance,

Anju

Eyup
Telerik team
 answered on 28 Apr 2015
6 answers
413 views
Hey Y'all,

I have a RadTabStrip on a site page I've built for SharePoint. The formatting worked perfectly on SharePoint 2007, but now that I've upgraded to 2010 I have a formatting issue. The tabs are displaying below the level of the quick launch (See Figure1.png). I've used the web dev tool in IE8 and tracked it to the clear:both coming from the .RadTabStrip .rtsLevel style  (See Figure2.png, notice that forcing the style in the browser causes the tabs to display properly). The style is coming from your WebResource.axd and I can't seem to make my style take priority over the one you have coming in. Is there a way in the page or in my code to manually change that one style setting?

Thanks.
Hristo Valyavicharski
Telerik team
 answered on 28 Apr 2015
Narrow your results
Selected tags
Tags
+? more
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?