Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
90 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
109 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
96 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
43 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
98 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
353 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
65 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
3 answers
112 views
hi,
i've a problem with the javascript function. when start the second if the compilator see me this error:
Run-time error of Microsoft JScript: Object does not support this property or method 'set_text' on this code

why?

function CallNotification() {
    var PwdAttuale = '<%=ViewState("Passwordnow")%>';
    var notification = document.getElementById("<%= RadNotification1.ClientID %>");
    var txtpwdnow = document.getElementById("<%= txtpwdnow.ClientID %>");
    var txtpwdnew = document.getElementById("<%= txtpwdnew.ClientID %>");
    var txtpwdnewconf = document.getElementById("<%= Txtpwdnewconf.ClientID %>");
    if (txtpwdnow.value != PwdAttuale) {
        var messaggio = "Password attuale errata.";
        notification.set_text(messaggio);
        notification.show();
        return false;
    }
    if (txtpwdnew.value != txtpwdnewconf.value) {
         var messaggio = "Password di conferma errata.";
         notification.set_text(messaggio);
         notification.show();
         return false;
     }
 }
Marin Bratanov
Telerik team
 answered on 19 Dec 2012
3 answers
210 views
I have a main window which call the rad window and when the rad window is closed, it should call main window's call back function which is registered for add_close in the main window.Here is the code snippet
(MainWindow)
function
showNewWindow {
                // open radwindow to get new window
                var url = "/Edit.aspx";
                var oWnd = getRadWindow().BrowserWindow.GetRadWindowManager().open(url, "AddNewEditWindow");
                // subscribe to the close event for the window
                oWnd.add_close(getFieldsFromEditWindow);
            }
function getFieldsFromEditWindow()
{
  var WindowName="AddNewEditWindow";
  var targWnd = getRadWindow().BrowserWindow.GetRadWindowManager().getWindowByName(WindowName);
                var editWnd = targWnd.get_contentFrame().contentWindow;
var data_From_EditWindow=editWnd.getDetails();
}
Edit.aspx ( RadWindow)
function getDetails()
{
return "HI";
}

getDetails() function in Edit.aspx is called successfully in chrome and mozilla but in IE it is failing
when the main window is trying to call the getDetails() in call back function "getFieldsFromEditWindow()"
after the rad window is closed.
It is throwing me an error "Object doesn't support property or method 'getDetails'" 
Please help me in fixing this.




Marin Bratanov
Telerik team
 answered on 19 Dec 2012
5 answers
92 views
Hi All,

I am trying to implement within an Image Viewing application which has a RadWindow which opens up on the click of a button.  The idea is that the user can copy information from the image into some fields on the Window.

The main window is a div which contains two other divs - a left "sidebar" panel and a right "viewer" panel
<div id="container">
        <asp:Panel ID="sidebar" runat="server">
           <asp:PlaceHolder ID="phSideBar" runat="server"></asp:PlaceHolder>
        </asp:Panel>
        <asp:Panel ID="viewer" runat="server">
            <asp:PlaceHolder ID="phViewer" runat="server"></asp:PlaceHolder>
        </asp:Panel>
    </div>

The sidebar contains navigation buttons and links and the viewer panel contains a java applet which handles the image viewing.

During page load, the user controls are added to the placeholders.
protected void Page_Load(object sender, EventArgs e)
{    
            System.Web.UI.Control contHardCopyOrdering = (System.Web.UI.Control)LoadControl("vwHardCopy.ascx");
            sidebar.Controls.Add(contHardCopyOrdering);      // Add Order button Control to SideBar  phSideBar
 
            ViewerServerControl imgViewer = new ViewerServerControl();
            viewer.Controls.Add(imgViewer);   // Add viewer to Placeholder
}

The ascx "vwHardCopy" is

<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="vwHardCopy.ascx.cs"
    Inherits="OriginsNetwork.ImageViewer.vwHardCopy" %>
<%@ Register TagPrefix="telerik" Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" %>
 
<telerik:RadWindowManager ID="RadWindowManager1" ShowContentDuringLoad="false" VisibleStatusbar="false"
    ReloadOnShow="true" runat="server" EnableShadow="true" Width="1500px" Height="500px">
    <Windows>
        <telerik:RadWindow runat="server" ID="RadWindow_NavigateUrl" NavigateUrl="Dialog.aspx"
        Modal="false" Width="300px" Height="250px" Left="0px" Title = "Title of Window">
     </telerik:RadWindow>     
    </Windows>
</telerik:RadWindowManager>
<div id="hardcopy" style="margin-top: 30px;">
<asp:ImageButton ID="btnDialog" ImageUrl "/images/buttons/order-original-red.gif" OnClientClick = "openWinNavigateUrl(); return false;" runat="server"></asp:ImageButton>  
<script type="text/javascript">
            function openWinNavigateUrl() {
                $find("<%=RadWindow_NavigateUrl.ClientID %>").show();
            }
</script>
</div>

the Window is shown but in FireFox, it is behind the Viewer and in IE8 is doesnt get shown at all and seems to do a postback.  I havent tested it with IE9 yet.

Can anyone point me in the right direction to try to debug this or see what is going on.

Thanks for looking
Roger
Marin Bratanov
Telerik team
 answered on 19 Dec 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?