Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
130 views

The server side event not firing when page is ajaxed and onclientclick is added

The method GV1_update does not fire


Code:====================================================

 

 

<form id="form1" runat="server">

 

 

 

 

 

 

 

 

<asp:ScriptManager ID="ScriptManager" runat="server" />

 

 

<

 

telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" EnableAJAX= "true" EnableEmbeddedScripts="true" >

 

 

</

 

telerik:RadAjaxManager>

 

 

<

 

telerik:RadAjaxPanel ID="RadAjaxPanel" runat="server">

 

 

 

 

 

 

 

 

 

<asp:GridView ID="GV_EmpStatus" runat="server" AutoGenerateColumns="False" Width="264px">

 

 

 

 

 

 

 

 

<Columns>

 

 

 

 

 

 

 

 

<asp:TemplateField HeaderText="Code">

 

 

 

 

 

 

 

 

<ItemTemplate>

 

 

 

 

 

 

 

 

<asp:LinkButton ID="employmentStatusCode" Width="50px" runat="server" OnClick="Get_EmpStatusReason"

 

 

 

 

 

 

 

 

Text='<%#DataBinder.Eval(Container.DataItem, "employmentStatusCode")%>'>

 

 

 

 

 

 

 

 

</asp:LinkButton>

 

 

 

 

 

 

 

 

</ItemTemplate>

 

 

 

 

 

 

 

 

</asp:TemplateField>

 

 

 

 

 

 

 

 

<asp:TemplateField HeaderText="Description">

 

 

 

 

 

 

 

 

<ItemTemplate>

 

 

 

 

 

 

 

 

<asp:TextBox ID="employmentStatusDesc" BorderStyle="None" Width="170px" runat="server"

 

 

 

 

 

 

 

 

Text='<%#DataBinder.Eval(Container.DataItem, "employmentStatusDesc")%>'>

 

 

 

 

 

 

 

 

</asp:TextBox>

 

 

 

 

 

 

 

 

</ItemTemplate>

 

 

 

 

 

 

 

 

</asp:TemplateField>

 

 

 

 

 

 

 

 

<asp:TemplateField>

 

 

 

 

 

 

 

 

<ItemTemplate>

 

 

 

 

 

 

 

 

<asp:ImageButton ID="btnupdate1" runat="server" ImageUrl="../Image/pencil2.gif" OnClick="GV1_update"

 

 

 

 

 

 

 

 

ToolTip="Update" OnClientClick="if(!ValidateDesc(this,'btnupdate1','employmentStatusDesc')) {return false}else {return true};"/>

 

 

 

 

 

 

 

 

</ItemTemplate>

 

 

 

 

 

 

 

 

</asp:TemplateField>

 

 

 

 

 

 

 

 

</Columns>

 

 

 

 

 

 

 

 

<SelectedRowStyle BackColor="Transparent" Font-Bold="True" />

 

 

 

 

 

 

 

 

<HeaderStyle BackColor="#E0E0E0" />

 

 

 

 

 

 

 

 

</asp:GridView>

 

 

 

 

 

 

 

</

 

 

telerik:RadAjaxPanel>

 

 

 

 

 

 

 

 

 

</form>

 

mike
Top achievements
Rank 1
 answered on 01 Jun 2011
4 answers
670 views
Hello,

As I have to test some RadControls components for my company, I'm currently working on the TreeList control. Even if I only try to do basic stuff (populate the control with a database query) It doesn't work and I just can't figure out why !
My previous investigation lead me to think that issue is related to DataKeyNames and ParentDataKeyNames properties but I'm not sure.
So instead of talking about my work, I'll let you get an code snippet so as you can take a look at it :

<telerik:RadTreeList ID="RadTreeList1" runat="server"
        AllowMultiItemEdit="False" AllowPaging="True" Culture="(Default)"
        DataKeyNames="SousThemeID" ParentDataKeyNames="SousThemThemeID" AutoGenerateColumns="True" DataSourceID="SqlDataSource1" IsItemInserted="False">
 
<ValidationSettings CommandsToValidate="PerformInsert,Update"></ValidationSettings>
        <Columns>
            <telerik:TreeListBoundColumn UniqueName="column"></telerik:TreeListBoundColumn>
        </Columns>
<EditFormSettings EditFormType="AutoGenerated"></EditFormSettings>
</telerik:RadTreeList>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server"
        ConnectionString="<%$ ConnectionStrings:ContenuConnectionString %>"
        SelectCommand="SELECT [SousThemeID], [SousThemLibelle], [SousThemThemeID] FROM [SousTheme]">
    </asp:SqlDataSource>


Here's a little explanation concerning my query :

1. it works well so the problem doesn't come from here
2. SousThemeID : Integer, SousThemLibelle : String, SousThemThemeID : integer
3. SousTheme (which means under-theme or theme below) is related to Theme (Theme.ThemeID = SousTheme.SousThemThemeID).

Example  :

[ 1 ] [ "test" ] [ 1 ]
[ 2 ] [ "whatever you want" ] [ 1 ]
[ 3 ] [ "Computer" ] [ 1 ]
[ 4 ] [ "Economy" ] [ 2 ]
[ 5 ] [ "Finance" ] [ 2 ]


If you have any idea on what's going wrong in my code, please let me know.
Thanks in advance.


Alexandre.
alexandre
Top achievements
Rank 1
 answered on 01 Jun 2011
1 answer
87 views

I have 4 RadTextBoxes on my form.  I'm using txtComments.Text to get the text the user has entered.  However,  The text property is blank.  Is there something I'm missing?

ASPX:

 

 

 

<telerik:RadTextBox ID="txtDocumentReviewer" runat="server" MaxLength="1500" Skin="DMID" EnableEmbeddedSkins="False" Columns="50" Rows="5" TextMode="MultiLine" > </telerik:RadTextBox>

C#:

 

 

 

oProfile.DocumentReviewerComments = txtDocumentReviewer.Text;

 

Annette
Top achievements
Rank 1
 answered on 01 Jun 2011
1 answer
115 views
Hi,
 I have One Grid View when i click submit button whole grid values saved in database and showing one alert message. When Displaying Alert Message the gridview disappears in the background.
I m using below script to show Display message

ScriptManager.RegisterClientScriptBlock(

Me, Me.GetType, "clientScript", "alert('Rates has Updated Successfully');", True). Can any give me any solution for this.

 



Marin
Telerik team
 answered on 01 Jun 2011
3 answers
99 views
Hi,  By typing in starting letters, radcombo can auto complete selection for first match.  Is there any way to do auto complete for non starting letters ? For example:    If the dropdown list options are  "red apple"  "green apple" "red grape" "green grape".   user type in "red" and press Tab,  the "red apple"  will be auto selected.   Is there any way to auto select "red apple" by typing in "apple" ?

Thanks

-susan
Dimitar Terziev
Telerik team
 answered on 01 Jun 2011
5 answers
120 views

Hi,

I have a RadCombo with the following event : OnClientSelectedIndexChanging which contains a call to a web service which returns a value. Depending on the value I may need to cancel the change. I have a callback function attached to the webservice.

 

How would I going about cancelling the change if I needed to?

 

Thanks

Dimitar Terziev
Telerik team
 answered on 01 Jun 2011
5 answers
391 views
Hi,

I have a series of user control that inherit from RadComboBox. They are used throughout the app, so this is primarily for the purpose of consistency and code re-use. However, I cannot seem to get my default 'Select a <xyz>' item to be the selected item upon the first page load. They show up in the drop-down but the text area of the combo box is blank until Postback, at which time it shows the 'Select a <xyz>' item correctly (assuming the user didn't pick anything).

Everything else seems to be working fine. Frankly, though, my OOP chops are a bit rusty and so I am wondering if I am doing this completely wrong.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using OSIRISModel;
 
namespace Telerik.Web.UI.OSIRIS
{
  /// <summary>Summary description for OS_JobStatusComboBox</summary>
  public class OS_JobStatusComboBox : RadComboBox
  {
    #region Constructor
    public OS_JobStatusComboBox()
    {
      //
      // TODO: Add constructor logic here
      //
    }
    #endregion
 
    #region Control Events
    protected override void OnLoad(EventArgs e)
    {
      if (!Page.IsPostBack)
      {
        OSIRISEntities context = ((OSIRISPage)Page).OSIRISContext;
 
        List<JobStatu> items = context.JobStatus.ToList<JobStatu>();
        this.DataTextField = "Description";
        this.DataValueField = "ID";
        this.DataSource = items;
        this.RegisterWithScriptManager = false;
 
        this.AppendDataBoundItems = true;
        this.Items.Insert(0, new RadComboBoxItem("Select a Job Status", ""));
        this.SelectedIndex = 0;
      }
    }
 
    // This is to prevent double-binding in cases where this control is used inside another control that causes Child Databinding (such as Formview)
    private bool Bound = false;
    protected override void OnDataBound(EventArgs e) { Bound = true; }
    protected override void OnPreRender(EventArgs e) { if (Bound == false) { this.DataBind(); } }
 
    #endregion
  }
}


Little help?
Kalina
Telerik team
 answered on 01 Jun 2011
1 answer
146 views
When you click on an anchor tag, it leaves a small dotted border around it. This is also true of the dates in a RadCalender.

However, because I have set the height of my calendar the rows have increased in height and when I click on a date the anchor tags has its border, but this is only an nth of the height of the row and looks unatractive. I've looked at the css that makes the date and row up and can't see how i'd set it up to display the whole date item as a block?

Can anyone help?

I've attached a screen shot to highlight my issue.

Vasil
Telerik team
 answered on 01 Jun 2011
7 answers
244 views
Hello Telerik Team,

I referred this blog and was able to load UserControls dynamically from code-behind.
Even this blog shows how to close the tabs.
But, I would like to know how can I close the tabs if I create and tabs dynamically from code-behind.
Please help with a working code to this.

MyCode:
 Protected Sub Page_Load(ByVal sender As ObjectByVal e As System.EventArgs) Handles Me.Load  
        If Not Page.IsPostBack Then 
            AddTab("Custom1")  
            AddTab("Custom2")  
        End If 
    End Sub 
    Private Sub AddTab(ByVal tabName As String)  
        Dim tab As New RadTab()  
        tab.Text = tabName  
        RadTabStrip1.Tabs.Add(tab)  
        Dim pageView As New RadPageView()  
        pageView.ID = tabName  
        RadMultiPage1.PageViews.Add(pageView)  
    End Sub 
 
    Protected Sub RadMultiPage1_PageViewCreated(ByVal sender As ObjectByVal e As Telerik.Web.UI.RadMultiPageEventArgs) Handles RadMultiPage1.PageViewCreated  
        Dim userControlName As String = e.PageView.ID + ".ascx" 
        Dim userControl As Control = Page.LoadControl(userControlName)  
        userControl.ID = e.PageView.ID + "_userControl" 
        e.PageView.Controls.Add(userControl)  
    End Sub 
aspx:
 <script type="text/javascript">  
       var tabStrip = $find("<%= RadTabStrip1.ClientID %>");  
       var multiPage = $find("<%= RadMultiPage1.ClientID %>");  
       var tab = tabStrip.findTabByText(tabText);  
       var pageView = tab.get_pageView();  
 
       var tabtabToSelect = tab.get_nextTab();  
       if (!tabToSelect)  
           tabtabToSelect = tab.get_previousTab();  
 
       tabStrip.get_tabs().remove(tab);  
       multiPage.get_pageViews().remove(pageView);  
 
       if (tabToSelect)  
           tabToSelect.set_selected(true);  
 
   </script> 
 
 <telerik:RadTabStrip Style="position: absolute; top: 84px;" ID="RadTabStrip1" SelectedIndex="0" 
                runat="server" MultiPageID="RadMultiPage1">  
                <TabTemplate> 
                      <%# DataBinder.Eval(Container, "Text") %> 
        <img style="margin-left: 10px" src="img/close.png" alt="delete" onclick="deleteTab('<%# DataBinder.Eval(Container, "Text") %>')" /> 
    </TabTemplate> 
 
            </telerik:RadTabStrip> 
            <telerik:RadMultiPage Style="position: absolute; top: 134px;" ID="RadMultiPage1" 
                runat="server" SelectedIndex="0">  
            </telerik:RadMultiPage> 
    </div> 

This doesn't work for tabs instantiated from code-behind.

Thanks
Veronica
Telerik team
 answered on 01 Jun 2011
2 answers
99 views
Hi,

I have RadGrid in UserControl which is placed in a MasterPage.

Code in .aspx page:

 

 

<telerik:RadAjaxManager ID="RadAjaxManager1" runat
="server">
<ClientEvents OnRequestStart="onRequestStart" />
 <AjaxSettings>
 <telerik:AjaxSetting AjaxControlID="RadGridClntResult">
 <UpdatedControls>
 <telerik:AjaxUpdatedControl ControlID="RadGridClntResult" LoadingPanelID="RadAjaxLoadingPanel1"/>
 <%--<telerik:AjaxUpdatedControl ControlID="btnSrch" LoadingPanelID="RadAjaxLoadingPanel1" />--%>
 </UpdatedControls>
 </telerik:AjaxSetting>
<telerik:AjaxSetting AjaxControlID="btnEdit">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="RadGridClntResult" LoadingPanelID="RadAjaxLoadingPanel1" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManager>

<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server">
</telerik:RadAjaxLoadingPanel>

<telerik:RadTabStrip ID="rTabStrip" runat="server" SelectedIndex="0" 
                                        Width="950px" MultiPageID="radMultiPage" Skin="Outlook"
                                        OnClientTabSelecting="tabSelecting"
                                        OnClientTabUnSelected="tabUnSelect"
                                        OnClientTabSelected="tabSelected">
                                         <Tabs>
                                            <telerik:RadTab Text="Contact Information" Selected="True" runat="server">
                                            </telerik:RadTab>
                                           <telerik:RadTab Text="Customers" runat="server">
                                            </telerik:RadTab>
                                            <telerik:RadTab Text="Orders" runat="server">
                                            </telerik:RadTab>
                                           
                                         </Tabs>
                                    </telerik:RadTabStrip>
                                    <telerik:RadMultiPage ID="radMultiPage" runat="server" SelectedIndex="0" onOnPageViewCreated="radMultiPage_PageViewCreated" >
                                         <telerik:RadPageView ID="RPVCDetail" runat="server">
                                            <uc1:contactDet ID="ucCntDet" runat="server" />  <!-- control contains the grid -->
                                         </telerik:RadPageView>
                                         <telerik:RadPageView ID="rpcData" runat="server">
                                            <uc1:gDataFeed ID="ucBetaData" runat="server"></uc1:gDataFeed>
                                         </telerik:RadPageView>
                                        
                                    </telerik:RadMultiPage>

Web UserControl code:
<telerik:RadGrid ID="radCntDets" runat="server" GridLines="None" Width="938px"
AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False"
OnNeedDataSource="radCntDets_OnNeedDataSource" AllowAutomaticDeletes="True" AllowAutomaticInserts="True" AllowAutomaticUpdates
="True" HorizontalAlign="NotSet">
<ClientSettings EnableRowHoverStyle="True">
<Scrolling AllowScroll="True" UseStaticHeaders="True" />
</ClientSettings>
<MasterTableView GridLines="None" CommandItemDisplay="Top" DataKeyNames="ContactID" EditMode
="InPlace">
<Columns>
<telerik:GridEditCommandColumn UniqueName="EditCommandColumn" ItemStyle-Width="100px" HeaderStyle-Width
="100px">
</telerik:GridEditCommandColumn> 
<telerik:GridBoundColumn UniqueName="First Name" HeaderText="First Name" DataField="FirstName" HeaderStyle-Width="100px" ItemStyle-Width="100px" > 
</telerik:GridBoundColumn>
<telerik:GridBoundColumn UniqueName="Last NAme" HeaderText="Last Name" DataField="LastName" HeaderStyle-Width="100px" ItemStyle-Width
="100px">
</telerik:GridBoundColumn>

<telerik:GridBoundColumn UniqueName="Contact Type" HeaderText="Contact Type" DataField="ContactType" HeaderStyle-Width="100px" ItemStyle-Width
="100px">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn UniqueName="vchEmail" HeaderText="Email" DataField="EmailAddress" HeaderStyle-Width="100px" ItemStyle-Width
="100px">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn UniqueName="Phone Number" HeaderText="Phone" DataField="PhoneNumber" HeaderStyle-Width="100px" ItemStyle-Width
="100px">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn UniqueName="Role" HeaderText="Role" DataField="PhoneNumber" HeaderStyle-Width="100px" ItemStyle-Width
="100px">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn UniqueName="Notes" HeaderText="Notes" DataField="Notes" HeaderStyle-Width="220px" ItemStyle-Width
="220px">
</telerik:GridBoundColumn>
</Columns>
<%--<EditFormSettings ColumnNumber="3" CaptionFormatString="Edit details for employee with ID {0}"
CaptionDataField="ContactID">
<FormTableItemStyle Wrap="False"></FormTableItemStyle>
<FormCaptionStyle CssClass="EditFormHeader"></FormCaptionStyle>
<FormMainTableStyle GridLines="None" CellSpacing="0" CellPadding="3" />
<FormTableStyle GridLines="Horizontal" CellSpacing="0" CellPadding="2" CssClass="module"
Height="110px"/>
<FormTableAlternatingItemStyle Wrap="False"></FormTableAlternatingItemStyle>
<FormStyle BackColor="#eef2ea"></FormStyle>
<EditColumn UpdateText="Update" UniqueName="EditCommandColumn1" CancelText="Cancel" ItemStyle-Font-Size="Smaller">
</EditColumn>
<FormTableButtonRowStyle HorizontalAlign="Left" CssClass="EditFormButtonRow"></FormTableButtonRowStyle>
</EditFormSettings>--%>
</MasterTableView>
</telerik:RadGrid>

codebehind:

protected void radCntDets_OnNeedDataSource(object source, GridNeedDataSourceEventArgs e)
{

 radCntDets.DataSource = (DataSet)Session["CDetails"];

}

 

RadGrid control start jumping up and down when I mouse over on the grid or grid heading.
I am using VS2010 on windows7 OS.

Thanks in advance for your response.

-regards
Indra

 

 

Indranath
Top achievements
Rank 1
 answered on 01 Jun 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?