Telerik Forums
UI for ASP.NET AJAX Forum
14 answers
1.8K+ views
Anyone know how to set the position of a RadWindow when it is modal.  Not matter what Left, Top or OpenerElementID property values you set it always appears in the centre.  In my app the centre happens to be a very bad place for it.


 <telerik:RadWindowManager ID="RadWindowManager1" runat="server" Skin="Vista" > 
                <windows> 
                    <telerik:RadWindow   
                        ID="RadWindow1"   
                        runat="server"   
                        ShowContentDuringLoad="False"   
                        Width="400px" 
                        Height="350px"   
                        Title="Action..." 
                        VisibleStatusbar="False"   
                        style="display:none;"   
                        Behavior="Close"   
                        InitialBehavior="None"                         
                        Modal="True"   
                        NavigateUrl=""                          
                        Behaviors="Close" 
                        Left="0" Top="0"   
                        OpenerElementID="fsMyActivities" 
                          
                         > 
                    </telerik:RadWindow> 
                </windows> 
            </telerik:RadWindowManager> 

The window is being opened using radopen() in JavaScript.


Thanks

Dave
Top achievements
Rank 1
 answered on 27 Nov 2018
9 answers
369 views
Hello,

we have problem with RadWindow on touch devices.

It is simple scenario. We have page and RadWindow. Let's say there is just button to open modal maximized window. It works. But you can use touch and move with overlay below window. The same issue is on demo page http://demos.telerik.com/aspnet-ajax/window/examples/modalpopup/defaultcs.aspx. Navigate to this page in any Android browser (I think the same is in IE on Windows Phone or Chrome on Android), set window as modal and maximize it. Then simply drag upwards and window "floats" away and you will see page with overflow.

The same way you cane move left/right if page below window is horizontal scrollable. Then sometimes actions in this window changes position of window and it jumps somewhere to the right and user can only see overlay and have to drag window back.

This happens only on touch devices. Works fine on desktops.

Is there any way how to prevent this? Tried to override touchstart, touchmove, set window behavior only to close (no move or resize) etc. events, but without any luck.

Thnx for any help
Marin Bratanov
Telerik team
 answered on 27 Nov 2018
1 answer
130 views

Similar to the dozens of other threads posted with retrieving a combobox value in client-side code, I cannot get this to work. After spending the past 8 hours trying to get this to work, hopefully someone can point out what I am doing wrong.

I started with this basic code:

<%@ Page Title="" Language="C#" MasterPageFile="~/My.Master" AutoEventWireup="true" CodeBehind="MyPage.aspx.cs" Inherits="MyPage" %>
 
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <title>My Page</title>
    <link rel="stylesheet" type="text/css" href="/CSS/MyPage.css" />
    <script type="text/javascript" src="/Scripts/MyPage.js"></script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="body" runat="server">
   <telerik:RadComboBox ID="RadComboBoxADT" runat="server" />
   <telerik:RadButton ID="btnSubmit" runat="server" Text="Submit" OnClientClicked="onSubmitClick" SingleClick="true" SingleClickText="Processing..." AutoPostBack="false" />
</asp:Content>

MyPage.js:

            function onSubmitClick(a,b) {
                var combo = $find("<%= RadComboBoxADT.ClientID %>");
                alert(combo);
                return;
}

running this code, combo yields "null", so any attempt to get the selected item fails as well.

I tried moving the code from a <script> file, into the content header, e.g.

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <title>My Page</title>
    <link rel="stylesheet" type="text/css" href="/CSS/MyPage.css" />
    <script type="text/javascript">
            function onSubmitClick(a,b) {
                var combo = $find("<%= RadComboBoxADT.ClientID %>");
                alert(combo);
                return;
}
    </script>
</asp:Content>

however, all this managed to do was yield a javascript error, onSubmitClick not found, on page load (why? if I view code, I can see it there.)

another set of eyes here would be appreciated.

 

 

Peter Milchev
Telerik team
 answered on 27 Nov 2018
6 answers
1.2K+ views

Hi.  I have a parent grid and a child grid below. If I click a row in the parent, the child grid will refresh with data associated to the row.  I do this by getting the parent to call a "refresh" method in the child from the parent's "selectedIndexChanged" event.  The "refresh" method gets data from the database.  Then it calls a "rebind" on the grid, which calls the needDatasource method, then the ItemDataBound method.  In the ItemDataBound, based on rules, I decide to show or hide an edit icon.  When I select rows in the parent, this code fires, and tracing thru, it's setting the correct "true" value to the visible property of my edit icon, however when the page is shown, the icon is not there.  Any reason why this is getting lost?

My ugly workaround is to add another method after the "rebind" that basically is the same as the ItemDataBound code which finds the grid, finds my rows, and shows/hides the icons.

 

public void RefreshChild)
{
   LoadChildGridDataFromDataBase();
   ChildGrid.Rebind();

   //ugly

   DoTheItemDataBoundStuffAgain()

}

Attila Antal
Telerik team
 answered on 26 Nov 2018
1 answer
330 views

 

Commented line works for sorting rest column did not work. and in my application translation is also integrated. so i have to change the header text as per language. please suggest what should i do.

Thanks In Advance.

 

GridHeaderItem header = (GridHeaderItem)e.Item;
            //header["colFilename"].Text = dtfileSharingCofig.Rows[0]["fsNameSearch"].ToString();
            header["colUploadedBy"].Text = dtfileSharingCofig.Rows[0]["fsUploadedBySearch"].ToString();
            header["colFileType"].Text = dtfileSharingCofig.Rows[0]["fsFileTypeSearch"].ToString();
            header["colRating"].Text = dtfileSharingCofig.Rows[0]["fsRatingSearch"].ToString();
            header["colUploadedDate"].Text = "Uploaded Date";
            header["colRaters"].Text = "Raters";
            header["colViews"].Text = "Views";
            header["colFileSize"].Text = "File Size";

Attila Antal
Telerik team
 answered on 26 Nov 2018
1 answer
190 views

I have a need to programmatically create a RadGrid based on the number of elements from another table.  So I have the following:

foreach (DataRow customerRow in dtDistinctMonitors.Rows)
            {
                //Get Data
                DataRow[] rowData = dtMonitors.Select("tenantID = '" + tenantID + "'");

                //Add Label
                Label lblName = new Label();
                lblName.Text = "Channel: xxxx";
                lblName.Font.Size = FontUnit.Large;
                PlaceHolder1.Controls.Add(lblName);

                //Add RadGrid
                RadGrid RadGrid1 = new RadGrid();
                RadGrid1.ID = customerRow["channelID"].ToString();

                //Add RadGrid to the Controls collection of the placeholder
                PlaceHolder1.Controls.Add(RadGrid1);

                RadGrid1.DataSource = rowData;
                RadGrid1.MasterTableView.DataKeyNames = new string[] { "monitorID" };
                RadGrid1.AllowPaging = false;
                RadGrid1.MasterTableView.AutoGenerateColumns = false;
                RadGrid1.Skin = "Silk";
                RadGrid1.RenderMode = RenderMode.Lightweight;
                RadGrid1.Width = Unit.Percentage(100);
                GridBoundColumn boundColumn;
                boundColumn = new GridBoundColumn();
                RadGrid1.MasterTableView.Columns.Add(boundColumn);
                boundColumn.DataField = "monitorName";
                boundColumn.HeaderText = "Monitor Name";
                GridButtonColumn buttonColumn;
                buttonColumn = new GridButtonColumn();
                buttonColumn.Text = "Delete";
                buttonColumn.ButtonType = GridButtonColumnType.LinkButton;
                buttonColumn.HeaderStyle.Width = Unit.Pixel(100);
                buttonColumn.CommandArgument = "monitorID";
                buttonColumn.CommandName = "lnkDelete_Command";
                RadGrid1.MasterTableView.Columns.Add(buttonColumn);
            }

And below I have lnkDelete_Command as:

public void lnkDelete_Command(object sender, CommandEventArgs e)
    {
        using (SqlConnection sqlConn = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["stringvalue"].ConnectionString))
        {
            string ID = e.CommandArgument.ToString();

            //DELETE FROM WHERE ID = ID
        }
    }

 

Yet, when I click on the LinkButton created it doesn't fire.  It doesn't really do anything at all but creates a second instance of the button.  Am I missing something simple here?

Marin Bratanov
Telerik team
 answered on 26 Nov 2018
4 answers
149 views
Hi All ,

I am using radscheduler.

In All Day section of radscheduler the appointment are show as one below the other.
So its height get increase.

I want to show the appointment one beside the other(i.e. in one row) like it shows in time slot
For ex.
I)For 7.00-7.30 AM time slot
If there are more than one appointment then it show one beside the other.

Muhammad Motawe
Top achievements
Rank 1
 answered on 26 Nov 2018
1 answer
300 views

I have the radgrid and commandItemTemplate as follows:

<telerik:RadGrid RenderMode="Lightweight" runat="server" ID="calendarTableView" OnItemCommand="ItemCommand" >
    <MasterTableView AutoGenerateColumns="false" TableLayout="Fixed" CommandItemDisplay="Top">
        <CommandItemTemplate>
            <asp:TextBox ID="txtFilter" runat="server"></asp:TextBox>
            <asp:Button ID="btnFilter" runat="server" Text="Apply Filter" CommandName="FilterAll" />
            <asp:Button ID="btnClear" runat="server" Text="Clear Filter" CommandName="ClearFilter" />
        </CommandItemTemplate>
    </MasterTableView>
</telerik:RadGrid>

and in the vb file I have

Protected Sub ItemCommand(ByVal sender As Object, ByVal e As GridCommandEventArgs)
    Dim filterExpression As String = String.Empty
    If e.CommandName = "FilterAll" Then
        Dim cmdItem As GridCommandItem = TryCast(e.Item, GridCommandItem)
        Dim txtFilter = TryCast(cmdItem.FindControl("txtFilter"), TextBox)
        For Each col As GridColumn In calendarTableView.MasterTableView.Columns
            For Each dataItem As GridDataItem In calendarTableView.Items
                If dataItem(col.UniqueName).Text.Contains(txtFilter.Text) Then
                    filterExpression = "([" + col.UniqueName + "] = '%" + txtFilter.Text + "%')"
                    calendarTableView.MasterTableView.FilterExpression = filterExpression
                End If
            Next
        Next
        calendarTableView.MasterTableView.Rebind()
    ElseIf e.CommandName = "ClearFilter" Then
        Dim cmdItem As GridCommandItem = TryCast(e.Item, GridCommandItem)
        Dim txtFilter As TextBox = TryCast(cmdItem.FindControl("txtFilter"), TextBox)
        txtFilter.Text = String.Empty
        calendarTableView.MasterTableView.FilterExpression = String.Empty
    End If
End Sub

 

but I am running into 2 problems.  1, it's not getting the text from the txtFilter textbox correctly and 2, the line " calendarTableView.MasterTableView.Rebind() " comes up with an exception saying it expected an expression.

Marin Bratanov
Telerik team
 answered on 23 Nov 2018
4 answers
265 views
Hi everyone,

On the server, I can do this:

RadListBox1.EmptyMessage = "No items available";

How can I then alter this text later using the client-side API?  The equivalent function or property does not seem to exist.

My project makes extensive use of AJAX and client-side updating, which can leave some of my list-boxes in an "indeterminate state" as they can only be adequately updated on the server (through data-binding).  Therefore I want to be able to clear these list-boxes on the client and display a temporary message that says "Click this button to refresh the list", where the button will then trigger a post-back and cause the current data to be bound to the list-box on the server.  Does that make sense?

Ed Graham
Peter Milchev
Telerik team
 answered on 23 Nov 2018
0 answers
124 views

I have two rad-wizards and a text box in each wizard, i want to set the same value(from db) for two text-boxes on clicking of button. I know how to set for one at a time. Can someone help me to achieve this.

Markup:

 

<telerik:RadWizardStep Title="Step Properties" runat="server">
        <table style="width:100%">
            <tr>
                <td style="width: 35%;" class="td_label" valign="top">
                    <telerik:RadLabel runat="server" RenderMode="Lightweight" ID="RadLabel1" Text="Sln Form:" CssClass="LabelStyle">
                    </telerik:RadLabel>
                </td>
                <td class="noWrap">
                    <telerik:RadTextBox runat="server" RenderMode="Lightweight" ID="slnForm" Enabled="false" CssClass="TextBoxMandatoryStyle">
                    </telerik:RadTextBox>
                </td>
            </tr>
        </table>
</telerik:RadWizardStep>
 
<telerik:RadWizardStep Title="Form" runat="server" ID="rformWizard">
        <table style="width: 100%">
            <tr>
                <td style="width: 35%;" class="td_label" valign="top">
                    <telerik:RadLabel runat="server" RenderMode="Lightweight" ID="SlnLabel" Text="SLN Form:" CssClass="LabelStyle">
                    </telerik:RadLabel>
                </td>
                <td class="noWrap">
                    <telerik:RadTextBox RenderMode="Lightweight" ID="slntxt" Enabled="false" runat="server" CssClass="TextBoxMandatoryStyle">
                    </telerik:RadTextBox>
                </td>
            </tr>
<telerik:RadWizardStep>
Saifulla
Top achievements
Rank 1
 asked on 22 Nov 2018
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?