| private void InitializeResources() |
| { |
| ResourceType resType = new ResourceType("Usuários"); |
| resType.AllowMultipleValues = true; |
| resType.ForeignKeyField = "UserID"; |
| RadScheduler1.ResourceTypes.Add(resType); |
| RadScheduler1.Resources.Add(new Resource("Usuários", 1, "Teste 1")); |
| RadScheduler1.Resources.Add(new Resource("Usuários", 2, "Teste 2")); |
| RadScheduler1.Resources.Add(new Resource("Usuários", 3, "Teste 3")); |
| } |
OnClientBeforeShow with the following code
function
OnClientBeforeShow(sender, eventArgs)
{
//Any ajax event will cause the tooltip to show. So we want to make sure
//the ajax event came from the grid and not i.e.(toolbar)
var str = sender.get_TargetControlID();
var pos = str.indexOf("LocationServiceGridView");
if(pos<=0)
{
eventArgs.set_cancel(true);
}
}
however, when you set_cancel(true) it does stop the tooltip from showing but then the event that was suppose to fire from the toolbar cancels as well.
Please advise
protected void Repeater1_ItemCommand(object source, RepeaterCommandEventArgs e)
{
RadScheduler1.HideEditForm();
RadScheduler1.Rebind();
// create the default appointment and times
Appointment app = new Appointment();
string sStart = DateTime.Now.ToShortDateString();
DateTime dStart = DateTime.Parse(sStart);
dStart = dStart.AddDays(1);
app.Start = dStart;
app.End = dStart.AddHours(2);
string[] subjects = e.CommandArgument.ToString().Split("|".ToCharArray());
string theSubject = string.Empty;
for (int i = 0; i < subjects.Length; i++)
{
switch (i)
{
case 1:
theSubject = theSubject + "Name(s):" + System.Environment.NewLine;
break;
case 4:
theSubject = theSubject + "Address:" + System.Environment.NewLine;
break;
case 11:
theSubject = theSubject + "Revision: ";
break;
default:
break;
}
if (subjects[i].Trim() != "")
{
theSubject = theSubject + subjects[i] + System.Environment.NewLine;
.......................
}
app.Subject = theSubject;
app.Attributes["Orders"] = "company";
RadScheduler1.ShowAdvancedEditForm(app);
}
But this does not set teh default drop list box for the custom resource of "Orders". The selected value is "-", and all the possible choices show up.
How would I go about accomplishing this?
Thanks,
Jeff
| <%@ Control Language="C#" AutoEventWireup="True" CodeBehind="ViewTestModule.ascx.cs" Inherits="GS_Marketplace.DotNetNuke.Modules.TestModule.ViewTestModule" %> |
| <%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %> |
| <asp:Label ID="lblDebug" runat="server">Vroom?</asp:Label> |
| <telerik:RadGrid Skin="WebBlue" ID="RadGrid1" runat="server" |
| GridLines="None" AllowPaging="True" AllowSorting="True" |
| Width="97%" AutoGenerateColumns="False" ShowStatusBar="True" |
| OnNeedDataSource="RadGrid1_NeedDataSource" |
| OnUpdateCommand="RadGrid1_UpdateCommand" |
| OnInsertCommand="RadGrid1_InsertCommand" |
| OnDeleteCommand="RadGrid1_DeleteCommand" |
| oncancelcommand="RadGrid1_CancelCommand"> |
| <MasterTableView EnableViewState="True" EnableColumnsViewState="True" CurrentResetPageIndexAction="SetPageIndexToFirst" DataKeyNames="GenderTypeID" |
| Frame="Border" TableLayout="Auto" CommandItemDisplay="Top"> |
| <RowIndicatorColumn CurrentFilterFunction="NoFilter" FilterListOptions="VaryByDataType" Visible="False"> |
| <HeaderStyle Width="20px"></HeaderStyle> |
| </RowIndicatorColumn> |
| <ExpandCollapseColumn CurrentFilterFunction="NoFilter" FilterListOptions="VaryByDataType" Visible="False" Resizable="False"> |
| <HeaderStyle Width="20px"></HeaderStyle> |
| </ExpandCollapseColumn> |
| <Columns> |
| <telerik:GridEditCommandColumn UniqueName="EditCommandColumn"></telerik:GridEditCommandColumn> |
| <telerik:GridBoundColumn UniqueName="GenderTypeID" HeaderText="ID" DataField="GenderTypeID"></telerik:GridBoundColumn> |
| <telerik:GridBoundColumn UniqueName="Description" HeaderText="Description" DataField="Description"></telerik:GridBoundColumn> |
| <telerik:GridButtonColumn UniqueName="DeleteColumn" Text="Delete" CommandName="Delete" /> |
| </Columns> |
| <EditFormSettings UserControlName="~/DesktopModules/Goldstar Consulting.TestModule/TestAddControl.ascx" EditFormType="WebUserControl"> |
| <EditColumn UniqueName="EditCommandColumn1"></EditColumn> |
| </EditFormSettings> |
| </MasterTableView> |
| </telerik:RadGrid> |
| <%@ Control Language="C#" AutoEventWireup="True" CodeBehind="TestAddControl.ascx.cs" Inherits="GS_Marketplace.DotNetNuke.Modules.TestModule.TestAddControl" %> |
| <%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %> |
| <asp:Label ID="lblDebug" runat="server"></asp:Label> |
| <div> |
| <telerik:RadTextBox EnableViewState="True" ID="RadTextBox1" Runat="server" |
| EmptyMessage="New Gender Type" Label="Gender" Text='<%# DataBinder.Eval(Container, "DataItem.Description") %>' |
| TextMode="SingleLine" Height="20px" Width="237px"> |
| </telerik:RadTextBox> |
| </div> |
| <div align="right"> |
| <asp:button EnableViewState="True" id="btnUpdate" text="Update" runat="server" CommandName="Update" Visible='<%# !(Container is Telerik.Web.UI.GridInsertionObject) %>'></asp:button> |
| <asp:button EnableViewState="True" id="btnInsert" text="Insert" runat="server" CommandName="PerformInsert" Visible='<%# Container is Telerik.Web.UI.GridInsertionObject %>'></asp:button> |
| |
| <asp:button EnableViewState="True" id="btnCancel" text="Cancel" runat="server" causesvalidation="False" commandname="Cancel"></asp:button> |
| </div> |
| protected void Page_Load(object sender, EventArgs e) |
| { |
| try |
| { |
| if (!IsPostBack) |
| { |
| } |
| GenderTypeService genderTypeService = new GenderTypeService(); |
| int totalCount = 0; |
| TList<GenderType> genderTypeList = genderTypeService.GetPaged(GenderTypeColumn.Deleted + " = 'false'", GenderTypeColumn.GenderTypeId.ToString(), 0, 10, out totalCount); |
| RadGrid1.DataSource = genderTypeList.ToDataSet(false); |
| RadGrid1.DataBind(); |
| } |
| catch (Exception ex) |
| { |
| Exceptions.ProcessModuleLoadException(this, ex); |
| } |
| } |
<%
@ Page Language="VB" AutoEventWireup="true" CodeFile="Default.aspx.vb" Inherits="_Default" %>
<%
@ Register Assembly="RadComboBox.Net2" Namespace="Telerik.WebControls" TagPrefix="radC" %>
<%
@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<!
DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<
html xmlns="http://www.w3.org/1999/xhtml">
<
head runat="server">
<title>Untitled Page</title>
</
head>
<
body>
<
script language="javascript" type="text/javascript" >
function
OnClientResize(sender, eventArgs)
{
RadComboBox1.Disable()
}
</
script>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server" />
<radC:RadComboBox ID="RadComboBox1" runat="server" SkinsPath="~/RadControls/ComboBox/Skins" ZIndex="90000"
Width="150px">
<Items>
<radC:RadComboBoxItem runat="server" Text="RadComboBoxItem1" />
<radC:RadComboBoxItem runat="server" Text="RadComboBoxItem2" />
<radC:RadComboBoxItem runat="server" Text="RadComboBoxItem3" />
<radC:RadComboBoxItem runat="server" Text="RadComboBoxItem4" />
<radC:RadComboBoxItem runat="server" Text="RadComboBoxItem5" />
<radC:RadComboBoxItem runat="server" Text="RadComboBoxItem6" />
<radC:RadComboBoxItem runat="server" Text="RadComboBoxItem7" />
<radC:RadComboBoxItem runat="server" Text="RadComboBoxItem8" />
<radC:RadComboBoxItem runat="server" Text="RadComboBoxItem9" />
<radC:RadComboBoxItem runat="server" Text="RadComboBoxItem10" />
<radC:RadComboBoxItem runat="server" Text="RadComboBoxItem11" />
</Items>
</radC:RadComboBox>
<div>
<telerik:RadWindowManager ID="RadWindowManager1" runat="server" OnClientResize="OnClientResize" VisibleOnPageLoad="True">
<Windows>
<telerik:RadWindow runat="server" Animation="None" Behavior="Default" Behaviors="Default"
InitialBehavior="None" InitialBehaviors="None" Left="" NavigateUrl="" Style="display: none;"
Top="">
</telerik:RadWindow>
</Windows>
</telerik:RadWindowManager>
</div>
</form>
</
body>
</
html>