Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
88 views
Hi
I have an ASP.Net application with two RadGrids. The first grid contains the master table, and the second grid contains the details table. I need to insert new records in the second grid (details), but how can I set the foreign key to the record to be insert? And I need to complete some values in the record that doesn´t appear as a column in the grid, how can I do that? Can you help me?

Thanks in advanced...
Sami
Princy
Top achievements
Rank 2
 answered on 08 Aug 2013
2 answers
229 views
I have two pages named WorkingExpand.aspx and NotWorkingExpand.aspx. Both pages have this declaration:

            <telerik:RadGrid ID="rgRequirements" runat="server" Width="100px" CellSpacing="0" GridLines="None" EnableEmbeddedSkins="True" Skin="Black" >
                <MasterTableView AutoGenerateColumns="False">
                    <NoRecordsTemplate>
                        <asp:Label ID="nocourses" runat="server" Font-Size="16px" Text="No courses are currently selected for this organization."></asp:Label>
                    </NoRecordsTemplate>
                    <Columns>
                        <telerik:GridTemplateColumn HeaderStyle-HorizontalAlign="Center" >
<!-- Some Column Definition -->
                        </telerik:GridTemplateColumn>
                    </Columns>
                </MasterTableView>
            </telerik:RadGrid>

For WorkingExpand.aspx codebehind, I have this declaration on the Load method:

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
    If Not Page.IsPostBack Then
        ' Some code omitted.
        fill_requirements()
    end if           
End Sub
 
Sub fill_requirements()
    Dim dt As DataTable = New DataTable
    dt = ThisMethodReallyReturnsData()
        Me.rgRequirements.DataSource = dt
 
    'Grouping declared here
    Me.rgRequirements.GroupingEnabled = True
    Dim groupExpression As GridGroupByExpression = GridGroupByExpression.Parse("Module Group By Module")
    Me.rgRequirements.MasterTableView.GroupByExpressions.Add(groupExpression)
    Me.rgRequirements.DataBind()
     
End Sub

So notice that the binding to the grid was called on the page load method. There was no need to use advanced databinding to make the expand/collapse work. It just works. 

However for the NotWorkingExpand.aspx code behind, here is how the data is bind:

   Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
'No related code
   End Sub
 
   Protected Sub rgRequirements_NeedDataSource(ByVal source As System.Object, ByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs)
       LoadGrid()
   End Sub
 
   Protected Sub LoadGrid()
       ' dtRequirements is a global variable
       dtRequirements = MethodThatHasDataAsWell()
       Me.rgRequirements.DataSource = dtRequirements
 
       Me.rgRequirements.GroupingEnabled = True
       Dim groupExpression As GridGroupByExpression = GridGroupByExpression.Parse("Module Group By Module")
       Me.rgRequirements.MasterTableView.GroupByExpressions.Add(groupExpression)
   End Sub

When the collapse/expand button is selected, it throws an error


Unhandled exception at line 6, column 74203 in http://localhost:30710/Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=ctl00_ContentContent_rsmTrainingRequirements_TSM&compress=1&_TSM_CombinedScripts_=;;System.Web.Extensions,+Version=4.0.0.0,+Culture=neutral,+PublicKeyToken=31bf3856ad364e35:en-US:c9cbdec3-c810-4e87-846c-fb25a7c08002:ea597d4b:b25378d2;Telerik.Web.UI,+Version=2013.2.611.40,+Culture=neutral,+PublicKeyToken=121fae78165ba3d4:en-US:8a277cf4-155d-4ba9-b3c0-d6f62646e5f2:16e4e7cd:ed16cbdc:f7645509:58366029
 
0x800a138f - Microsoft JScript runtime error: 'undefined' is null or not an object

Any help?
Patrick
Top achievements
Rank 1
 answered on 08 Aug 2013
10 answers
212 views
Hi,

In IE10 if you clear date from RadDatePicker where RadDatePicker's min date is set and click somewhere else it is giving following error.

Unhandled exception at line 151, column 1 in http://aspnet-scripts.telerikstatic.com/ajaxz/2012.3.1308/Calendar/RadDatePicker.js

0x800a138f - JavaScript runtime error: Unable to get property 'toString' of undefined or null reference ..

in RadDatePicker.js file. How to solve this?


Best Regards,
Damodar
Damodar
Top achievements
Rank 1
 answered on 08 Aug 2013
2 answers
66 views
Using the sample here http://demos.telerik.com/aspnet-ajax/treeview/examples/functionality/draganddropnodes/defaultcs.aspx I am able to produce the drag and drop feature perfectly. However when I place that same RadTreeView inside of a multipage, the radtreeview becomes disabled and then I am unable to do anything with this. The placement of the code is the only thing that changes.

I'm hoping someone has seen this before. My assumption is there is something with the RadPageView that causes the javascript not to find the RadTree. Anybody experiences this before?

var gridId = "<%= My_RadTreeView.ClientID %>";

my guess is the gridId can no longer be found? Any help is welcomed!

I have verified that all the code is placed inside of a RadScriptBlock so if anybody has the answer i'm open!

Joshua
Top achievements
Rank 1
 answered on 07 Aug 2013
2 answers
264 views
Hi,
I found the example below that shows how to force the user to enter a number in .5 increments. I need my radnumerictextbox to increment on pack size increments that will vary by item. So in my RadGrid I plan on setting the ValidationExpression on each item during itemdatabind. The bottom line is if the pack size is 24 the box should increment by 24 when the up or down key is hit but also only allow them to type valid increments 24,48,72 etc.
Any idea what the ValidationEpression might look like or is there another way to read the increment setting on the control and only allowing valid increments to get entered? 

<Telerik:RadNumericTextBox ID="txtQtyShp" runat="server" DataType="System.Int" DbValue='<%# Bind("qtyshp") %>'></telerik:RadNumericTextBox>

<asp:RegularExpressionValidator ID="vldQtyShp" runat="server" Display="Dynamic"

ErrorMessage="Please enter valid number." ValidationExpression="^\d+(\.[5])?$"

ControlToValidate="txtQtyShp">

</asp:RegularExpressionValidator>

Thanks,
Tom Usselman

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

ErrorMessage="Please enter valid number." ValidationExpression="^\d+(\.[5])?$"

 

ControlToValidate="txtQtyShp">

 

</asp:RegularExpressionValidator>

Jeroen
Top achievements
Rank 1
 answered on 07 Aug 2013
1 answer
85 views
Hello,

I am trying to figure out how to update the Browser object so that the div that is being filled on success of an AJAX call, is valid and accessible. 

Here is the order of events in a test case I am writing.

1.) Navigate to Page A.
2.) Perform Click on a particular html object
3.) After the click event, there is an AJAX call made to populate a div 
4.) We attempt to access something in that div, "Here the exception is being thrown because it does not exist in the Browser".

So I have tried RefreshDomTree() and it seems to have no effect. 

This web application is running ASP.NET MVC 4.5 and the Telerik Testing Framework v 2012.2 in a Windows 8 Pro 64bit enviornment with VS2012.

Any help on this would be greatly appreciated. 
Cody
Telerik team
 answered on 07 Aug 2013
2 answers
261 views
I have code to rollback changes in the UI if the user press the Cancel button. To do so, I remember all values at the beginning and I call set_value(OldValue) when required. It works except in one case for the RadNumberTextBox...

When the RadNumberTextBox is always enable then it works. But I have a case where a RadNumberTextBox is enabled if a check box is checked, so it's possible that the text box was enabled and now be disabled...I have to re-enable it and set back it's original value.

With these steps:
- Original state: the text box is enabled with a value (e.g. 20)
- 1: the user changed the value to 15
- 2: the user uncheck the check box...I disable the text box with the set_enabled(false) method
- 3: the user press the Cancel button...I re-enable the text box and I try to set back the value to 20

The result is: the value remains to 15!

Even if I try again to set back the value with set_value(20) it doen't work. But if the user put the focus on the text box, and without changing anything he click again on the Cancel button, then the set_value(20) works!

By tracing the javascript code while I am calling the set_value() method, I notice that the _initialValueAsText property contains the very first value (20) and not the current value (15), and this property is compared to the new value to know is something need to be changed...the answer is NO CHANGE but in fact it must be. When the user put the focus on the text box then the _initialValueAsText property contains the good value which is the value we see on the screen (15).

As a patch, I assign the value of _lastSetTextBoxValue (which contains the good value) in _initialValueAsText and then when I call set_value, the comparaison found a change without having the user to click on the text box...

Can I expect a fix on that?
Marc
Top achievements
Rank 1
 answered on 07 Aug 2013
0 answers
49 views
I was working with radscheduler then suddenly it didn't display as before as you can see in the image that the problem is surrounded with red lines. how can I remove this gaps from my radscheduler?   Thanks 
Ali
Top achievements
Rank 1
 asked on 07 Aug 2013
0 answers
81 views
I was working with radscheduler then suddenly it didn't display as before as you can see in the image that the problem is surrounded with red lines. how can I remove this gaps from my radscheduler?   Thanks 
Ali
Top achievements
Rank 1
 asked on 07 Aug 2013
2 answers
1.7K+ views
Hi there,

This is kind of hard to explain. I have 4 columns in a radgrid:

A | B | C | D

A user will use this grid to insert information for each of the four columns. When they click Add, the form inserts their inputted values into each of the four columns.

I need to be able to concatenate the A and B columns into one column. So for instance, the grid will now look like:

A | B | C | D
-------------
1 | 2 | 3 | 4
5 | 6 | 7 | 8
9 | A | B | C



I can hide Column A and column B and make column A-B read-only. The reason for this is when they click add, they will be inserting column A and B values separately...so column A and column B must exist but be hidden. So now there will now be 5 columns, Column A, B, C, D, and A-B.

The tricky part is that these columns have to be searchable... so for instance if these were fields in the columns:

A-B | C | D
-----------
1-2 | 3 | 4
5-6 | 7 | 8
9-A | B | C


If the user puts "1" in the search box for the A-B column, the number 1-2 will show up. If they put "6" in the search box, the number 5-6 will show up.

How on earth can I get this to work? I'm lost :confused: How do I tell the grid that I want to show and search a concatenated field? Is this even possible?

I have been looking into getters and setters but I don't know how they work. 
Greg
Top achievements
Rank 1
 answered on 07 Aug 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?