ScriptManager.RegisterClientScriptBlock(
Me, Me.GetType, "clientScript", "alert('Rates has Updated Successfully');", True). Can any give me any solution for this.
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
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
}
}
Protected Sub Page_Load(ByVal sender As Object, ByVal 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 Object, ByVal 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 |
<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> |
<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
Hi,
I have hard time finding some resources how to implement custom provider, in past I found this article
http://www.telerik.com/help/aspnet-ajax/schedule_databindingimplementingaprovider.html
but now I can’t access it.
Do you have any workaround to get that information, or it’s unavailable on purpose?
Thanks for info