Requirements |
|
RadControls version | 2011 |
.NET version | 4.0 |
Visual Studio version | 2010 |
programming language | C# |
browser support |
all browsers supported by RadControls |
switch (e.CommandName.ToLower())
{
case "headercontextmenufilter":
Triplet headercommand = (Triplet)e.CommandArgument;
Pair command = (Pair)headercommand.Second;
if (headercommand.First.ToString().ToLower() == "fg")
{
e.Canceled = true;
/// GridFilteringItem filter = (GridFilteringItem)e.Item;
GridHeaderItem filter= (GridHeaderItem)e.Item;
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;
}