or
In code I have successfully created a radgrid and bound data to it dynamically, now I need to create the edit interaction of the grid, can you point me to any examples, e.g I need to create somes edit templates for the columns.
Thanks
P
function refreshGrid()
{
var ajaxManager = $find("<%= RadAjaxManager1.ClientID %>");
ajaxManager.AjaxRequest();
}
Protected Sub RadAjaxManager1_AjaxRequest( _
ByVal sender As Object, _
ByVal e As Telerik.Web.UI.AjaxRequestEventArgs) _
Handles RadAjaxManager1.AjaxRequest
Me.gridItems.Rebind()
End Sub
| <telerik:RadScheduler ID="RadScheduler1" runat="server" AllowDelete="True" AllowEdit="True" AllowInsert="True" DataEndField="EndTime" DataKeyField="VacationID" DataRecurrenceField="RecurrenceRule" DataRecurrenceParentKeyField="RecurrenceParentID" DataSourceID="SqlDataSource1" DataStartField="Start" DataSubjectField="Subject" DayStartTime="09:00:00" HoursPanelTimeFormat="h:mm tt" SelectedDate="2007-11-12" SelectedView="MonthView" WorkDayEndTime="18:00:00" WorkDayStartTime="09:00:00" Height="600px" OnAppointmentCreated="RadScheduler1_AppointmentCreated" OnAppointmentInsert="RadScheduler1_AppointmentInsert"> |
| <ResourceTypes> |
| <telerik:ResourceType KeyField="VacationTypeID" Name="Type" TextField="VacationType" ForeignKeyField="AppointmentTypeID" DataSourceID="SqlDataSource3" /> |
| </ResourceTypes> |
| <InlineInsertTemplate> |
| <asp:TextBox |
| ID="TitleTextBox" |
| runat="server" |
| Text='<%# Bind("Subject") %>' |
| Width="90%" |
| TextMode="MultiLine" |
| Height="20px"> |
| </asp:TextBox> |
| <asp:DropDownList |
| runat="server" |
| ID="TypesList" |
| DataValueField="VacationTypeID" |
| DataSourceID="SqlDataSource3" |
| SelectedValue = '<%# Bind("Type") %>' |
| DataTextField="VacationType" |
| > |
| </asp:DropDownList> |
| <asp:LinkButton |
| ID="InsertButton" |
| runat="server" |
| CommandName="Insert"> |
| Insert |
| </asp:LinkButton> |
| <asp:LinkButton |
| ID="InsertCancelButton" |
| runat="server" |
| CausesValidation="False" |
| CommandName="Cancel"> |
| Cancel |
| </asp:LinkButton> |
| </InlineInsertTemplate> |
| <AppointmentTemplate> |
| <%# Eval("Subject") %> (<%# Eval("Type.Text") %>) |
| </AppointmentTemplate> |
| </telerik:RadScheduler> |
| <br /> |
| <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:razzaConnectionString %>" |
| DeleteCommand="DELETE FROM Vacations WHERE (VacationID = @VacationID)" InsertCommand="INSERT INTO Vacations(Subject, Start, EndTime, UserID, RoomID, RecurrenceRule, RecurrenceParentID, AppointmentTypeID) VALUES (@Subject, @Start, @EndTime, @UserID, 1, @RecurrenceRule, @RecurrenceParentID, @AppointmentTypeID)" |
| SelectCommand="SELECT Vacations.*, VacationTypes.VacationType as TypeName FROM Vacations INNER JOIN VacationTypes ON VacationTypes.VacationTypeID=Vacations.AppointmentTypeID" |
| UpdateCommand="UPDATE Vacations SET Subject = @Subject, Start = @Start, EndTime = @EndTime, RoomID = 1, RecurrenceRule = @RecurrenceRule, RecurrenceParentID = @RecurrenceParentID, AppointmentTypeID=@AppointmentTypeID WHERE VacationID=@VacationID"> |
| <DeleteParameters> |
| <asp:Parameter Name="VacationID" /> |
| <asp:Parameter Name="Subject" /> |
| <asp:Parameter Name="Start" /> |
| <asp:Parameter Name="EndTime" /> |
| <asp:Parameter Name="UserID" /> |
| <asp:Parameter Name="RecurrenceRule" /> |
| <asp:Parameter Name="RecurrenceParentID" /> |
| <asp:Parameter Name="AppointmentTypeID" /> |
| </DeleteParameters> |
| <UpdateParameters> |
| <asp:Parameter Name="Subject" /> |
| <asp:Parameter Name="Start" /> |
| <asp:Parameter Name="EndTime" /> |
| <asp:Parameter Name="UserID" /> |
| <asp:Parameter Name="RecurrenceRule" /> |
| <asp:Parameter Name="RecurrenceParentID" /> |
| <asp:Parameter Name="VacationID" /> |
| <asp:Parameter Name="AppointmentTypeID" /> |
| </UpdateParameters> |
| </asp:SqlDataSource> |
| </div> |
| <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:razzaConnectionString %>" |
| SelectCommand="SELECT [EmployeeID], [EmployeeName] FROM [Prezza_Employees]"></asp:SqlDataSource> |
| <asp:SqlDataSource ID="SqlDataSource3" runat="server" ConnectionString="<%$ ConnectionStrings:razzaConnectionString %>" |
| SelectCommand="SELECT [VacationTypeID], [VacationType] FROM [VacationTypes]"></asp:SqlDataSource> |
| </form> |