Telerik Forums
UI for ASP.NET AJAX Forum
8 answers
137 views

Hi,

Scheduler shows scroll at the top on page load and takes a while to reset its position.
I have a timer and a scheduler, I scroll to the bottom of the radscheduler but with every refresh, the scroll bar shows at the top for a sec and then it scrolls to the bottom. 

How can I make scheduler to show scroll bars  by retaining  its position on page load? I want to avoid flashing effect on scheduler.

I see the same effect on following demo site, Go to month view and scroll to the bottom, then move an appointment, on post back you see the flashing effect of scrollbar, is it a software bug?
http://demos.telerik.com/aspnet-ajax/scheduler/examples/customization/defaultcs.aspx 

Thanks,
Prava
Nencho
Telerik team
 answered on 20 Aug 2014
2 answers
60 views
I have the following grid:
            <telerik:RadGrid runat="server" ID="gvClients" ClientSettings-EnablePostBackOnRowClick="true" BackColor="AliceBlue" AutoGenerateHierarchy="True" CellSpacing="0" GridLines="None" Skin="Metro" DataSourceID="SqlDataSource1" AllowPaging="True" AllowSorting="True">
                <ClientSettings>
                    <Selecting AllowRowSelect="True" />
                </ClientSettings>
                <MasterTableView DataKeyNames="id" DataSourceID="SqlDataSource1" AutoGenerateColumns="False" HierarchyLoadMode="Client">
                    <Columns>
                        <telerik:GridBoundColumn DataField="seniorId" DataType="System.Int32" FilterControlAltText="Filter seniorId column" HeaderText="seniorId" SortExpression="seniorId" UniqueName="seniorId" Visible="False">
                            <ColumnValidationSettings>
                                <ModelErrorMessage Text="" />
                            </ColumnValidationSettings>
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="id" DataType="System.Int32" FilterControlAltText="Filter id column" HeaderText="תעדות זהות" ReadOnly="True" SortExpression="id" UniqueName="id">
                            <ColumnValidationSettings>
                                <ModelErrorMessage Text="" />
                            </ColumnValidationSettings>
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="password" FilterControlAltText="Filter password column" HeaderText="סיסמא" SortExpression="password" UniqueName="password">
                            <ColumnValidationSettings>
                                <ModelErrorMessage Text="" />
                            </ColumnValidationSettings>
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="fName" FilterControlAltText="Filter fName column" HeaderText="שם פרטי" SortExpression="fName" UniqueName="fName">
                            <ColumnValidationSettings>
                                <ModelErrorMessage Text="" />
                            </ColumnValidationSettings>
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="lName" FilterControlAltText="Filter lName column" HeaderText="שם משפחה" SortExpression="lName" UniqueName="lName">
                            <ColumnValidationSettings>
                                <ModelErrorMessage Text="" />
                            </ColumnValidationSettings>
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="mPhone" FilterControlAltText="Filter mPhone column" HeaderText="מספר טלפון" SortExpression="mPhone" UniqueName="mPhone">
                            <ColumnValidationSettings>
                                <ModelErrorMessage Text="" />
                            </ColumnValidationSettings>
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="address" FilterControlAltText="Filter address column" HeaderText="כתובת" SortExpression="address" UniqueName="address">
                            <ColumnValidationSettings>
                                <ModelErrorMessage Text="" />
                            </ColumnValidationSettings>
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="sc" DataType="System.Byte" FilterControlAltText="Filter sc column" HeaderText="sc" SortExpression="sc" UniqueName="sc" Visible="False">
                            <ColumnValidationSettings>
                                <ModelErrorMessage Text="" />
                            </ColumnValidationSettings>
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="email" FilterControlAltText="Filter email column" HeaderText="אימייל" SortExpression="email" UniqueName="email">
                            <ColumnValidationSettings>
                                <ModelErrorMessage Text="" />
                            </ColumnValidationSettings>
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="dateJoined" DataFormatString="{0:HH:mm dd-MM-yyyy}" DataType="System.DateTime" FilterControlAltText="Filter dateJoined column" HeaderText="תאריך הצטרפות" SortExpression="dateJoined" UniqueName="dateJoined">
                            <ColumnValidationSettings>
                                <ModelErrorMessage Text="" />
                            </ColumnValidationSettings>
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="contract" FilterControlAltText="Filter contract column" HeaderText="contract" SortExpression="contract" UniqueName="contract" Visible="False">
                            <ColumnValidationSettings>
                                <ModelErrorMessage Text="" />
                            </ColumnValidationSettings>
                        </telerik:GridBoundColumn>
                    </Columns>
                    <PagerStyle AlwaysVisible="True" />
                </MasterTableView>
</telerik:RadGrid> 
Now this works fine, i can select and everything. Things get tricky when i add below the grid, this table:
<table>
                <tr>
                    <td class="auto-style1">
                        <p>תעודת זהות</p>
                    </td>
                    <td>
                        <telerik:RadTextBox runat="server" ID="txtId" Width="200px" Skin="Metro" /></td>
                </tr>
                <tr>
                    <td class="auto-style1">
                        <p>סיסמא</p>
                    </td>
                    <td>
                        <telerik:RadTextBox ID="txtPassword" runat="server" Width="200px" Skin="Metro" />
                    </td>
                </tr>
                <tr>
                    <td class="auto-style1">
                        <p>שם פרטי</p>
                    </td>
                    <td>
                        <telerik:RadTextBox ID="txtfName" runat="server" Width="200px" Skin="Metro" />
                    </td>
                </tr>
                <tr>
                    <td class="auto-style1">
                        <p>שם משפחה</p>
                    </td>
                    <td>
                        <telerik:RadTextBox ID="txtlName" runat="server" Width="200px" Skin="Metro" />
                    </td>
                </tr>
                <tr>
                    <td class="auto-style1">
                        <p>מספר טלפון</p>
                    </td>
                    <td>
                        <telerik:RadTextBox ID="txtmPhone" runat="server" Width="200px" Skin="Metro" />
                    </td>
                </tr>
                <tr>
                    <td class="auto-style1">
                        <p>כתובת</p>
                    </td>
                    <td>
                        <telerik:RadTextBox ID="txtAddress" runat="server" Width="200px" Skin="Metro" />
                    </td>
                </tr>
                <tr>
                    <td class="auto-style1">
                        <p>אימייל</p>
                    </td>
                    <td>
                        <telerik:RadTextBox ID="txtEmail" runat="server" Width="200px" Skin="Metro" />
                    </td>
                </tr>
                <tr>
                    <td class="auto-style1">
                        <telerik:RadButton ID="btnUpdate" runat="server" Skin="Metro" Width="126px" Text="עדכן" />
                    </td>
                    <td>
                        <telerik:RadButton ID="btnDelete" runat="server" Width="200px" Skin="Metro" Text="מחק" OnClientClicked='return confirm("האם אתה בטוח?");' />
                    </td>
                </tr>
            </table>
As soon as i add this table the grid selection is suddenly disabled, and so is the paging option for some reason. In my code behind there is nothing yet except for one line of code adding a cookie on page load.

Why is this happening? When i remove the table below it functions perfectly.






Eran
Top achievements
Rank 1
 answered on 20 Aug 2014
1 answer
120 views
Hi,

I'm binding the RadListBox to a Collection<T> and setting DataValueField, DataTextField and DataKeyField. I have no problems getting the value and text client-side using jquery, but there doesn't seem to be way to get the key value. One workaround I've found is to manually add a "key" attribute during the ItemDataBound event and then using get_attributes() client-side, but I was wondering if there was a built-in way of doing this without having to hook up the ItemDataBound event.

Thank you,
Katia
Bozhidar
Telerik team
 answered on 20 Aug 2014
4 answers
364 views
Hi All,

I'm embarking on a revamp of my application and rather than having label and radtextbox pairs would like to use the built in labels of the radtextbox (and other controls). 

In the sample below I would like to control the width (282px) in the CSS.  However if I do that then the label width is ignored.  The only way to get a fixed with label and textbox seems to be to declare the label with in the CSS and the overall textbox width as below - then in this case if the label is 100px wide the textbox itself would be 282px-100px = 182px.

<telerik:RadTextBox ID="uxUsername" Runat="server" Width="282px" Label="Username:" CssClass="RadTextBoxHalf" LabelCssClass="RadTextBoxLabel"></telerik:RadTextBox>

Having to use the textbox for the width seems to be against the principle of CSS.  Any suggestions?

Regards

Jon

Jon
Top achievements
Rank 1
 answered on 20 Aug 2014
3 answers
438 views
Hi, I used the code in http://demos.telerik.com/aspnet-ajax/tabstrip/examples/application-scenarios/add-remove-tabs/defaultcs.aspx, with the following differences:
1. within the multipage, there is no RADGrid as I do not want to show any data in the first tab
2. when clicking on the + button, i am loading my user control file using Page.LoadControl. This user control has only 2 textboxes and a button.
Rest everything is the same.

My problem is: i have a javascript function within the ascx which is called on button click. On clicking the button, i am getting the error: ReferenceError: <function> is not defined. The behavior is same for all the javascript / jquery functions defined in the ascx. I enclosed my script block with RadScriptBlock.

My ascx code is below: (actually i developed this test user control to pinpoint the issue as my main user control was giving the same error)

<%@ Control Language="C#" AutoEventWireup="true" CodeFile="Testtab.ascx.cs" Inherits="Common_UserControl_Testtab" %>
    <div>
        <label>Name:</label>
        <input name="txtFirstName" type="text" class="actxtbox txtbox" runat="server" id="txtName" size="15"  />
        <label>Age:</label>
        <asp:TextBox ID="txtAge" runat="server" MaxLength="100"></asp:TextBox>
        <input type="button" onclick="javascript: save();" value="save"/>
        <br />
    </div>

<telerik:RadScriptBlock ID="RadScriptBlock1" runat="server"> 
 <script type="text/javascript">

     function save() {
         alert('test');
     }
     </script>
</telerik:RadScriptBlock>

I went through the forum posts which talk about similar issue, but none of the suggestions posted work for me. Please provide any pointers to solve the issue.

Thanks
Suchitra










Shinu
Top achievements
Rank 2
 answered on 20 Aug 2014
3 answers
96 views
Hi,
I want to show a column in the radgrid detail table depending on a session flag.
I can show the column when I show the detail table, but once I show another detail table for another data item, the column is  invisible again. 
How do I show the column for all expanded detail table?
Here is my code:

       <telerik:RadGrid 
            ID="radgrid1" 
            Runat="server"  
            AutoGenerateColumns="false"
            AllowPaging="true" 
            PageSize="10"
            AllowFilteringByColumn="False"
            AllowSorting="True" 
            AllowMultiRowSelection="false"     
            OnSelectedIndexChanged="radgrid1_SelectedIndexChanged"
            OnNeedDataSource="radgrid1_NeedDataSource"
            OnUpdateCommand="radgrid1_UpdateCommand" 
            OnItemCreated="radgrid1_GridItemCreated"
            OnItemDataBound ="radgrid1_ItemDataBound"
            OnCreateColumnEditor="radgrid1_CreateColumnEditor" 
            OnItemCommand="radgrid1_ItemCommand"
            OnDetailTableDataBind="radgrid1_DetailTableDataBind"
            AutoGenerateHierarchy="true"
            CellSpacing="0" 
            GridLines="None"
            DataMember="PortalUserTable">
        <MasterTableView DataKeyNames= "Id,UserName" EditMode="PopUp" CommandItemDisplay="Top">
            <CommandItemSettings ShowExportToExcelButton="true" ShowExportToWordButton="true" ShowExportToPdfButton="true" ShowAddNewRecordButton="false" />
            <DetailTables>
                <telerik:GridTableView Name="detailtable1" 
                    Width="100%" NoDetailRecordsText="No Location is set up for this user."
                    AllowFilteringByColumn="false" AllowPaging="false">
                    <Columns>
                        <telerik:GridBoundColumn UniqueName="column1" HeaderText="Location" DataField="column1" HeaderStyle-Width="200px" Display="false"/>
                       
                            DataField="LocationId" Display="false" />
                    </Columns>
                </telerik:GridTableView>
            </DetailTables>
            <Columns>
            .................
             </Columns>
            <EditFormSettings>
               <FormTemplate>
.............................................
                </FormTemplate>
             </EditFormSettings>
</telerik:RadGrid>

protected void radgrid1_DetailTableDataBind(object source, GridDetailTableDataBindEventArgs e)
{
      if (Convert.ToBoolean(Session["flag"]))
      {
          e.DetailTableView.GetColumn("column1").Display = true;
      }
}
Princy
Top achievements
Rank 2
 answered on 20 Aug 2014
4 answers
352 views
Is it an intended design that when you click inside the radtextbox, that the cursor automatically goes to the front or first character in the text box?  For example, if you have "New Thread" in a text box, you mouse click inside the text box after the word "Thread"; a second later the cursor moves automatically back to the position just before the word "New".
Shinu
Top achievements
Rank 2
 answered on 20 Aug 2014
2 answers
297 views
Hi 

I have a radgrid generated from the selection of dropdowns. I need to export the radgrid to excel. I have tried all the methods displayed but when i do the same Grid refreshes and the download does not appear.Please help me out.


Thanks in Advance
Princy
Top achievements
Rank 2
 answered on 20 Aug 2014
6 answers
171 views
I am trying to apply a Red border to fields that have failed validation using the following code:

<form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
        <Scripts>
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
        </Scripts>
    </telerik:RadScriptManager>
 
    <div>
        <asp:TextBox ID="TextBox1" runat="server" />
        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="TextBox1" ErrorMessage="RequiredFieldValidator" />
    </div>
 
    <asp:Button ID="Button1" runat="server" Text="Test" />
 
    <script type="text/javascript">
        $(function () {
            if (typeof ValidatorUpdateDisplay != 'undefined') {
                var originalValidatorUpdateDisplay = ValidatorUpdateDisplay;
                ValidatorUpdateDisplay = function (val) {
                    if (!val.isvalid) {
                        $("#" + val.controltovalidate).css("border", "2px solid red");
                    }
 
                    originalValidatorUpdateDisplay(val);
                }
            }
        });
    </script>
</form>

The validation itself works fine. But the red border never gets applied. If I remove the Telerik script references and reference non-Telerik JQuery, the red border gets applied correctly.

I would like to continue using the Telerik script references for maximum compatibility with the RadControls which I use extensively. So I'd appreciate any ideas about how to get around this problem. Thanks!
KDL
Top achievements
Rank 1
 answered on 19 Aug 2014
2 answers
813 views
Hi,

Some way to set the time server side. I have tested some ways but are only Read(Get). Passing from codebehind to client side some way?.

Thanks.
Ashandra
Top achievements
Rank 1
 answered on 19 Aug 2014
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?