Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
218 views
Hi,
I have a radcombobox with OnClientKeyPressing event.User should not enter any special characters.How can i block this.I have used "OnClientKeyPressing " for validating for special characters.This is the JavaScript code
function OnClientKeyPressing() {
            var evtobj = window.event ? event : e
            if ((evtobj.shiftKey) && ((evtobj.keyCode == 188) || (evtobj.keyCode == 190))) {
                alert("Special characters not allowed");
                evtobj.keyCode = 0;
                evtobj.returnValue = false;
                return false;
            }
        }
Eg:-If the user type "vis<" then "<" it should remove.The value should be "vis" instead of "vis<".Now i am getting value as "vis<" and alert is showing.How can i avoid this and data should come starting with "vis" 
Princy
Top achievements
Rank 2
 answered on 20 Dec 2012
0 answers
113 views
Hi,

I have default.aspx page contains RadTabStrip that shows 3 tabs .
So i Added RadPanelBar inside for each RadMultiPage like this ..

<table>
           <tr>
               <td>
                   <telerik:RadTabStrip runat="server" ID="RadTabStrip1" Orientation="HorizontalTop"
                       SelectedIndex="0" MultiPageID="RadMultiPage1">
                       <Tabs>
                           <telerik:RadTab Text="Category Summary">
                           </telerik:RadTab>
                           <telerik:RadTab Text="Category Summary Details">
                           </telerik:RadTab>
                           <telerik:RadTab Text="Department Summary Details">
                           </telerik:RadTab>
                       </Tabs>
                   </telerik:RadTabStrip>
                   <telerik:RadMultiPage runat="server" ID="RadMultiPage1" SelectedIndex="0" Height="500px"
                       Width="500px">
                       <telerik:RadPageView runat="server" ID="RadPageView3">
                           <asp:Label ID="Label1" runat="server" Text="Sample page"></asp:Label>
                           <uc:grid ID="radgrid" runat="server" />
                       </telerik:RadPageView>
                       <telerik:RadPageView runat="server" ID="RadPageView1">
                           <telerik:RadPanelBar runat="server" ID="pnlBarCatSummDetails" Width="900" AllowCollapseAllItems="true"
                               ExpandMode="MultipleExpandedItems">
                           </telerik:RadPanelBar>
                       </telerik:RadPageView>
                       <telerik:RadPageView runat="server" ID="RadPageView2">
                           <telerik:RadPanelBar runat="server" ID="pnlBarDeptSummDetails" Width="900" AllowCollapseAllItems="true"
                               ExpandMode="MultipleExpandedItems">
                           </telerik:RadPanelBar>
                       </telerik:RadPageView>
                   </telerik:RadMultiPage>
               </td>
           </tr>
           <tr>
               <td>
               </td>
           </tr>
       </table>

Now I am adding usercontrol to first tab page directly ( refer above code ) and usercontrol is adding  dynamically for 2nd and 3rd tab like this..
Protected Sub RadTabStrip1_TabClick(ByVal sender As Object, ByVal e As Telerik.Web.UI.RadTabStripEventArgs) Handles RadTabStrip1.TabClick
        If RadTabStrip1.SelectedIndex = 0 Then
             ' Already added in aspx page ( not a dynamic one )
        ElseIf RadTabStrip1.SelectedIndex = 1 Then
            Dim i As Integer = 0
            pnlBarCatSummDetails.Items.Clear()
            Do While (i < 2)
 
                Dim dateItem As New RadPanelItem()
                dateItem.Text = "Test page" + i.ToString()
                pnlBarCatSummDetails.Items.Add(dateItem)
 
                Dim control As New RadPanelItem()
                Dim Panel1 As New Panel()
                Dim myControl As Control = LoadControl("CategorySummary.ascx")
                Panel1.Controls.Add(myControl)
                control.Controls.Add(Panel1)
                dateItem.Items.Add(control)
 
                i = i + 1
            Loop
            
        ElseIf RadTabStrip1.SelectedIndex = 2 Then
            Dim i As Integer = 0
            pnlBarDeptSummDetails.Items.Clear()
            Do While (i < 2)
 
                Dim dateItem As New RadPanelItem()
                dateItem.Text = "Dept Test page" + i.ToString()
                pnlBarDeptSummDetails.Items.Add(dateItem)
 
                Dim control As New RadPanelItem()
                Dim Panel1 As New Panel()
                Dim myControl As Control = LoadControl("DepartmentSummary.ascx")
                Panel1.Controls.Add(myControl)
                control.Controls.Add(Panel1)
                dateItem.Items.Add(control)
 
                i = i + 1
            Loop
        End If
    End Sub
 
Each user control have grids and bind using sqldatasource wizard.

Now If I run the application then
First tab showing grid and paging and sorting is working fine. because usercontrol added in aspx page directly.

but usercontrols inside 2nd and 3rd tabs showing grid but sorting and paging not working. ( Cannot see grids in 2nd & 3rd tabs )

Please find the attachment for images..

How can i do solve this problem ?
https://docs.google.com/document/d/1xGOv--xxpzI26_N6M-UFTTnJyipMBIrQHpdMExF4enY/edit

Thanks for your help..
Madhu Palakurthi
Top achievements
Rank 1
 asked on 20 Dec 2012
0 answers
48 views
hi Rad team,

in Mega Drop-Down which is in this link
http://demos.telerik.com/aspnet-ajax/menu/examples/megadropdown/defaultcs.aspx

if i need to reorder the columns under product tab to be right to left
in mega example i saw
<LevelSettings>
    <telerik:SiteMapLevelSetting Level="0">
        <ListLayout RepeatColumns="3" RepeatDirection="Vertical" />
    </telerik:SiteMapLevelSetting>
</LevelSettings>
and i read in help:

If this property is set to RepeatDirection.Vertical, the nodes in the level are displayed in columns loaded from top to bottom, then left to right, until all nodes are rendered.

If this property is set to RepeatDirection.Horizontal, the nodes in the level are displayed in rows loaded from left to right, then top to bottom, until all nodes are rendered.

what actually i need is
columns loaded from top to bottom, then right to left, until all nodes are rendered
if that possible ?

Thanks

Ahmed
Top achievements
Rank 1
 asked on 19 Dec 2012
2 answers
99 views
Hi there,

It is easy to highlight an entire row using radgrid rowmouseover event, but I need to highlight a radgrid cell on rowmouseover, not the entire row. Anyone suggestions would be appreciated. 

Thanks,
Meng 
Meng
Top achievements
Rank 1
 answered on 19 Dec 2012
3 answers
128 views
I have a calendar where I only allow the user to select one day. Here's the code I have for that.

Dim selDate
        If (e.SelectedDates.Count <> 0) Then
            selDate = e.SelectedDates(e.SelectedDates.Count - 1).Date
            calDay.SelectedDate = selDate
            litDaySpec.Text = clsData.displayReservationsForADay(calDay.SelectedDate)
            Dim dateDate As New DateTime(calDay.SelectedDate.Year, calDay.SelectedDate.Month, calDay.SelectedDate.Day, 12, 0, 0)
            If getDST(calDay.SelectedDate) Then
                'If (TimeZone.CurrentTimeZone.IsDaylightSavingTime(dateDate)) Then
                lblTime.Text = "6:00"
            Else
                lblTime.Text = "5:00"
            End If
        Else

The only problem with this is, if they have a date selected, and click that same date. I.e. 12/18/2012 is selected and they click 12/18/2012 again, it deselects that date so not date is selected. Is there a way I can make it keep that 12/18 selected if they click it and it's already been selected?





Kevin
Top achievements
Rank 2
 answered on 19 Dec 2012
2 answers
116 views
Hi,

I have an aspx page (Page1.aspx) with RadwindowManager and one of the window inside RadWindowManager1 displays Page2.aspx.

On Page2.aspx , there is another Child RadwindowManager2, there are some buttons  inside contentemplate of this RadWindowmanager2.
On clicking these buttons inside Radwindow in radwindowManager2, I would like to update Page1.aspx.
How can I implement this logic?

Using "GetCurrentRadWindow().BrowserWindow.ZoomToSelectedAppointment(apptID);" helped me update page1.aspx from Radwindowmanager1, but  this does not work on Radwindow with contentemplate.



    function GetCurrentRadWindow() {
       var oWindow = null;
       if (window.radWindow) oWindow = window.radWindow;
       else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;
       return oWindow;
   }



Thanks for help.
Prava
Prava kafle
Top achievements
Rank 1
 answered on 19 Dec 2012
1 answer
57 views
I have a grid inside a pane. I want to use static headers in the grid and have set that to true. The problem is that the pane scrollbar shows up when the grid scrollbar should show up. I've tried to turn off the pane scrollbar but that did not cause the grid scrollbar to show up. What have I missed? attached is a screen shot. you'll notice the scrollbar on the right is for the pane but I want it for the grid.
Kostadin
Telerik team
 answered on 19 Dec 2012
1 answer
113 views
Hi,
I have  a grid and it's datasource is a datatable. The datatable binds the grid in Pageload . there is another grid in the page and  second grid's databinding is done according to first grid's clicked row. 

The problem is that, second grid never fills.
Florence
Top achievements
Rank 1
 answered on 19 Dec 2012
5 answers
405 views
Hello!

I've spent quite a bit of time researching this, but could not find a solution - so please forgive me if I'm posting a new thread on something that has already been answered.

The functionality I'm looking for is to simply enable/disable a textbox inside of a template column that belongs to a radgrid on that radgrid's client event: OnRowSelected (using a GridClientSelectColumn). I understand how to retrieve actual values via ClientDataKeyNames, but I'm looking to just manipulate the actual textbox control - not retrieve any values. Is there anything you could point me to in order to get me going in the right direction? Any help is greatly appreciated!

(Desired behavior: OnRowSelected --> txtScore.disabled = false;)

Here's my radgrid:
<telerik:RadGrid runat="server" ID="gridEmployees" AllowMultiRowSelection="true"
           OnNeedDataSource="gridEmployees_NeedDataSource" Width="25%" OnDataBinding="gridEmployees_DataBinding"
           AutoGenerateColumns="false" Style="margin: 10px auto 0px auto;" GridLines="None"
           Skin="WebBlue" EnableAJAX="true" ClientSettings-EnablePostBackOnRowClick="false">
           <MasterTableView Name="EmployeeTable" ClientDataKeyNames="EmployeeID, FirstName"
               DataKeyNames="EmployeeID" AllowMultiColumnSorting="False">
               <Columns>
                   <telerik:GridClientSelectColumn UniqueName="ClientSelectColumn">
                   </telerik:GridClientSelectColumn>
                   <telerik:GridBoundColumn SortExpression="FirstName" HeaderText="Employee" AllowFiltering="true"
                       HeaderButtonType="TextButton" DataField="FirstName" UniqueName="FirstName" FilterControlWidth="65px" />
                   <telerik:GridTemplateColumn HeaderText="Score">
                       <ItemStyle Width="100px" />
                       <ItemTemplate>
                           <telerik:RadTextBox ID="txtScore" runat="server" Enabled="false" />
                       </ItemTemplate>
                   </telerik:GridTemplateColumn>
                   <telerik:GridTemplateColumn HeaderText="Notes">
                       <ItemStyle Width="100px" />
                       <ItemTemplate>
                           <telerik:RadTextBox ID="txtNotes" runat="server" Enabled="false" />
                       </ItemTemplate>
                   </telerik:GridTemplateColumn>
                   <telerik:GridTemplateColumn HeaderText="Failed">
                       <ItemStyle Width="20px" />
                       <ItemTemplate>
                           <asp:CheckBox ID="chkFailed" Text="" runat="server" Enabled="false" />
                       </ItemTemplate>
                   </telerik:GridTemplateColumn>
               </Columns>
           </MasterTableView>
           <ClientSettings EnableRowHoverStyle="true">
               <Selecting AllowRowSelect="true" UseClientSelectColumnOnly="true" />
               <ClientEvents OnRowSelected="RowSelected" OnRowDeselected="RowDeselected" />
           </ClientSettings>
       </telerik:RadGrid>
Atlas
Top achievements
Rank 1
 answered on 19 Dec 2012
1 answer
88 views
Hello, all.

I have a perplexing question regarding the RadDock's state properties and JSON.  I'm building an application that has a custom dashboard that will allow the users to add, remove, move, and expand/collapse various .ascx controls; this string will be stored in a SQL database.  As it stands right now, everything works the way it should with no issues.

Since there will be a large amount of users using the application, it was decided that we don't need to physically store every dock state property for all the docks since there are quite a few that can't be changed from a user perspective (docks will never be pinned or resized; the top and left will always be 0, etc.) so we created another table that holds the properties that are changeable (zone, title, etc.).  I changed the SaveDockLayout's handler to save into both tables until I get this new method working and tested.  One table is storing the whole string as per the Telerik demos, the other is taking only the state properties we're saving and inserting/updating/deleting from the database as needed.  So far, this has worked perfectly.

Since we're not storing the whole string as one database field anymore, we're creating a JSON string on the fly in a stored procedure that's loading from the new table.  The values that don't change are hard-coded into the procedure; the others are selected from the database per our criteria.  The results are then output to a JSON-formatted string and then looped through and split as per the code examples.  Docks loaded this way have all the states from the JSON string applied correctly and they render fine.

Here's the hitch.  When the SaveDockLayout event fires when the docks have been loaded with the generated string instead of the stored one, the table that's storing the whole dock state is updating the properties just fine, yet the part of the subroutine that's breaking apart the states doesn't seem to recognize that anything has changed.  For example, if I move a dock from zone 1 to zone 3, the whole dock state is updated correctly in the old table, yet the property going into the new table will still show zone 1.  The same results occur if the title is changed, if the dock is expanded or closed, etc.

So my question is, is there a fundamental difference between storing the whole state string vs. generating one?  I've done a side-by-side comparison of the JSON output of my generated string to the text of the stored string and there's no noticeable difference.  Both strings are created as NVARCHAR(MAX).  All the properties are paired correctly and in the same order.  Each dock is surrounded by opening and closing braces, the docks are separated by a pipe delimiter, each name/value pair has quotes around each part with a colon in between the name and value, plus there's a comma separating each pair.  Is there something else I'm missing that would cause the properties to be updated correctly for one procedure but not the other?
Slav
Telerik team
 answered on 19 Dec 2012
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
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
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?