Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
243 views
Hi,

I have been using IE 10.0.9200.17148.
The horizontal alignment problem occurs in IE while using RadNumericTextBox.
(In Chrome it works fine.)

I've created a script as follows.

aspx
<telerik:RadAjaxPanel ID="RadAjaxPanel2" runat="server" Height="100%" Width="100%" HorizontalAlign="NotSet" LoadingPanelID="baseLoadingPanel" OnAjaxRequest="RadAjaxPanel2_AjaxRequest">
    <asp:FormView ID="detailsView" runat="server" OnDataBound="detailsView_DataBound">
         <telerik:RadNumericTextBox ID="sphR" runat="server" Width="100%" DbValue='<%# Eval("sphR") %>' Number="0" ReadOnly="True">
         </telerik:RadNumericTextBox>
    </asp:FormView>
</telerik:RadAjaxPanel>

cs
protected void detailsView_DataBound(object sender, EventArgs e)
{
    FormView item = (FormView)sender;
 
    RadNumericTextBox c = ((RadNumericTextBox)item.FindControl("sphR"));
    c.Style.Add("text-align", "right");
    c.EnabledStyle.HorizontalAlign = HorizontalAlign.Right;
 }

It works when the first page is open, but it doesn't work with later DataBind.
Please detail symptoms with reference to the attached avi file.
(Here is not able to attach a zip file, it has changed the extension to gif.)

Thanks,
Yoongu
Yoongu
Top achievements
Rank 1
 answered on 03 Dec 2014
3 answers
397 views
I'm getting an exception System.ArgumentOutOfRangeException thrown in the ItemDataBound callback of a RadComboBox that is in a GridDropDownColumn; breaking on editableItem.GetDataKeyValue() after inserting an item.  Can someone explain what is going on and what I'm need to do to correct it?

I have a grid that is bound via OnNeedDataSource to a table. A second table is bound (in code) to a column, though disabling it still shows the problem.  Ultimately I'm trying to select the customer in the combo box to the current item, but if there isn't a customer then to select the first "No Customer" item.

<telerik:RadGrid runat="server" ID="Test_RadGrid" AutoGenerateColumns="false" AllowPaging="true"
    OnNeedDataSource="RadGrid_NeedDataSource" OnUpdateCommand="RadGrid_UpdateCommand"
    OnItemCreated="RadGrid_ItemCreated" OnDeleteCommand="RadGrid_DeleteCommand"
    OnInsertCommand="RadGrid_InsertCommand" OnItemDataBound="RadGrid_ItemDataBound">
    <MasterTableView DataKeyNames="ID" CommandItemDisplay="Top" InsertItemPageIndexAction="ShowItemOnCurrentPage" EditMode="InPlace">
        <Columns>
            <telerik:GridEditCommandColumn ButtonType="ImageButton" />
            <telerik:GridBoundColumn DataField="ID" HeaderText="ID" ReadOnly="true" ForceExtractValue="Always" ConvertEmptyStringToNull="true" />
            <telerik:GridBoundColumn DataField="Name" HeaderText="Name" />
            <telerik:GridDropDownColumn UniqueName="CustomerCombo" HeaderText="Customer" DropDownControlType="RadComboBox" />
        </Columns>
    </MasterTableView>
</telerik:RadGrid>

protected void RadGrid_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
{
    Test_RadGrid.DataSource = DataSource(); // linq to sql join statement
}

protected void RadGrid_ItemDataBound(object source, GridItemEventArgs e)
{
    if (e.Item is GridEditableItem && e.Item.IsInEditMode)
    {
        GridEditableItem editableItem = e.Item as GridEditableItem;
 
        // ^---- At this point editableItem.KeyValues, in Watch window, says KeyValues threw an exception
        // of type System.ArgumentOutOfRangeException, but doesn't break
 
        GridEditManager editManager = editableItem.EditManager as GridEditManager;
        GridDropDownListColumnEditor editor = editManager.GetColumnEditor("CustomerCombo") as GridDropDownListColumnEditor;
 
        //editor.DataSource = Customer.DataSource();
        //editor.DataValueField = TestField.ID;
        //editor.DataTextField = TestField.Name;
        //editor.DataBind();
 
        RadComboBox combo = editableItem[TestField.CustomerCombo].Controls[0] as RadComboBox;
        combo.AppendDataBoundItems = true;
        combo.Items.Insert(0, new RadComboBoxItem("No customer selected", "0"));
 
        var ret = (int)editableItem.GetDataKeyValue("0"); //  <-- OutOfRangeException thown, debugger
    }



Peter
Top achievements
Rank 1
 answered on 02 Dec 2014
1 answer
300 views
Hi,

I have a complicated page but I created a simple ASP.NET page with the issue. I have telerik RadAsyncUpload control and a button inside an UpdatePanel as shown:
<asp:UpdatePanel ID="_updatePanel" runat="server" UpdateMode="Conditional">
<ContentTemplate>
    ...
<telerik:RadAsyncUpload ID="fileUpload" runat="server" MaxFileInputsCount="1"  OnClientFilesSelected="fileUpload_ClientFilesSelected" /><br />        
    
<asp:Button ID="_saveNewFileButton" runat="server" OnClick="_saveNewFileButton_Click"<br>    Text="Save"/>
 
</ContentTemplate>
</asp:UpdatePanel>

When a file is selected I want to disable the _saveNewFileButton and change the text to "Please Wait for Attachment Upload..." but I can't seem to get hold of the button reference in javascript:

var FilesUpdateInterval = null;
 //Handles client side FilesSelected event for _newFileUploadButton.
 function fileUpload_ClientFilesSelected(sender, args) {
    //disable the click event for submit button during upload<
     var submitButton = $find('<%= _saveNewFileButton.ClientID %>');
     submitButton.set_text('Please Wait for Attachment Upload...');
     submitButton.set_readOnly(true);
     if (FilesUpdateInterval == null) {
         FilesUpdateInterval = setInterval(function () { FileCheckForUploadCompletion(); }, 500);
     }
 }


I am getting submitButton is null error. I tried putting this javascript code outside the updatepanel and inside ContentTemplate with same result. Obviously whatever I am doing is wrong. How do I get hold of the control that is in updatepanel in javascript? I appreciate any help.

Thanks,
Dana
Marin Bratanov
Telerik team
 answered on 02 Dec 2014
15 answers
802 views

All,

Below is the code for my rad grid, and I want to get the selected item value of the rad combo box "not text" in gridbatchedit command.

 command.NewValues["Description"]   --want to text the selected item value, instead of text

protected void rgReleaseSchedule_Prerender(object sender, EventArgs e)

{

{

SavedChangesList.ForeColor = System.Drawing.Color.Red;

RadComboBox ddlDesc = rgReleaseSchedule.FindControl(rgReleaseSchedule.MasterTableView.ClientID + "_Description").FindControl("rdDescription") as RadComboBox;

var description = IoC.Current.Resolve<IReleaseService>().ReleaseListScheduleTitle();

ddlDesc.DataSource = description;

ddlDesc.DataTextField = "Description";

ddlDesc.DataValueField = "TitleID";

ddlDesc.DataBind();

}

}

protected void rgReleaseSchedule_BatchEditCommand(object sender, Telerik.Web.UI.GridBatchEditingEventArgs e)

{

try

{

SavedChangesList.Items.Clear();

SavedChangesList.ForeColor = System.Drawing.Color.Red;

foreach (GridBatchEditingCommand command in e.Commands)

{

Hashtable newvalues= command.NewValues;

if (command.Type == GridBatchEditingCommandType.Update)

{

if (command.NewValues["Date"].ToString() != "" && command.NewValues["Time"].ToString() != "" && command.NewValues["Description"].ToString() != "")

{

Int32 result = IoC.Current.Resolve<IReleaseService>().ReleaseListUpdate((Int32)command.Item.OwnerTableView.DataKeyValues[command.Item.ItemIndex]["ID"],

(DateTime)command.NewValues["Date"], command.NewValues["Time"].ToString(), command.NewValues["Description"]);

}

 

Sreekanth
Top achievements
Rank 1
 answered on 02 Dec 2014
1 answer
80 views
Hi,

I'm using Telerik RadControls for ASP.NET Ajax v2012.3.1308.35 and the RadFilterQueryProvider.ProcessGroupInternal(RadFilterGroupExpression group
) works well.

But when I upgrade to use Telerik UI for ASP.NET AJAX v2014.2.724.45, the function does not work, although no error/exception found.

I don't know if I miss something here. Please help to verify my problem
Pavlina
Telerik team
 answered on 02 Dec 2014
3 answers
204 views
Should the sample code at:

http://www.telerik.com/help/aspnet-ajax/page-layout-responsive-design-overview.html 

be specifying gridtype="Fixed" instead of gridtype="Fluid" ?
Boyan Dimitrov
Telerik team
 answered on 02 Dec 2014
1 answer
228 views
Hello,
I'm using C# with VS 2010 Ultimate
The RadMenu OnItemClick event does not fire on the sub menu items. (it does fire on the main/top menu.
How can I get the sub menu's to trigger/fire the OnItemClick Event as well?

aspx code for menu:
<telerik:RadMenu ID="RadMenu1" runat="server" OnItemClick="RadMenu1_ItemClick"></telerik:RadMenu>

C# code:
    private void BuildMenu_CreateDocuments()
    {
        RadMenu1.Items.Add(new RadMenuItem("Logout"));
        RadMenu1.Items.Add(new RadMenuItem("Setting"));
        RadMenu1.Items.Add(new RadMenuItem("Document"));

        List<Model.Common.PartnerDocument> lstPartnerDocuments = new BL.PartnerDocumentBL().GetPartnerDocuments(m_intCustomerID, m_intPartnerID, m_bAdmin);

        if (lstPartnerDocuments.Count > 0)
        {
            for (int i = 0; i < lstPartnerDocuments.Count; i++)
            {
                RadMenu1.Items[ID_MENU_DOCUMENT].Items.Add(new RadMenuItem("Create " + lstPartnerDocuments[i].DocumentName, lstPartnerDocuments[i].PageUrl));
            }
        }
    }


Plamen
Telerik team
 answered on 02 Dec 2014
3 answers
126 views
Hi,

I am looking for a control which allows to display/preview and play files for all formate (Images, PDFs, MS Word, Video, Flash).

Thanks,
Nitin
Vessy
Telerik team
 answered on 02 Dec 2014
1 answer
141 views
Hi,

I've see an issue in my grid since I've made the last update with the telerik control panel. I don't know if it is due to the update or a change in my code. 
I have this grid :

<telerik:RadGrid ID="TrainingPlanRadGrid" runat="server" Width="100%"
   AutoGenerateColumns="false" AllowPaging="true" PageSize="13"
   ShowHeader="true" ShowFooter="false" ShowGroupPanel="false"
   ShowStatusBar="false"             
   OnNeedDataSource="TrainingPlanRadGrid_NeedDataSource"  
   OnItemDataBound="TrainingPlanRadGrid_ItemDataBound"
   AllowMultiRowSelection="true" AllowAutomaticInserts="false"
   AllowAutomaticDeletes="false"
   AllowAutomaticUpdates="false" AllowSorting="true"
   AllowFilteringByColumn="false"
   BorderStyle="None" Style="overflow: auto;"
   HeaderStyle-Font-Bold="true">
      <MasterTableView TableLayout="Fixed" Width="100%" ClientDataKeyNames="ID">
         <Columns>
            <telerik:GridTemplateColumn UniqueName="CheckBoxTemplateColumn" Display="true">
               <ItemTemplate>
                  <asp:CheckBox ID="CheckBox1" runat="server"
                     OnCheckedChanged="ToggleRowSelection"
                     AutoPostBack="True" />
               </ItemTemplate>
               <HeaderTemplate>
                  <asp:CheckBox ID="headerChkbox" runat="server" 
                     OnCheckedChanged="ToggleSelectedStatePage" AutoPostBack="True" />
               </HeaderTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridBoundColumn UniqueName="RequestId" HeaderText=""
               DataField="ID" Visible="false" />
            <telerik:GridDateTimeColumn UniqueName="RequestDate" HeaderText="RequestDate"
               DataField="REQUEST_DATE" HeaderStyle-Wrap="false" HeaderStyle-Width="12%"
               HeaderStyle-HorizontalAlign="Right" ItemStyle-Width="12%"
               ItemStyle-HorizontalAlign="Right" />
            <telerik:GridBoundColumn UniqueName="RequestUser" DataField="USER_NAME"
               HeaderText="RequestUser" HeaderStyle-Wrap="false" HeaderStyle-Width="15%"
               ItemStyle-Width="15%" />
            <telerik:GridBoundColumn UniqueName="RequestUserOrg" DataField="ORG_LABEL"
               HeaderText="RequestUserOrg" HeaderStyle-Wrap="false" HeaderStyle-Width="15%"
               ItemStyle-Width="15%" />
            <telerik:GridBoundColumn UniqueName="RequestAdmin" DataField="ADMIN_NAME"
               HeaderText="RequestAdmin" HeaderStyle-Wrap="false" HeaderStyle-Width="15%"
               ItemStyle-Width="15%" />
            <telerik:GridBoundColumn UniqueName="RequestCourse" DataField="COURSE_NAME"
               HeaderText="RequestCourse" HeaderStyle-Wrap="false" HeaderStyle-Width="25%"
               ItemStyle-Width="25%" />
            <telerik:GridTemplateColumn UniqueName="RequestStatus" HeaderText="RequestStatus"
               HeaderStyle-Wrap="false" HeaderStyle-Width="12%" ItemStyle-Width="12%"
               ItemStyle-Wrap="false">
               <ItemTemplate>
                  <%# GetRequestStatus(Eval("REQUEST_STATUS").ToString())%>
               </ItemTemplate>
            </telerik:GridTemplateColumn>
         </Columns>
         <PagerStyle AlwaysVisible="false" Mode="NumericPages" />
      </MasterTableView>
      <HeaderStyle Font-Bold="true" />
      <ClientSettings Selecting-AllowRowSelect="true">
         <ClientEvents OnRowDblClick="editTrainingPlan"  />
      </ClientSettings>
</telerik:RadGrid>


This is the function selecting programmatically the row (on checkbox click) :

protected void ToggleRowSelection(object sender, EventArgs e)
        {
            GridItem item = ((sender as CheckBox).NamingContainer as GridItem);
            item.Selected = (sender as CheckBox).Checked;
            ...
        }

There is no exception thrown during the C# method.
But now, when I call this in js :

var grid = $find("TrainingPlanRadGrid");
var gridSelectedItems = grid.get_selectedItems();

I get an array with one "null" entry for each item I have selected in my C# code. And if I select a row by clicking on I get an entry containing a [Telerik.Web.UI.GridDataItem].

I can't use the auto-generated select checkbox column because I have extra features to add but I need to access in js and in C# to selected columns.

Do you see where I am doing something wrong ?
Eyup
Telerik team
 answered on 02 Dec 2014
2 answers
161 views
Hi,
I have a master page that contains a radSkinManager (that display a skin chooser). All child pages that contain rad controls seem to inherit the skins just fine but the background of my page style with default style - I assume that all controls must be inside some rad container to get styled properly?
Al
Top achievements
Rank 1
Iron
Iron
Iron
 answered on 02 Dec 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?