Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
228 views
Hi:

How can I parametrize the radmenu so when I click an option, the menu closes after it immediatly?

At this moment when I click an option, and the mouse remains over the menu, the menu continues open, but I want it closes after it has been clicked.

Thanks.
Elena
Top achievements
Rank 1
 answered on 14 Aug 2015
1 answer
127 views

i have used a RadAsyncUpload in my Aspx page. It works fine but when i upload a file and then remove the file, the browse button also gets invisible.

below is my control being used

Please guide on the same.

Thanks in advance

 

<telerik:RadAsyncUpload Width="230px" runat="server" ID="rgEditUpload" OnClientFileUploaded="onClientFileUploaded"
MaxFileInputsCount="1"     AllowedFileExtensions="jpg,jpeg,png,gif,pdf" OnClientValidationFailed="OnClientValidationFailed"
OnClientFileUploadRemoved="onClientFileRemoved">
    <FileFilters>
        <telerik:FileFilter Description="Documents(pdf;tiff;tif)" />
    </FileFilters>
    <Localization Select="Browse" />
</telerik:RadAsyncUpload>

Dimitar
Telerik team
 answered on 14 Aug 2015
4 answers
128 views
Well, I left work last night and everything was fine. Came back and I started getting the "RadGridNamespace is not defined" error, and my data was exploded all over the screen. I didn't make any changes, and I even rolled back my code to a version we were using over a week ago, and the same thing is happening.

The grid works fine on all of our servers, and works for our other developers, just not me.

Any ideas?
Chip Johansen
Top achievements
Rank 1
 answered on 14 Aug 2015
16 answers
790 views
Hi all,

I have a control that inherits the Telerik.Web.UI.GridDropDownColumn like:

 
    [DefaultProperty("Value")] 
    [ToolboxData("<{0}:myGridDropDownColumn runat=server></{0}: myGridDropDownColumn>")] 
    public class myGridDropDownColumn : GridDropDownColumn 
    { ... }

I need to attach an event to fire up on Selected Value is changed. How can I accomplish this?

my control does not give me the OnColumnChange Event [url: http://www.telerik.com/help/aspnet-ajax/telerik.web.ui-telerik.web.ui.griddropdowncolumn_members.html] (am I missing something?)

and there is no Attribute propertie to attach a javascript call like:

myGridDropDownColumn myDrop = new myGridDropDownColumn(); 
myDrop.Attributes.Add("onchange", "alert('event fired!');");

My objective in this case is to create a dropDown that, when the selectedValue changes, it would populate the other DropDown in the same row: row[ x ].column[ 2 ], any idea is there is a tutorial about this technique... I can't find it anywhere around :(

Eyup
Telerik team
 answered on 14 Aug 2015
4 answers
78 views

I put a RadEditor inside a Formview, which is inside a RadAjaxPanel.  I use the following to load RTF:

         protected void Unnamed_DataBinding(object sender, EventArgs e)

        {
            var txt = sender as RadEditor;

            txt.LoadRtfContent(@"{\rtf1\ansi\deff0
{\colortbl;\red0\green0\blue0;\red255\green0\blue0;}
This line is the default color\line
\cf2
This line is red\line
\cf1
This line is the default color
}
");
        }

 The issue is the editor is displaying the text with HTML tags instead of formatted text.  I am wondering if this is an issue with the trial version (still waiting for my company to process the purchase) since it adds warning text to the content automatically.

Stanimir
Telerik team
 answered on 14 Aug 2015
14 answers
581 views

Hi,

I've been having problems with client side calculations for my RadGrid (EditMode="Batch", EditType="Cell").

In order to sum up cells 'a' and 'b' and display the result in cell 'c' of the selected row (and only this row) I subscribed to OnBatchEditCellValueChanged event and created javascript function (see below).

It worked fine in 2014.403.45.

When switching to the latest (2014.2.618.40) and changing to EditType="Row" (it doesn't work for "Cell" also) all of a sudden I get loads of undefined/null object errors:

Error: Unable to get value of the property 'getElementsByTagName': object is null or undefined

Callstack:
​ _getDataControl
 _openCellInEditMode
 openRowForEdit
 _open
 _openEditFromEvent
 Anonymous Function


I've spent hours researching this and still didn't manage to get this working...

I guess my question would be: could you please provide an example of a simple javascript function example that sums two cells and display the result in the third
cell of the selected row in RadGrid with EditMode="Batch", EditType="Cell".

Thank you in advance.

function BatchCellModified(sender, args) {
              var grid = $find('<%= myGrid.ClientID %>');
              var masterTable = grid.get_masterTableView();
              var rows = masterTable.get_dataItems();
              var rowArgs = args.get_row();
              var rowIndex = rowArgs.sectionRowIndex;
              var row = rows[rowIndex];
              var txtTotal = row.get_cell("Total");
        
              if (args.get_columnUniqueName() === "PD" ||
                  args.get_columnUniqueName() === "BI") {
        
                  var txtPd = (isNaN(parseFloat(row.get_cell("PD").outerText))) ? 0 : parseFloat(row.get_cell("PD").outerText);
                  var txtBi = (isNaN(parseFloat(row.get_cell("BI").outerText))) ? 0 : parseFloat(row.get_cell("BI").outerText);
        
                  var totalAmount = txtPd + txtBi;
                  txtTotal.innerHTML = totalAmount;
              }
              if (args.get_columnUniqueName() === "Total") {
                  if (txtTotal != (txtPd + txtBi)) {
                      var txtPdOutput = row.get_cell("PD");
                      txtPdOutput.innerHTML = 0;
                      var txtBiOutput = row.get_cell("BI");
                      txtBiOutput.innerHTML = 0;
                  }
              }
          };
Angel Petrov
Telerik team
 answered on 14 Aug 2015
1 answer
71 views
Right now I have a radcontext menu in my radgrid that has Replace, Edit and Delete options. When delete is clicked, it opens a RadWindow. I have a radtextbox and a raddatepicker that need to fill the corresponding data from the radgrid upon Page_Load. Can anyone help? My issue is not knowing how to pull that data from the Default page.
Eyup
Telerik team
 answered on 14 Aug 2015
1 answer
145 views

We have similar two radgrids like below in one page. When we try to insert empty data clicking on insert it shows requiredfiled validator which is correct but it triggers requiredfield validator of 2nd grid also because it is also in edit mode. How to keep it separate so that validation for one grid should not call validation for 2nd grid if both are in edit/Insert mode.

 

<telerik:RadGrid ID="c_dgvMClassificationCode" AllowPaging="true" PageSize="5" AllowCustomPaging="true"
        runat="server"AllowFilteringByColumn="False"GridLines="None"AutoGenerateColumns="False"
        AllowSorting="True">
        <PagerStyle Visible="true"/>
        <ClientSettings AllowColumnsReorder="True"ReorderColumnsOnClient="True"EnableRowHoverStyle="True">
            <ClientEventsOnRowContextMenu="RowContextMenuMClassificationCode"/>
            <ScrollingAllowScroll="true"EnableVirtualScrollPaging="false" UseStaticHeaders="true"
                SaveScrollPosition="true"/>
            <SelectingAllowRowSelect="true"/>
        </ClientSettings>
        <GroupingSettingsCaseSensitive="false"/>
        <MasterTableViewDataKeyNames="UniqueID"NoMasterRecordsText="No Master Classification Codes found."
            EditMode="InPlace"CommandItemDisplay="Top"GridLines="Both"TableLayout="Fixed"
            InsertItemPageIndexAction="ShowItemOnCurrentPage" Width="490">
            <CommandItemTemplate>
                <divstyle="width: 80%; float: left; vertical-align: middle; height: 23px;">
                    <asp:Label ID="c_lblMclsCode"runat="server"Text="Master Classification Code" CssClass="gridHeaderLabels"></asp:Label>&nbsp;
                    <asp:ImageButton ID="c_ibtnAdd"CssClass="headerButtons"runat="server"ImageUrl="~/Images/addDocBtn.png"
                        CommandName="InitInsert1"ImageAlign="Middle"CausesValidation="false"></asp:ImageButton>
                    &nbsp;
                </div>
            </CommandItemTemplate>
            <Columns>
                <telerik:GridTemplateColumnSortAscImageUrl="~/App_Themes/Default/Grid/Skins/Vista/SortAsc.gif"
                    AllowFiltering="false"FilterImageUrl="~/App_Themes/Default/Grid/Skins/Vista/Filter.gif"
                    HeaderStyle-Width="30"UniqueName="UniqueID"SortDescImageUrl="~/App_Themes/Default/Grid/Skins/Vista/SortDesc.gif">
                    <ItemStyleHorizontalAlign="Center"VerticalAlign="Middle"Wrap="False"Width="30">
                    </ItemStyle>
                    <ItemTemplate>
                        <asp:ImageButton ID="c_ibtnActionMenu"runat="server"ImageUrl="~/Images/actionIcon.png"/>
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridEditCommandColumnUniqueName="EditCommandColumn"HeaderStyle-Width="30px"
                    ButtonType="ImageButton"EditImageUrl="~/Images/actionIcon.png"CancelImageUrl="~/App_Themes/Default/Grid/Skins/Vista/cancelIcon.png"
                    UpdateImageUrl="~/App_Themes/Default/Grid/Skins/Vista/updateIcon.png"InsertImageUrl="~/App_Themes/Default/Grid/Skins/Vista/updateIcon.png">
                </telerik:GridEditCommandColumn>
                <telerik:GridBoundColumn ReadOnly="True"SortAscImageUrl="~/App_Themes/Default/Grid/Skins/Vista/SortAsc.gif"
                    DataField="UniqueID"FilterImageUrl="~/App_Themes/Default/Grid/Skins/Vista/Filter.gif"
                   DataType="System.Int32"UniqueName="UniqueID"SortDescImageUrl="~/App_Themes/Default/Grid/Skins/Vista/SortDesc.gif"
                    HeaderText="UniqueID"Display="false"Visible="false">
                </telerik:GridBoundColumn>
                <telerik:GridTemplateColumnUniqueName="IndustryCodeDescription"HeaderText="Master Classification Code">
                    <ItemStyleHorizontalAlign="Left"VerticalAlign="Bottom"Wrap="True"></ItemStyle>
                    <ItemTemplate>
                        <%--<%#DataBinder.Eval(Container.DataItem, "IndustryCodeDescription")%>--%>
                        <img alt="Primary"src="~/images/TransparentdashSaveIcon.png"runat="server"id="imgPrimary"
                            style="border: 0px; padding: 0 5px 0 5px;"visible="false"/>
                        <asp:Literal ID="ltlIndustryCode"runat="server"Text='<%# DataBinder.Eval( Container, "DataItem.IndustryCodeDescription") %>' />
                    </ItemTemplate>
                    <EditItemTemplate>
                        <telerik:RadComboBox DataTextField="Description"DataValueField="IndustryCodeID"
                            ID="c_dgvrcbIndustryCodes"runat="server"Width="400px"EnableScreenBoundaryDetection="false"
                            Filter="Contains"MarkFirstMatch="false"ExpandDirection="Down"EmptyMessage="--Select One--"
                            CssClass="inputRequired"EnableTextSelection="true"EnableItemCaching="true"
                            EnableLoadOnDemand="true">
                        </telerik:RadComboBox>
                        <br />
                        <asp:RequiredFieldValidatorID="rfvrcbIndustryCode"runat="server"ControlToValidate="c_dgvrcbIndustryCodes"
                            ErrorMessage="Please Select Master Classification Code" ForeColor="red" Display="Dynamic"
                            SetFocusOnError="True"></asp:RequiredFieldValidator>
                    </EditItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridBoundColumn DataField="IndustryCodeID"DataType="System.Int32"UniqueName="IndustryCodeID"
                    HeaderText="IndustryCodeID"Display="false"Visible="false">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="IsPrimary"DataType="System.Int32"UniqueName="IsPrimary"
                    HeaderText="IsPrimary"Display="false"Visible="false">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="EntityID"DataType="System.Int32"UniqueName="EntityID"
                    HeaderText="EntityID"Display="false"Visible="false">
                </telerik:GridBoundColumn>
            </Columns>
            <PagerTemplate>
                <asp:Panel ID="c_pnlPager"Style="padding: 1px;" runat="server"HorizontalAlign="Center">
                    <p style="margin: 0px; padding: 0px;">
                        <asp:ImageButton ID="c_ibtnPagingFirst"ImageUrl="~/App_Themes/Default/Grid/Skins/Vista/img/PagingFirst.gif"
                            runat="server"OnClick="c_ibtnPagingFirst_click"ImageAlign="Middle"CommandName="Page"
                            CommandArgument="First"/>
                        <asp:ImageButton ID="c_ibtnPagingPrev" ImageUrl="~/App_Themes/Default/Grid/Skins/Vista/img/PagingPrev.gif"
                            runat="server"OnClick="c_ibtnPagingPrev_click"ImageAlign="Middle"CommandName="Page"
                            CommandArgument="Prev" />
                        <span style="vertical-align: middle;">Page:</span> <span style="vertical-align: middle;">
                            <%# CType(DataBinder.Eval(Container, "Paging.CurrentPageIndex"), Int32) + 1 %>&nbsp;</span>
                        <span style="vertical-align: middle;">of
                            <%# DataBinder.Eval(Container, "Paging.PageCount")%>
                        </span>
                        <asp:ImageButton ID="c_ibtnPagingNext_click"ImageUrl="~/App_Themes/Default/Grid/Skins/Vista/img/PagingNext.gif"
                            runat="server"OnClick="c_ibtnPagingNext_click"ImageAlign="Middle"CommandName="Page"
                            CommandArgument="Next"/>
                        <asp:ImageButton ID="c_ibtnPagingLast" ImageUrl="~/App_Themes/Default/Grid/Skins/Vista/img/PagingLast.gif"
                            runat="server"OnClick="c_ibtnPagingLast_Click"ImageAlign="Middle"CommandName="Page"
                            CommandArgument="Last"/>
                    </p>
                </asp:Panel>
            </PagerTemplate>
        </MasterTableView>
    </telerik:RadGrid>

Eyup
Telerik team
 answered on 14 Aug 2015
3 answers
365 views

Hi,

In my aspx, I have tried setting 'AllowedFileExtensions='.xls,.xlsx' and <FileFilters><FileFilter Exntensions='xls,xlsx'> but neither seem to have any effect - please advise.

Dimitar
Telerik team
 answered on 14 Aug 2015
2 answers
150 views

 It will still run but when I throw the exceptions i get this when I click insert new item:

System.ArgumentNullException occurred
  _HResult=-2147467261
  _message=Value cannot be null.
  HResult=-2147467261
  IsTransient=false
  Message=Value cannot be null.
Parameter name: value
  Source=mscorlib
  ParamName=value
  StackTrace:
       at System.Enum.EnumResult.SetFailure(ParseFailureKind failure, String failureParameter)
  InnerException: 

Eyup
Telerik team
 answered on 14 Aug 2015
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?