<script type=
"text/javascript"
>
function
AddSortExpression(grid, fieldName, sortOrder) {
var
sortExpression =
new
Telerik.Web.UI.GridSortExpression();
sortExpression.set_fieldName(fieldName);
sortExpression.set_sortOrder(sortOrder);
grid.get_masterTableView()._sortExpressions.add(sortExpression);
grid.get_masterTableView()._showSortIconForField(fieldName, sortOrder);
}
</script>
The code works fine for a single column sorting but if there are two columns
to be sorted then sorting gets applied on the two columns and the column header
color changes to denote that but the little black triangle which denotes whether
it is a ascending or descending sort vanishes. I have attached the image of how
the header looks.
Please help me out.
[OleDbException (0x80040e21): Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.]
[InvalidOperationException: Command parameter[9] '' is invalid.
Command parameter[10] '' is invalid.
Command parameter[11] '' is invalid.
]
Telerik.Web.UI.Scheduling.DataSourceViewSchedulerProvider.OnDataSourceOperationComplete(Int32 count, Exception e) +39
System.Web.UI.DataSourceView.Insert(IDictionary values, DataSourceViewOperationCallback callback) +72
Telerik.Web.UI.Scheduling.DataSourceViewSchedulerProvider.Insert(RadScheduler owner, Appointment appointmentToInsert) +202
Telerik.Web.UI.SchedulerProviderBase.Insert(ISchedulerInfo schedulerInfo, Appointment appointmentToInsert) +70
Telerik.Web.UI.Scheduling.AppointmentController.InsertAppointmentThroughProvider(ISchedulerInfo schedulerInfo, Appointment appointment) +109
Telerik.Web.UI.Scheduling.AppointmentController.InsertAppointment(ISchedulerInfo schedulerInfo, Appointment appointment) +40
Telerik.Web.UI.RadScheduler.InsertAppointmentInline() +303
Telerik.Web.UI.RadScheduler.OnBubbleEvent(Object source, EventArgs args) +505
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37
System.Web.UI.WebControls.LinkButton.OnCommand(CommandEventArgs e) +121
System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String eventArgument) +156
System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +9643314
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1724
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<
html
xmlns
=
"http://www.w3.org/1999/xhtml"
>
<
head
runat
=
"server"
>
<
title
></
title
>
<
telerik:RadStyleSheetManager
id
=
"RadStyleSheetManager1"
runat
=
"server"
/>
</
head
>
<
body
style
=
"height: 459px"
>
<
form
id
=
"form1"
runat
=
"server"
>
<
telerik:RadScriptManager
ID
=
"RadScriptManager1"
runat
=
"server"
>
<
Scripts
>
<
asp:ScriptReference
Assembly
=
"Telerik.Web.UI"
Name
=
"Telerik.Web.UI.Common.Core.js"
/>
<
asp:ScriptReference
Assembly
=
"Telerik.Web.UI"
Name
=
"Telerik.Web.UI.Common.jQuery.js"
/>
<
asp:ScriptReference
Assembly
=
"Telerik.Web.UI"
Name
=
"Telerik.Web.UI.Common.jQueryInclude.js"
/>
</
Scripts
>
</
telerik:RadScriptManager
>
<
script
type
=
"text/javascript"
>
//Put your JavaScript code here.
// Avoid Page_Validators is undefined error.
var Page_Validators = new Array();
</
script
>
<
telerik:RadAjaxManager
ID
=
"RadAjaxManager1"
runat
=
"server"
>
</
telerik:RadAjaxManager
>
<
div
>
</
div
>
<
telerik:RadScheduler
ID
=
"RadScheduler1"
runat
=
"server"
DataDescriptionField
=
"Description"
DataEndField
=
"End_Time"
DataKeyField
=
"AppointmentID"
DataRecurrenceField
=
"Recurrence_Rule"
DataRecurrenceParentKeyField
=
"RecurrenceParentID"
DataSourceID
=
"SqlDataSource_Appointment"
DataStartField
=
"Start_Time"
DataSubjectField
=
"Subject"
DayEndTime
=
"19:00:00"
DayStartTime
=
"07:00:00"
StartInsertingInAdvancedForm
=
"True"
WorkDayStartTime
=
"09:00:00"
Height
=
"600px"
SelectedView
=
"MonthView"
>
<
ResourceTypes
>
<
telerik:ResourceType
DataSourceID
=
"SqlDataSource_Resource"
ForeignKeyField
=
"RoomID"
KeyField
=
"ResourceID"
Name
=
"Rooms"
TextField
=
"RoomName"
/>
<
telerik:ResourceType
DataSourceID
=
"SqlDataSource_Employee"
ForeignKeyField
=
"EmployeeID"
KeyField
=
"EmployeeID"
Name
=
"Employees"
TextField
=
"UserName"
/>
</
ResourceTypes
>
<
WeekView
DayStartTime
=
"07:00:00"
WorkDayStartTime
=
"09:00:00"
/>
<
DayView
DayStartTime
=
"07:00:00"
WorkDayStartTime
=
"09:00:00"
/>
<
MultiDayView
DayStartTime
=
"07:00:00"
WorkDayStartTime
=
"09:00:00"
/>
</
telerik:RadScheduler
>
<
asp:SqlDataSource
ID
=
"SqlDataSource_Employee"
runat
=
"server"
ConnectionString="<%$ ConnectionStrings:ConnectionString_mgsql2 %>" ProviderName="<%$ ConnectionStrings:ConnectionString_mgsql2.ProviderName %>" SelectCommand="SELECT [EmployeeID], [UserName] FROM [Employee] ORDER BY [UserName]"></
asp:SqlDataSource
>
<
asp:SqlDataSource
ID
=
"SqlDataSource_Appointment"
runat
=
"server"
ConnectionString="<%$ ConnectionStrings:ConnectionString_mgsql2 %>" ProviderName="<%$ ConnectionStrings:ConnectionString_mgsql2.ProviderName %>" SelectCommand="SELECT * FROM [Appointment]" DeleteCommand="DELETE FROM [Appointment] WHERE [AppointmentID] = ?" InsertCommand="INSERT INTO [Appointment] ([AppointmentID], [Subject], [Description], [Start], [End], [RoomID], [EmployeeID], [RecurrenceRule], [RecurrenceParentID]) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)" UpdateCommand="UPDATE [Appointment] SET [Subject] = ?, [Description] = ?, [Start] = ?, [End] = ?, [RoomID] = ?, [EmployeeID] = ?, [RecurrenceRule] = ?, [RecurrenceParentID] = ? WHERE [AppointmentID] = ?">
<
DeleteParameters
>
<
asp:Parameter
Name
=
"AppointmentID"
Type
=
"Int32"
/>
</
DeleteParameters
>
<
InsertParameters
>
<
asp:Parameter
Name
=
"AppointmentID"
Type
=
"Int32"
/>
<
asp:Parameter
Name
=
"Subject"
Type
=
"String"
/>
<
asp:Parameter
Name
=
"Description"
Type
=
"String"
/>
<
asp:Parameter
Name
=
"Start"
Type
=
"DateTime"
/>
<
asp:Parameter
Name
=
"End"
Type
=
"DateTime"
/>
<
asp:Parameter
Name
=
"RoomID"
Type
=
"Int32"
/>
<
asp:Parameter
Name
=
"EmployeeID"
Type
=
"Int32"
/>
<
asp:Parameter
Name
=
"RecurrenceRule"
Type
=
"String"
/>
<
asp:Parameter
Name
=
"RecurrenceParentID"
Type
=
"Int32"
/>
</
InsertParameters
>
<
UpdateParameters
>
<
asp:Parameter
Name
=
"Subject"
Type
=
"String"
/>
<
asp:Parameter
Name
=
"Description"
Type
=
"String"
/>
<
asp:Parameter
Name
=
"Start"
Type
=
"DateTime"
/>
<
asp:Parameter
Name
=
"End"
Type
=
"DateTime"
/>
<
asp:Parameter
Name
=
"RoomID"
Type
=
"Int32"
/>
<
asp:Parameter
Name
=
"EmployeeID"
Type
=
"Int32"
/>
<
asp:Parameter
Name
=
"RecurrenceRule"
Type
=
"String"
/>
<
asp:Parameter
Name
=
"RecurrenceParentID"
Type
=
"Int32"
/>
<
asp:Parameter
Name
=
"AppointmentID"
Type
=
"Int32"
/>
</
UpdateParameters
>
</
asp:SqlDataSource
>
<
asp:SqlDataSource
ID
=
"SqlDataSource_Resource"
runat
=
"server"
ConnectionString="<%$ ConnectionStrings:ConnectionString_mgsql2 %>" ProviderName="<%$ ConnectionStrings:ConnectionString_mgsql2.ProviderName %>" SelectCommand="SELECT * FROM [Resource]"></
asp:SqlDataSource
>
</
form
>
</
body
>
</
html
>
I have a RadListView that binds and displays data correctly. In the ItemTemplate there is an edit button. When the user clicks the edit button I handle the ListViews OnItemEditing event.
In the EditItem template I have a txtbx(s) for the text values and a cmbo box for a list of choices for one of the data items. The combo box binds and displays choices just fine.
So I thought it would be nice to find in the combobox the current (i.e. ListView item that has been clicked to edit) matching option, display it (find in combo box list of choices and make it selected choice) and this is where I hit my snag. I can't seem to get a handle on the DataItem....well actually I can and it is null???
My reading while trying to solve reveals that the list is technically not yet in "edit" mode. If that is the case then does that mean the data item is not yet populated? This would explain why my data item is empty but then I can't find any other event to handle to achieve my objective?
<
telerik:RadListView
...<snip>... OnItemEditing="ExPrgmLstVw_ItemEditing" >
....Layout Template, ItemTemplate, EditTemplate, Insert Template......
</
telerik:RadListView
>
protected void ExPrgmLstVw_ItemEditing(object sender, RadListViewCommandEventArgs e)
{
...
RadListViewDataItem itm = (RadListViewDataItem) e.ListViewItem;
...
}