

After upgrading a web application to use the latest update, the AppointmentTemplate now show the delete cross. This had been disabled and replaced with custom functionality (see below). As a result, this overlaping delete cross makes the custom functionailty inopperable. As soon as I revert the project back to an older version of the Telerik controls, everything works as it it's supposed to.
<AppointmentTemplate> <div class='rsCustomAppointmentContainer <%# Eval("Fullname") %>'> <strong><%# Eval("Fullname")%></strong> <asp:HiddenField ID="hidStatusId" runat="server" Value='<%# Eval("StatusId") %>' /> </div><div style="text-align: right;"><asp:Button runat="server" ID="Button1" CssClass="rsExportButton" ToolTip="Change Status"CommandName="ChangeStatus" OnClientClick="ChangeStatus(this, event); return false;" Style="cursor: pointer;cursor: hand;" /></div> </AppointmentTemplate><CommandItemTemplate> <div class="gridCommandItemRow"> <asp:LinkButton runat="server" ID="AddNew" Text="Add New" CssClass="add" CommandName="InitInsert" Visible="<%# Not TeamMetricsRadGrid.MasterTableView.IsItemInserted %>" /> <asp:LinkButton runat="server" ID="UpdateAll" Text="Save All" CssClass="save" CommandName="SaveAll" CausesValidation="true" /> </div> </CommandItemTemplate><ValidationSettings CommandsToValidate="SaveAll,PerformInsert,Update" ValidationGroup="TeamMetricsValidationGroup" /> I have asp.net required field validator controls on several of the controls within EditItemTemplates.
Prior to using my own linkbuttons in the CommandItemTemplate, I was using the built-in Add / Edit buttons supplied by the GridEditCommandColumn. When I did this, the client-side validation was firing correctly, and preventing the postback as expected.
But my linkbutton in the CommandItemTemplate, with the CommandName of "SaveAll" is NOT firing client-side validation. It does a postback without validation.
I thought I could set CausesValidation="true" for that button, and add that button's CommandName to the CommandsToValidate property, as I've done above, but that didn't work. Does the grid validation not work with CommandNames from other buttons, in the CommandToValidate property, like I've done?
What am I missing? Is it possible to fire client-side validation from buttons in the CommandItemTemplate?
Thanks,
Michael
<telerik:RadScheduler runat="server" ID="rsBookings" DataSourceID="odsBookings" RowHeight="50px" TimelineView-HeaderDateFormat="dd/MM/yyyy" DataKeyField="BookingID" DataSubjectField="Description" DataStartField="StartDate" DataEndField="EndDate" GroupBy="Room" GroupingDirection="Vertical" StartEditingInAdvancedForm="false" SelectedView="TimelineView" TimelineView-TimeLabelSpan="1" TimelineView-SlotDuration="00:30:00" TimelineView-NumberOfSlots="48" TimelineView-ColumnHeaderDateFormat="HH:mm" DayStartTime="00:00" DayEndTime="23:59" ColumnWidth="80px" AllowDelete="false" AllowEdit="false" AllowInsert="false" CustomAttributeNames="Description, CompanyName, BookingID" OnDataBound="rsBookings_DataBound"> <AdvancedForm Modal="true" /> <TimelineView UserSelectable="false" /> <WeekView UserSelectable="false" /> <MonthView UserSelectable="false" /> <DayView UserSelectable="false" /> <ResourceTypes> <telerik:ResourceType KeyField="RoomID" Name="Room" TextField="Name" ForeignKeyField="RoomID" DataSourceID="odsRooms" /> </ResourceTypes> <AppointmentTemplate> <a href='BookingDetails.aspx?BookingID=<%# Eval ("BookingID") %>'><%# Eval("Description") %></a> <br /> <%# Eval("CompanyName")%> </AppointmentTemplate> <TimeSlotContextMenuSettings EnableDefault="true" /> <AppointmentContextMenuSettings EnableDefault="true" /> </telerik:RadScheduler> Code Behind: protected void Page_Load(object sender, EventArgs e) { rsBookings.SelectedDate = DateTime.Today; }public partial class _Default : System.Web.UI.Page<br>{<br>protected voidPage_Load(object sender, EventArgs e)<br>{<br>RadFileExplorer1.Configuration.ContentProviderTypeName = typeof(CustomProvider).AssemblyQualifiedName;<br>}<br><br>public classCustomProvider : FileSystemContentProvider<br>{<br>publicCustomProvider(HttpContext context, string[] searchPatterns, string[] viewPaths, string[] uploadPaths, string[] deletePaths, string selectedUrl, stringselectedItemTag)<br>: base(context, searchPatterns, viewPaths, uploadPaths, deletePaths, selectedUrl, selectedItemTag)<br>{ }<br><br>public overrideDirectoryItem ResolveDirectory(string path)<br>{<br>DirectoryItem originalFolder = base.ResolveDirectory(path);<br>FileItem[] originalFiles = originalFolder.Files;<br>List<FileItem> filteredFiles = newList<FileItem>();<br><br>// Filter the files<br>foreach (FileItem originalFile in originalFiles)<br>{<br>if(!this.IsFiltered(originalFile.Name))<br>{<br>filteredFiles.Add(originalFile);<br>}<br>}<br><br>DirectoryItem newFolder = new DirectoryItem(originalFolder.Name, originalFolder.Location, originalFolder.FullPath, originalFolder.Tag, originalFolder.Permissions, filteredFiles.ToArray(), originalFolder.Directories);<br><br>returnnewFolder;<br>}<br><br>public override DirectoryItem ResolveRootDirectoryAsTree(string path)<br>{<br>DirectoryItem originalFolder = base.ResolveRootDirectoryAsTree(path);<br>DirectoryItem[] originalDirectories = originalFolder.Directories;<br>List<DirectoryItem> filteredDirectories = new List<DirectoryItem>();<br><br>// Filter the folders<br>foreach (DirectoryItem originalDir in originalDirectories)<br>{<br>if(!this.IsFiltered(originalDir.Name))<br>{<br>filteredDirectories.Add(originalDir);<br>}<br>}<br>DirectoryItem newFolder = new DirectoryItem(originalFolder.Name, originalFolder.Location, originalFolder.FullPath, originalFolder.Tag, originalFolder.Permissions, originalFolder.Files, filteredDirectories.ToArray());<br><br>returnnewFolder;<br>}<br><br>private bool IsFiltered(string name)<br>{<br>if(name.ToLower().EndsWith(".sys") || name.ToLower().Contains("_sys"))<br>{<br>return true;<br>}<br><br>// else<br>return false;<br>}<br>}<br>}<br>Can we programatically add a TextBlock to a ChartTitle?
The reason is to display a multiline title, with a different style applied to each line so that I could display something like,
MAIN TITLE
Sub Title
Where the font size of "Sub Title" is smaller than "MAIN TITLE". I tried declaring new textblocks separately, then adding them to a charttitle, but it gives me a null object error when creating the textblock like,
TextBlock newBlock1 = new TextBlock(chartName);<telerik:RadChart ID="RadChartCategory" runat="server" DataSourceID="dsChartData" Width="950" Height="650" Skin="Vista"> <PlotArea> <YAxis> <Appearance CustomFormat="#,#"> </Appearance> </YAxis> <XAxis DataLabelsColumn="StringDate" LabelStep="4"> </XAxis> </PlotArea> <Series> <telerik:ChartSeries DataYColumn="Scenario1" DefaultLabelValue="" Name="Scenario 1" Type="Line"> </telerik:ChartSeries> <telerik:ChartSeries DataYColumn="Scenario2" DefaultLabelValue="" Name="Scenario 2" Type="Line"> </telerik:ChartSeries> <telerik:ChartSeries DataYColumn="Scenario3" DefaultLabelValue="" Name="Scenario 3" Type="Line"> </telerik:ChartSeries> <telerik:ChartSeries DataYColumn="Theoretical" DefaultLabelValue="" Name="Theoretical Capacity" Type="Line"> </telerik:ChartSeries> <telerik:ChartSeries DataYColumn="NetEffective" DefaultLabelValue="" Name="Net Effective Capacity" Type="Line"> </telerik:ChartSeries> </Series> <ChartTitle> <TextBlock Text="Labour Demand"> </TextBlock> </ChartTitle></telerik:RadChart>Protected Sub RadComboBoxCategory_SelectedIndexChanged(sender As Object, e As Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs) Handles RadComboBoxCategory.SelectedIndexChanged RadChartCategory.ChartTitle.TextBlock.Text = "Labour Demand - " & RadComboBoxCategory.SelectedItem.TextEnd Sub