Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
164 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
465 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
521 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
175 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
410 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
384 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
210 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
858 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
2 answers
251 views
Here is the scenario:

I have a RadWindow that opens a different ASPX page (so not using a Content Template)

On this ASPX pages that is opened in the RadWindow, I have a RadCombobox with a lot of items.

The RadWindow is AutoSized to the contents - of something like 600x400px.

When you open the RadCombobox, which is positioned near the bottom of the RadWindow, the dropdown opens down, and you can only see a couple of options - it appears that the Dropdown is actually going quite a distance down the popup page, which now has scrollbars - just while this dropdown is open.  using the Scrollbars closes the dropdown and then the scrollbars disappear.  Using Chrome if that matters.

Is there a way to force the RadCombobox in this scenario to stay within the Radwindow?  I have tried EnableScreenBoundaryDetection and ExpandDirection="Up" - but can't get anything to work.

What am I doing wrong?
Dan
Top achievements
Rank 1
 answered on 19 Aug 2014
12 answers
526 views
Here is my code;

 

<rada:RadAsyncUpload ID="RadUpload1" runat="server" OnFileUploaded="RadAsyncUpload1_FileUploaded" OnClientFileUploadFailed="onUploadFailed"

 

 

ReadOnlyFileInputs="true" OnClientFileSelected="onFileSelected" OnClientFileUploaded="onFileUploaded" OnClientFileUploading="onFileUploading" TemporaryFolder="c:\temp" />


 

 

<script type="text/javascript">

 

 

 

 

 

var $ = $telerik.$;

 

 

var uploadsInProgress = 0;

 

 

function onFileSelected(sender, args) {

 

alert(

'4');

 

 

if (!uploadsInProgress)

 

$(

"#newupload").attr("disabled", "disabled");

 

uploadsInProgress++;

}

 

function onFileUploaded(sender, args) {

 

alert(

'3');

 

decrementUploadsInProgress();

}

 

function onUploadFailed(sender, args) {

 

alert(

'2');

 

decrementUploadsInProgress();

 

}

 

function decrementUploadsInProgress() {

 

alert(

'1');

 

uploadsInProgress--;

 

if (!uploadsInProgress)

 

$(

"#newupload").removeAttr("disabled");

 

}

 

function onFileUploading() {

 

alert(

'5');

 

}

 

 

</script>

 




The problem I'm having is that it never seems to properly be creating the temporary file.  I see a file called "RadUploadTestFile" created, but with 0KB.  And the progress bar never goes away.  I don't get why it won't create the temporary file for me to upload to the final location later?

See attached image.

David
Top achievements
Rank 1
 answered on 19 Aug 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?