Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
228 views
<telerik:GridButtonColumn CommandName="Confirm1" ConfirmDialogType="RadWindow" ConfirmText="are you sure?"   ConfirmTitle="Notice" FilterControlAltText="Filter Confirm column" Text="confirm"  UniqueName="Confirm1">  </telerik:GridButtonColumn>
hello
i have this gridbutton 
my problem is when i disable this button in "ItemCreated" from codebehind, its confirm message still be shown!!!
how i can disable its confirm message too?!

tanx
saman
saman
Top achievements
Rank 1
 answered on 26 Feb 2013
1 answer
217 views
Hi,

There is a RadTabStrip control in my user home page and I want to add a new tab to it using Javascript. I am able to add a new tab but the issue is that the change is not persisting after some postback is made. Am I missing something to save the change? Please help.

Thanks,
JC.
Princy
Top achievements
Rank 2
 answered on 26 Feb 2013
1 answer
81 views
Hi,

I am using radcalendar for displaying the dates. I want to add a RadButton and On clicking the button, I want to navigate to today's date in the calendar. I want this to be done using client side code.

Please help,Thanks,
Merlin.
Princy
Top achievements
Rank 2
 answered on 26 Feb 2013
1 answer
397 views
Hi,

I am new to Telerik Controls. Can anybody help me to point out how the RadCombobox differ from RadDropDownlist or both are more or less the same thing?. I am a bit confused regarding the usage of both.

Thanks.
Princy
Top achievements
Rank 2
 answered on 26 Feb 2013
4 answers
269 views
So, a bit complicated and I'm guessing there's an issue with my JavaScript so any help would be appreciated.

Here's my code:

Master Page
function pageLoad() {
    if (!Telerik.Web.UI.RadAsyncUpload.Modules.FileApi.isAvailable()) {
        $(".dropzone h5").hide();
        $(".dropzone p").hide();
        $(".dropzone").removeClass("dropzone");
    }
    else {
        $(document).bind({ "drop": function (e) { e.preventDefault(); } });
        $(".dropzone").each(function (index) {
            $(this).bind({ "dragenter": function (e) { dragEnterHandler(e, $(this)); } })
                .bind({ "dragleave": function (e) { dragLeaveHandler(e, $(this)); } })
                .bind({ "drop": function (e) { dropHandler(e, $(this)); } });
        });
    }
}

ASPX
<%@ Register Src="~/admin/widgets/assetmanager.ascx" TagPrefix="uc" TagName="AssetManager" %>
 
<uc:AssetManager runat="server" ID="Slides" />
<uc:AssetManager runat="server" ID="Boxes" />

ASCX
<telerik:RadScriptBlock runat="server" ID="RadScriptBlock1">
    <script type="text/javascript">
            //.Master file needs: function pageLoad() { loadAsync() }
            //Utils.js - loadAsync(), dropHandler(), dragEnterHandler(), dragLeaveHandler()
             
            function fileUploaded<%= AsyncUpload1.ClientID %>(sender, args) {
                alert("fileUploaded<%= AsyncUpload1.ClientID %>");
                $(".invalid.msg" + <%= AsyncUpload1.ClientID %>).hide();
                $find("<%=RadAjaxManager.GetCurrent(Page).ClientID %>").ajaxRequest("RebindAssets<%= AsyncUpload1.ClientID %>");
                $telerik.$(".invalid.msg" + <%= AsyncUpload1.ClientID %>).html("");
                sender.deleteFileInputAt(0);
            }
 
            function validationFailed<%= AsyncUpload1.ClientID %>(sender, args) {
                alert("validationFailed<%= AsyncUpload1.ClientID %>");
                $(".invalid.msg" + <%= AsyncUpload1.ClientID %>).show();
                $(".invalid.msg" + <%= AsyncUpload1.ClientID %>).html("Sorry, you are trying to upload an invalid type of file.");
                if ($(".filetypes").text() != "") {
                    var types = $(".filetypes").text().replace("(", "").replace(")", "");
                    $(".invalid.msg" + <%= AsyncUpload1.ClientID %>).append(" You can upload the following types of file: " + types + ".");
                }
                sender.deleteFileInputAt(0);
            }
    </script>
    <script type="text/javascript">
        //Telerik.Web.UI.RadAsyncUpload.Modules.Flash.isAvailable = function () { return false; };
        Telerik.Web.UI.RadAsyncUpload.Modules.Silverlight.isAvailable = function () { return false; };
    </script>
</telerik:RadScriptBlock>
 
<telerik:RadCodeBlock runat="server" ID="RadCodeBlock1">
    <span class="msg error invalid msg<%= AsyncUpload1.ClientID %>" style="display:none;"></span>
</telerik:RadCodeBlock>
<div id="pnlDropZone" runat="server" class="dropzone dr{0}">
    <h5>To upload, drop files here</h5>
    <p>or</p>
    <telerik:RadAsyncUpload runat="server" ID="AsyncUpload1" MultipleFileSelection="Automatic" MaxFileSize="52428800" Localization-Select="Select Files" DropZones=".dropzone" /> 
</div>

ASCX.VB
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
 Dim manager As RadAjaxManager = RadAjaxManager.GetCurrent(Page)
 AddHandler manager.AjaxRequest, AddressOf assets_AjaxRequest
 manager.AjaxSettings.AddAjaxSetting(manager, AsyncUpload1)
 manager.AjaxSettings.AddAjaxSetting(manager, ddlMoveTo)
 
 If Not IsPostBack Then
  AsyncUpload1.TargetFolder = "~/Images"
  AsyncUpload1.OnClientFileUploaded = "fileUploaded" & AsyncUpload1.ClientID
  AsyncUpload1.OnClientValidationFailed = "validationFailed" & AsyncUpload1.ClientID
 
  pnlDropZone.Attributes("class") = pnlDropZone.Attributes("class").Replace("{0}", AsyncUpload1.ClientID)
 End If
End Sub
 
Protected Sub AsyncUpload1_FileUploaded(sender As Object, e As Telerik.Web.UI.FileUploadedEventArgs) Handles AsyncUpload1.FileUploaded
 e.File.SaveAs(HttpContext.Current.Server.MapPath("~/images/" & e.File.FileName))
 'Add to database
End Sub

CSS
.dropzone
{
    text-align:center;
    padding:15px;
    border:dashed 5px #c0c0c0;
}
.dropzone h5
{
    margin:0;
}
.dropzone .RadUpload
{
    margin:5px auto 0;
    text-align:center;
}
.dropzone .RadUpload li
{
    list-style:none;
}
.dropzone .RadUpload input.ruFakeInput
{
    display: none;
}

My problem is that when I drag a file to the DropZone for either of the controls, both 'fileUploaded' functions are called and the file is uploaded twice.  If I drag to the actual AsyncControl itself, everything works fine and the file is only uploaded once.

Help!?

Tony.
Matt
Top achievements
Rank 2
 answered on 25 Feb 2013
2 answers
431 views
How do you control the direction of the dropdown for the RadComboBox. Presently I have several comboboxes on a form, each one opens in a different direction, some open scrolling up, others open scrolling down.  I want them all to display down.
Mark Kucera
Top achievements
Rank 1
 answered on 25 Feb 2013
1 answer
142 views
My image column:
<telerik:GridImageColumn DataImageUrlFields="Stage" UniqueName="Stage" DataImageUrlFormatString="Images/{0}.png" ImageAlign="Middle" HeaderText="Step"
    AllowFiltering="true" ShowFilterIcon="False" AutoPostBackOnFilter="True" ShowSortIcon="False">
    <HeaderStyle Width="80px" Font-Bold="true" />
    <ItemStyle Width="80px" />
    <FilterTemplate>
        <telerik:RadComboBox ID="StageFilter" runat="server" HighlightTemplatedItems="True" OnClientSelectedIndexChanged="RTAStepFilterChanged"
            SelectedValue='<%# ((GridItem)Container).OwnerTableView.GetColumn("Stage").CurrentFilterValue %>' Width="51px" DropDownWidth="69px" ShowSortIcon="False">
            <ItemTemplate>
                <div><img src='<%# DataBinder.Eval(Container, "ImageUrl") %>' alt="" /></div>
            </ItemTemplate>
            <Items>
                <telerik:RadComboBoxItem Text="" Value="" ImageUrl="Images/nofilter.png" />
                <telerik:RadComboBoxItem Text="1" Value="1" ImageUrl="Images/1.png" />
                <telerik:RadComboBoxItem Text="2" Value="2" ImageUrl="Images/2.png" />
                <telerik:RadComboBoxItem Text="3" Value="3" ImageUrl="Images/3.png" />
                <telerik:RadComboBoxItem Text="4" Value="4" ImageUrl="Images/4.png" />
                <telerik:RadComboBoxItem Text="5" Value="5" ImageUrl="Images/5.png" />
                <telerik:RadComboBoxItem Text="6" Value="6" ImageUrl="Images/6.png" />
                <telerik:RadComboBoxItem Text="7" Value="7" ImageUrl="Images/7.png" />
                <telerik:RadComboBoxItem Text="8" Value="8" ImageUrl="Images/8.png" />
                <telerik:RadComboBoxItem Text="X" Value="0" ImageUrl="Images/cancel.png" />
            </Items>
        </telerik:RadComboBox>
        <telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
            <script type="text/javascript">
                function RTAStepFilterChanged(sender, args) {
                    var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");
                    var filterValue = args.get_item().get_value();
                    tableView.filter("Stage", filterValue, Telerik.Web.UI.GridFilterFunction.Contains);
                }
            </script>
        </telerik:RadScriptBlock>
    </FilterTemplate>
</telerik:GridImageColumn>

Server Error in '/' Application.

is neither a DataColumn nor a DataRelation for table DefaultView.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.ArgumentException: is neither a DataColumn nor a DataRelation for table DefaultView.

Source Error: 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace: 


[ArgumentException:  is neither a DataColumn nor a DataRelation for table DefaultView.]
   System.Data.DataRowView.get_Item(String property) +1338062
   lambda_method(Closure , DataRowView ) +59
   System.Linq.WhereEnumerableIterator`1.MoveNext() +139
   System.Linq.Enumerable.Count(IEnumerable`1 source) +4083557
   lambda_method(Closure ) +265
   System.Linq.EnumerableExecutor`1.Execute() +94
   System.Linq.EnumerableExecutor`1.ExecuteBoxed() +23
   System.Linq.EnumerableQuery`1.System.Linq.IQueryProvider.Execute(Expression expression) +94
   Telerik.Web.UI.GridDynamicQueryable.Count(IQueryable source) +313
   Telerik.Web.UI.GridDataTableFromEnumerable.FillData35() +4445
   Telerik.Web.UI.GridDataTableFromEnumerable.FillData() +1078
   Telerik.Web.UI.GridResolveEnumerable.Initialize() +58
   Telerik.Web.UI.GridResolveEnumerable.EnsureInitialized() +45
   Telerik.Web.UI.GridResolveEnumerable.get_DataTable() +36
   Telerik.Web.UI.GridEnumerableFromDataView..ctor(GridTableView owner, DataView dataView, Boolean autoGenerateColumns, GridColumnCollection presentColumns, String[] additionalField, Boolean retrieveAllFields, Boolean enableSplitHeaderText) +244
   Telerik.Web.UI.GridDataSourceHelper.CreateGridEnumerable(GridTableView owner, IEnumerable enumerable, Boolean caseSensitive, Boolean autoGenerateColumns, GridColumnCollection presentColumns, String[] additionalField, Boolean retrieveAllFields, Boolean enableSplitHeaderText) +109
   Telerik.Web.UI.GridDataSourceHelper.GetResolvedDataSource(GridTableView owner, Object dataSource, String dataMember, Boolean caseSensitive, Boolean autoGenerateColumns, GridColumnCollection presentColumns, String[] additionalField, Boolean retrieveAllFields, Boolean enableSplitHeaderText) +755
   Telerik.Web.UI.GridTableView.get_ResolvedDataSource() +257
   Telerik.Web.UI.GridTableView.CreateControlHierarchy(Boolean useDataSource) +727
   Telerik.Web.UI.GridTableView.CreateChildControls(IEnumerable dataSource, Boolean useDataSource) +1286
   System.Web.UI.WebControls.CompositeDataBoundControl.PerformDataBinding(IEnumerable data) +67
   System.Web.UI.WebControls.DataBoundControl.OnDataSourceViewSelectCallback(IEnumerable data) +123
   System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +33
   System.Web.UI.WebControls.DataBoundControl.PerformSelect() +138
   Telerik.Web.UI.GridTableView.PerformSelect() +38
   System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +30
   Telerik.Web.UI.GridTableView.DataBind() +387
   Telerik.Web.UI.GridTableView.Rebind() +108
   Telerik.Web.UI.GridFilterCommandEventArgs.ExecuteCommand(Object source) +1018
   Telerik.Web.UI.RadGrid.OnBubbleEvent(Object source, EventArgs e) +205
   System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37
   Telerik.Web.UI.GridItem.OnBubbleEvent(Object source, EventArgs e) +71
   System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37
   Telerik.Web.UI.GridItem.OnBubbleEvent(Object source, EventArgs e) +147
   Telerik.Web.UI.GridItem.FireCommandEvent(String commandName, Object commandArgument) +88
   Telerik.Web.UI.RadGrid.RaisePostBackEvent(String eventArgument) +12205
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +9642898
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1724

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.18033



I am not sure what I am doing wrong here. Is this even possible? My Data Source is an SQLDataSource and it is used a stored procedure. The column is populated and images are displayed.
Kyle Smith
Top achievements
Rank 1
 answered on 25 Feb 2013
4 answers
371 views

Hi,

 


I am trying to add required field validation to 2 fields Tag and Description. When user clicks New or Edit, the EditMode is set to popup. Inside the popup, the user needs to populate the Tag and Description input boxes. If both or one is empty/null, then I want to display a message to the user that Tag/Description is a required field, much like the behavior of RequiredFieldValidator. I have found numerous server side examples but no client side examples to accomplish this.

Any and all suggestions are welcomed.

Thanks in advance...

 

<telerik:RadGrid ID="RadGridTagDetail" runat="server" AllowAutomaticDeletes="True" 
    AllowAutomaticInserts="True" AllowAutomaticUpdates="True" 
    AllowFilteringByColumn="True" AllowPaging="True" 
    DataSourceID="ObjectDataSourceTags" GridLines="None" 
    style="margin-left: 13px" Width="50%" AutoGenerateColumns="False" 
    onitemdeleted="TagDetail_ItemDeleted" oniteminserted="TagDetail_ItemInserted" 
    onitemupdated="TagDetail_ItemUpdated">
<HeaderContextMenu EnableAutoScroll="True"></HeaderContextMenu>
  
    <ClientSettings AllowRowsDragDrop="True">
        <Selecting AllowRowSelect="True" EnableDragToSelectRows="False" />
        <Scrolling AllowScroll="True" UseStaticHeaders="True" />
    </ClientSettings>
      
<MasterTableView CommandItemDisplay="Bottom" 
        DataSourceID="ObjectDataSourceTags" DataKeyNames="Id" EditMode="PopUp">
<CommandItemSettings ExportToPdfText="Export to Pdf"></CommandItemSettings>
    <Columns>
        <telerik:GridBoundColumn DataField="Id" HeaderText="Tag" SortExpression="Id" 
            UniqueName="Id">
        </telerik:GridBoundColumn>
   
        <telerik:GridBoundColumn DataField="Descr" HeaderText="Description" 
            SortExpression="Descr" UniqueName="Descr">
        </telerik:GridBoundColumn>
    </Columns>
    <EditFormSettings InsertCaption="Add new Tag" PopUpSettings-Modal="false"/>
    <CommandItemTemplate>
        <telerik:RadToolBar ID="RadToolBarTags" Runat="server" 
            OnClientButtonClicking="RadToolBarTags_OnClientButtonClicking" 
            onbuttonclick="RadToolBarTags_ButtonClick">
        <Items>
            <telerik:RadToolBarButton runat="server" CommandName="InitInsert" Text="New">
            </telerik:RadToolBarButton>
            <telerik:RadToolBarButton runat="server" CommandName="EditSelected" Text="Edit">
            </telerik:RadToolBarButton>
            <telerik:RadToolBarButton runat="server" CommandName="DeleteSelected" Text="Delete">
            </telerik:RadToolBarButton>
            <telerik:RadToolBarButton runat="server" IsSeparator="true">
            </telerik:RadToolBarButton>
            <telerik:RadToolBarButton runat="server" Text="Close" Value="close">
            </telerik:RadToolBarButton>
        </Items>
        </telerik:RadToolBar>
    </CommandItemTemplate>
</MasterTableView>
</telerik:RadGrid>

Shoshanah
Top achievements
Rank 1
Iron
 answered on 25 Feb 2013
1 answer
121 views
I have a radeditor that is enabled with the only option being allow toggle to full screen mode. I have the the onkeydown event programmed in javascript to return if a key is pressed so that the editor will not allow for typing. The editor must be enabled. The problem I have is that if a user cuts text from one window and right clicks on the radeditor and chooses "paste" text will be pasted into the radeditor. I am trying to make the enabled radeditor act as if the text area is disabled. How can I prevent the right click "paste" from inserting text into the radeditor?

Thanks,


Steve Holdorf
Steve Holdorf
Top achievements
Rank 1
 answered on 25 Feb 2013
1 answer
289 views
<telerik:RadComboBox ID="rcbVendor" AutoPostBack="true" ValueType="System.Int32" DataValueField = "VendorNumber" DataTextField = "VendorName" width="280px" runat="server" />
this snippet doesn't work
var rntbOrderCode = $find('<%=rntbOrderCode.ClientID %>');        
            if (rcbVendor != null) {
             rcbiVendor = rcbVendor.findItemByValue(VendorNumber);
             if (rcbiVendor == null)
             {
                 alert (VendorNumber);
             }
             else
             {
                 rcbiVendor.select();
             }
         }
it finds the combo box - and there is something in VendorNumber
but it doesn't select

the routine is on the select of a datagrid - and I have the Ajax manager coded as such
<telerik:RadAjaxManager ID="raManager" runat="server">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="rcbVendor">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="rgItems" />
                <telerik:AjaxUpdatedControl ControlID="rcbVendor" />
            </UpdatedControls>
        </telerik:AjaxSetting>
        <telerik:AjaxSetting AjaxControlID="rgItems">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="rgItems" />
                <telerik:AjaxUpdatedControl ControlID="rcbVendor" />
                <telerik:AjaxUpdatedControl ControlID="rntbOrderCode" />
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManager>
it should work, right?
Elliott
Top achievements
Rank 2
 answered on 25 Feb 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?