Telerik Forums
UI for ASP.NET AJAX Forum
6 answers
277 views
Hi,

I  have "GridButtonColumn" ( image button ) on my RadGrid. When ever i pressing the enter key, its automatically calling the  itemCommandEvent. 

In my requirement, user needs to click the image button manually to proceed further. ( ie. Not by enter key click )

Please let me know, how to avoid the ItemCommandEvent when user clicking enter key.


Thanks in advance.
Sanjey
Top achievements
Rank 2
 answered on 10 Feb 2016
1 answer
147 views

Hi,

I have a radgrid in batch edit mode. My grid cells cells make use of column editors and the whole grid is ajaxified

The problem is if a user edits a cell and then clicks the save button (without clicking anywhere else first) the cell is still in edit mode and the save has nothing to save.

Shouldn't clicking the save button cause the currently edited cell to loss focus and come out of edit when clicking on the save button?

Viktor Tachev
Telerik team
 answered on 10 Feb 2016
1 answer
586 views

Hello Support,

I tried searching forums regarding the itemdatabound event being fired twice for a radgrid. But no solutions proved conclusive. So I have created an example project  with a single page.

1 RadScriptManager
1 SQLDataSource
1 RadGrid (Telerik v 2015.2.826.45)

SQLDatasource connecting to a table with 5 rows

id desc percent
1   A   10
2   B   20
3   C   30
4   D   40
5   E   50

ItemDataBound was seen to fire 12 times twice for each row. (+1 for header and +1 for footer)  

Please explain how can I restrict this to fire once for each row.

Code for .vb , .aspx are included. The example project is also attached along with screenshots for runtime and database.

.vb

Imports Telerik.Web.UI
 
Public Class _default
    Inherits System.Web.UI.Page
 
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Session("ctr") = 0
    End Sub
 
    Private Sub RadGrid1_ItemDataBound(sender As Object, e As GridItemEventArgs) Handles RadGrid1.ItemDataBound
        Session("ctr") += 1
        Debug.WriteLine("ItemDataBound: " & Session("ctr"))
    End Sub
 
End Class

 

 .aspx

<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="default.aspx.vb" Inherits="RadGrid_ItemDatabound._default" %>
 
<%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %>
 
<!DOCTYPE html>
 
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
     
        <telerik:RadScriptManager ID="RadScriptManager1" Runat="server">
        </telerik:RadScriptManager>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:MySQLConnectionString %>" ProviderName="<%$ ConnectionStrings:MySQLConnectionString.ProviderName %>" SelectCommand="Select * from temp"></asp:SqlDataSource>
        <telerik:RadGrid ID="RadGrid1" runat="server" CellSpacing="-1" DataSourceID="SqlDataSource1" GridLines="Both" GroupPanelPosition="Top">
            <MasterTableView AutoGenerateColumns="False" DataSourceID="SqlDataSource1">
                <Columns>
                    <telerik:GridBoundColumn DataField="id" DataType="System.Int32" FilterControlAltText="Filter id column" HeaderText="id" SortExpression="id" UniqueName="id">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="desc" FilterControlAltText="Filter desc column" HeaderText="desc" SortExpression="desc" UniqueName="desc">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="percent" DataType="System.Int32" FilterControlAltText="Filter percent column" HeaderText="percent" SortExpression="percent" UniqueName="percent">
                    </telerik:GridBoundColumn>
                </Columns>
            </MasterTableView>
        </telerik:RadGrid>
    </div>
    </form>
</body>
</html>

 

Debug Output:

ItemDataBound: 1
ItemDataBound: 2
ItemDataBound: 3
ItemDataBound: 4
ItemDataBound: 5
ItemDataBound: 6
ItemDataBound: 7
ItemDataBound: 8
ItemDataBound: 9
ItemDataBound: 10
ItemDataBound: 11
ItemDataBound: 12

 

 

Viktor Tachev
Telerik team
 answered on 10 Feb 2016
3 answers
223 views

I am having trouble trying to implement an ajaxified cascading DropDownList inside a ListView using the RadAjaxManager.  I have tried following the example here, but it doesn't seem to work with a ListView.  The page doesn't post back when the first DropDownList changes and the SelectedIndexChanged event never fires.  Below is some sample code.  Any idea what I'm doing wrong?

<asp:ScriptManager runat="server" ID="ScriptManager1"></asp:ScriptManager>
<telerik:RadAjaxManager runat="server" ID="am1">
</telerik:RadAjaxManager>
<asp:ListView runat="server" ID="ListView1" InsertItemPosition="FirstItem" SelectMethod="ListView1_GetData" OnItemCreated="ListView1_ItemCreated">
    <LayoutTemplate>
        <asp:PlaceHolder runat="server" ID="itemPlaceHolder"></asp:PlaceHolder>
    </LayoutTemplate>
    <InsertItemTemplate>
        <asp:DropDownList runat="server" ID="DropDownList1" AutoPostBack="true" OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged">
            <asp:ListItem Text="" Value=""></asp:ListItem>
            <asp:ListItem Text="1" Value="1"></asp:ListItem>
            <asp:ListItem Text="2" Value="2"></asp:ListItem>
            <asp:ListItem Text="3" Value="3"></asp:ListItem>
        </asp:DropDownList>
        <asp:DropDownList runat="server" ID="DropDownList2" OnDataBinding="DropDownList2_DataBinding"></asp:DropDownList>
    </InsertItemTemplate>
</asp:ListView>

protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{
    ((DropDownList)ListView1.InsertItem.FindControl("DropDownList2")).DataBind();
}
public IQueryable ListView1_GetData()
{
    return null;
}
 
protected void DropDownList2_DataBinding(object sender, EventArgs e)
{
    ((DropDownList)sender).Items.Clear();
    if (((DropDownList)ListView1.InsertItem.FindControl("DropDownList1")).SelectedValue != "")
    {
        ((DropDownList)sender).Items.Add(((DropDownList)ListView1.InsertItem.FindControl("DropDownList1")).SelectedValue);
        ((DropDownList)sender).Items.Add(((DropDownList)ListView1.InsertItem.FindControl("DropDownList1")).SelectedValue);
    }
}
 
protected void ListView1_ItemCreated(object sender, ListViewItemEventArgs e)
{
    if (e.Item.ItemType == ListViewItemType.InsertItem)
        e.Item.PreRender += new System.EventHandler(ListView1_ItemPreRender);
 
}
 
protected void ListView1_ItemPreRender(object sender, System.EventArgs e)
{
    am1.AjaxSettings.AddAjaxSetting(((DropDownList)(((Control)(sender)).FindControl("DropDownList1"))), ((DropDownList)(((Control)(sender)).FindControl("DropDownList2"))));
}

Eyup
Telerik team
 answered on 10 Feb 2016
5 answers
148 views
HI All,

I'm trying to dynamically add a Rotator Control from code behind, but can't figure out how to get the ItemTemplate in there. I saw this thread (http://www.telerik.com/forums/how-do-i-add-items-to-a-rotator-programmatically), but that has references to some declarative code.

Is there some sample code for adding a Rotator control "completely" from code behind available somewhere?

Thx in advance!
M.
Bhavya
Top achievements
Rank 1
 answered on 10 Feb 2016
1 answer
313 views

Hi,

  Like radcombobox there is no event LoadOnDemand in raddropdowntree.

Can any one suggest me how to do load on demand in raddropdown on server side.

Ivan Danchev
Telerik team
 answered on 10 Feb 2016
2 answers
382 views

Good morning,

I have a scenario where I'm creating a RadWizard control dynamically. I'm looping through an object to set up the wizard steps, and then on WizardStepCreated, I'm adding all the controls to the step. The RadWizard's RenderedSteps="All"

When the page is first rendered, everything works fine. The step Title is populated, the validation groups work fine. The issue I'm having is when I add an ActiveStepChanged method in order to save the data on each step change, I lose my step properties (.Title, .ValidationGroup, etc).

(See photos attached)

My code is below. Thank you for your help!

Chris

ContentPage:

<%@ Page Title="Application Rendering Engine" Language="vb" AutoEventWireup="false" MasterPageFile="~/Application.Master" CodeBehind="ApplicationForm.aspx.vb" Inherits="Public_Portal.ApplicationForm" %>
 
<%@ MasterType VirtualPath="~/Application.Master" %>
 
 
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
 
    <telerik:RadAjaxManagerProxy runat="server" ID="ajaxProxy">
        <AjaxSettings>
        </AjaxSettings>
    </telerik:RadAjaxManagerProxy>
 
 
    <!-- Inside Page Body Content -->
    <div class="container">
        <div class="row">
            <div class="col-sm-12 col-md-12 col-lg-12 col-xs-12">
 
                <!-- Breadcrumbs -->
                <ul class="ApplicationFormBreadcrumb">
                    <li>
                        <asp:HyperLink ID="hlBreadcrumb_Home" runat="server" Text="Home" NavigateUrl="~/Default.aspx" />
                    </li>
                    <li>
                        <asp:HyperLink ID="hlBreadcrumb_Dashboard" runat="server" Text="Dashboard" NavigateUrl="~/Dashboard.aspx" />
                    </li>
                    <li class="active">
                        <asp:HyperLink ID="hlBreadcrumb_MyApplication" runat="server" Text="My Application" NavigateUrl="#" />
                    </li>
                </ul>
 
            </div>
        </div>
        <div class="row">
            <!-- Inside Content Right Side Main -->
            <div class="col-sm-12 col-md-12 col-lg-12 col-xs-12">
                <div class="tab-content">
 
                    <telerik:RadWizard runat="server" ID="wizMyApplication"
                        Skin="MetroTouch"
                        RenderedSteps="All"
                        DisplayCancelButton="true"
                        DisplayNavigationBar="true"
                        DisplayProgressBar="true"
                        Width="100%"
                        DisplayNavigationButtons="true"
                        NavigationButtonsPosition="Bottom"
                        ProgressBarPosition="left"
                        NavigationBarPosition="left">
                    </telerik:RadWizard>
 
                </div>
            </div>
        </div>
    </div>
 
 
</asp:Content>
 

ContentPage code-behind:

 

Imports System.IO
Imports Telerik.Web.UI
Imports Portal_BusinessObjects
Public Class ApplicationForm
    Inherits clsPage
 
 
#Region "Page Events"
 
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Dim objApplication As New clsApplication()
 
        If Not Page.IsPostBack Then
 
            If Application_ID > 0 Then
                objApplication = New clsApplication(Application_ID, Application_Mode)
            Else
                objApplication = New clsApplication(Application_ID, Application_Mode, Form_Version_ID, Application_EligibleProgram)
            End If
 
            MyApplication = objApplication
 
            '***********************************
            '   BUILD WIZARD STEPS
            '***********************************
            Dim i As Integer = 0
            For Each formStep As clsFormStep In objApplication.Application_Form.Form_Steps
 
                Dim [wizStep] As New RadWizardStep()
                Dim strTitle As String = String.Empty
                Dim strTooltip As String = String.Empty
 
                If i = 0 Then
                    [wizStep].DisplayCancelButton = False
                End If
 
                If clsGlobal.CurrentLang = clsGlobal.AvailableLanguages.en Then
                    strTitle = formStep.E_Name
                    strTooltip = formStep.E_Desc
                Else
                    strTitle = formStep.F_Name
                    strTooltip = formStep.F_Desc
                End If
 
                [wizStep].Title = strTitle
                [wizStep].ID = "step_" & formStep.Form_Step_ID
                [wizStep].ValidationGroup = "valGroup_" & wizStep.ID
                wizMyApplication.WizardSteps.Add([wizStep])
 
                i = i + 1
            Next
 
        End If
 
    End Sub
 
#End Region
 
#Region "Page Control Events"
 
 
 
    '*************************************************************
    '
    '          RENDERING CONTROLS ON WIZARD STEP
    '
    '*************************************************************
    Private Sub wizMyApplication_WizardStepCreated(sender As Object, e As WizardStepCreatedEventArgs) Handles wizMyApplication.WizardStepCreated
        Dim strStepPrefix As String = e.RadWizardStep.ID
        Dim strValidationGroup As String = "valGroup_" & strStepPrefix
        Dim intFormStepID As Integer = CInt(strStepPrefix.Replace("step_", ""))
 
        'Add Step Validation group
        Dim valSummary As New ValidationSummary
        valSummary.ID = "valSum_" & strStepPrefix
 
        Call ConfigureValidationSummary(valSummary, strValidationGroup)
        e.RadWizardStep.Controls.Add(valSummary)
 
        Dim objStep As clsFormStep = MyApplication.Application_Form.Form_Steps.Find(Function(x) x.Form_Step_ID = intFormStepID)
 
        'Loop through all fields in the Form_Step
        For Each field In objStep.Form_Fields
 
            Select Case field.Control_Type_Code
 
                Case clsFormStepDetail.ControlTypes.Textbox
 
                    Dim txtStandard As ucTextbox = LoadControl("~/Control_Library/Standard_Controls/ucTextbox.ascx")
                    Dim objTexbox As New clsTextbox()
                    With objTexbox
 
                        'Set textbox properties
                        .Textbox_Configuration = objTexbox
                        .Validation_Group = strValidationGroup
 
                    End With
 
                    e.RadWizardStep.Controls.Add(txtStandard)
 
                Case clsFormStepDetail.ControlTypes.Checkbox
 
                    Dim chkCheckbox As ucCheckbox = LoadControl("~/Control_Library/Standard_Controls/ucCheckbox.ascx")
                    With chkCheckbox
 
                        'Set checkbox properties
                        .Configure_Validation_Required_Field_Ind = field.Validation_Required_Field_Ind
                        .Validation_Group = strValidationGroup
                    End With
 
                    e.RadWizardStep.Controls.Add(chkCheckbox)
 
                Case clsFormStepDetail.ControlTypes.Dropdown
 
                    Dim ddCodeTable As ucDropdownList = LoadControl("~/Control_Library/Standard_Controls/ucDropdownList.ascx")
                    With ddCodeTable
 
            'Set dropdown properties
                        .Configure_Validation_Required_Field_Ind = field.Validation_Required_Field_Ind
                        .Validation_Group = strValidationGroup
                    End With
 
                    e.RadWizardStep.Controls.Add(ddCodeTable)
 
 
            End Select
 
 
        Next
 
 
 
    End Sub
 
 
    '*************************************************************
    '
    '           FINISH BUTTON - SAVE CODE GOES HERE
    '
    '*************************************************************
    Private Sub wizMyApplication_FinishButtonClick(sender As Object, e As WizardEventArgs) Handles wizMyApplication.FinishButtonClick
 
    Call SaveApplicationForm()
 
        Response.Redirect("~/Dashboard.aspx?msg=applicationSubmitted")
 
    End Sub
 
 
 
    Private Sub wizMyApplication_ActiveStepChanged(sender As Object, e As EventArgs) Handles wizMyApplication.ActiveStepChanged
 
    Call SaveApplicationForm()
 
    End Sub
 
 
#End Region
 
 
#Region "Functions and Sub-routines"
 
    Private Sub ConfigureValidationSummary(ByVal valSum As ValidationSummary, ByVal strValGroup As String)
 
        With valSum
            .DisplayMode = ValidationSummaryDisplayMode.BulletList
            .ShowMessageBox = False
            .ValidationGroup = strValGroup
            .ShowSummary = True
            .CssClass = "alert alert-danger"
 
        End With
 
    End Sub
 
     
    Private Sub SaveApplicationForm()
         
    'Save form values to database here
 
    End Sub
 
#End Region
 
 
 
End Class

 

 

Ken
Top achievements
Rank 1
 answered on 10 Feb 2016
3 answers
201 views

When adding a RadButton with an icon to a RadSlidingPane it messes up the formatting of the button and places the text under the icon.

This is the button code:

<telerik:RadButton ID="RadButton2" runat="server" Text="Test" Width="125px" Skin="Default" RenderMode="Lightweight">
    <Icon PrimaryIconCssClass="rbAdd"></Icon>
</telerik:RadButton>

 When I view the generated source it is adding the following in-line styles to the button.

<span class="rbText rbPrimary" style="width: 100%; padding-right: 0px; padding-left: 4px;">Test</span>

If I take the same exact button and place it outside of the RadSlidingPane the inline styles are gone and the button looks normal.

See attached image for an example of how the button displays improperly.

 

 

 

 

Marin Bratanov
Telerik team
 answered on 10 Feb 2016
1 answer
129 views

Hi,

We are facing issue while deleting events from the GUI. We have GTM(Google Tag Manager) script loaded on the page and that GTM script is blocking the ajax request generated on clicking delete button. When we removed the GTM reference from the page, we were able to successfully delete events.

We also tried to replicate the same issue on telerik scheduler demo page (http://demos.telerik.com/aspnet-ajax/scheduler/examples/overview/defaultcs.aspx) which also have the GTM script, but GTM script is not blocking delete request on demo page. 

Could you please help us out in enabling delete functionality of events with GTM script loaded on the page.

 

Thanks

Dhiraj Kumar

 

Plamen
Telerik team
 answered on 10 Feb 2016
1 answer
133 views

Hi,
I'm trying to do a custom save when using the Advanced Form in the RadScheduler and I'm having a problem obtaining the modified values.  I'm able to drag and drop appointments from a grid but I cannot access the modified values in the Advanced Form.

What I'm experiencing is that the 'Form Created' method is called when initially opening an appointment and when the SAVE or the CANCEL buttons are clicked. Should this occur when the SAVE button is clicked? 

protected void RadScheduler1_FormCreated(object sender, Telerik.Web.UI.SchedulerFormCreatedEventArgs e)
{

RadTextBox txtDepartment = (RadTextBox)e.Container.Controls[1].FindControl("txtDepartment");
string deptText = e.Appointment.Attributes["txtDepartment"];

}

When the 'RadScheduler1_FormCreated' is called I am not able to get the modified Text Box values.  I can only access the values originally loaded into the Advanced Form.  Is there a configuration issue?  How do I access teh modified values?

Here is my code:

<telerik:RadScheduler ID="RadScheduler1" runat="server" Height="100%" MinutesPerRow="15" ReadOnly="false" RowHeight="23px" StartInsertingInAdvancedForm="true"
DataEndField="END_TIME" DataStartField="STARTDATE" DataDescriptionField="Description" DataSubjectField="AppointmentText" OnNavigationComplete="RadScheduler1_NavigationComplete"
DataKeyField="Build_AppointmentTypeId" EnableDatePicker="true" OnNavigationCommand="RadScheduler1_NavigationCommand"
OnAppointmentCreated="RadScheduler1_AppointmentCreated" OnAppointmentDataBound="RadScheduler1_AppointmentDataBound"
OnDataBound="RadScheduler1_DataBound" Skin="Metro" OnAppointmentCommand="RadScheduler1_AppointmentCommand"  EnableAdvancedForm="true" EnableDescriptionField="true"
OnAppointmentInsert="RadScheduler1_AppointmentInsert" OnAppointmentUpdate="RadScheduler1_AppointmentUpdate" OnFormCreated="RadScheduler1_FormCreated"
OverflowBehavior="Auto" OnClientFormCreated="OnClientFormCreated" OnAppointmentDelete="RadScheduler1_AppointmentDelete" Enabled="true"
CustomAttributeNames="Due, Priority, AppointmentColor, User, RecurrenceRule, Reminder, Room, TimeZoneID, Department, AppointmentType, Quantity, ServiceQuantity, LastModifiedBy, LastModifiedDate, CreatedDate, CreatedBy">

<TimeSlotContextMenuSettings EnableDefault="true"></TimeSlotContextMenuSettings>
<AppointmentContextMenuSettings EnableDefault="true"></AppointmentContextMenuSettings>

<AdvancedForm Modal="true"></AdvancedForm>
<Reminders Enabled="true" MaxAge="2" />

<AppointmentTemplate>

<div class="rsAptSubject">
<%# Container.Appointment.Subject %>
<p></p>
<%# Eval("Description") %>
<p></p>
<%# Eval("Department") %>
</div>

               

</AppointmentTemplate>
<AdvancedEditTemplate>
<scheduler:AdvancedForm ViewStateMode="Enabled"  runat="server" ID="AdvancedEditForm1" Mode="Edit" Subject='<%# Bind("Subject") %>' Department='<%# Bind("Department") %>' AppointmentType='<%# Bind("AppointmentType") %>'
Description='<%# Bind("Description") %>' Start='<%# Bind("Start") %>' End='<%# Bind("End") %>'
RecurrenceRuleText='<%# Bind("RecurrenceRule") %>' Reminder='<%# Bind("Reminder") %>'
AppointmentColor='<%# Bind("AppointmentColor") %>' UserID='<%# Bind("User") %>' Quantity='<%# Bind("Quantity") %>' ServiceQuantity='<%# Bind("ServiceQuantity") %>'
LastModifiedBy='<%# Bind("LastModifiedBy") %>' CreatedBy='<%# Bind("CreatedBy") %>'
LastModifiedDate='<%# Bind("LastModifiedDate") %>' CreatedDate='<%# Bind("CreatedDate") %>'
RoomID='<%# Bind("Room") %>' TimeZoneID='<%# Bind("TimeZoneID") %>' />
</AdvancedEditTemplate>

<AdvancedInsertTemplate>
<scheduler:AdvancedForm ViewStateMode="Enabled" runat="server" ID="AdvancedInsertForm1" Mode="Insert" Subject='<%# Bind("Subject") %>'
Department='<%# Bind("Department") %>' AppointmentType='<%# Bind("AppointmentType") %>' 
Start='<%# Bind("Start") %>' End='<%# Bind("End") %>' Description='<%# Bind("Description") %>'
RecurrenceRuleText='<%# Bind("RecurrenceRule") %>' Reminder='<%# Bind("Reminder") %>'
LastModifiedBy='<%# Bind("LastModifiedBy") %>' CreatedBy='<%# Bind("CreatedBy") %>'
LastModifiedDate='<%# Bind("LastModifiedDate") %>' CreatedDate='<%# Bind("CreatedDate") %>'
AppointmentColor='<%# Bind("AppointmentColor") %>' UserID='<%# Bind("User") %>' Quantity='<%# Bind("Quantity") %>' ServiceQuantity='<%# Bind("ServiceQuantity") %>'
RoomID='<%# Bind("Room") %>' TimeZoneID='<%# Bind("TimeZoneID") %>' />
</AdvancedInsertTemplate>

<TimelineView UserSelectable="false"  />

<TimeSlotContextMenuSettings EnableDefault="true"  />

<AppointmentContextMenuSettings EnableDefault="true" />
<ResourceTypes>

<telerik:ResourceType KeyField="ColorSequenceId" Name="ColorSequenceId" TextField="ColorSequenceId" ForeignKeyField="ColorSequenceId"></telerik:ResourceType>

</ResourceTypes>

</telerik:RadScheduler>

 

 

Thank you,
Jeff-

Plamen
Telerik team
 answered on 10 Feb 2016
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?