or
| protected new void Page_Load(object sender, EventArgs e) |
| { |
| ContentPlaceHolder cph = Master.Master.FindControl("PageContents") as ContentPlaceHolder; |
| RadGrid grid = cph.FindControl("RadGrid1") as RadGrid; |
| if(!IsPostBack) |
| { |
| DefineGridStructure(grid); |
| } |
| PopulateGrid(grid); |
| } |
| public override void DefineGridStructure(RadGrid grid) |
| { |
| grid.MasterTableView.DataKeyNames = new string[] { "CustomerID", "Name"}; |
| GridBoundColumn boundColumn; |
| GridTemplateColumn templateColumn; |
| boundColumn = new GridBoundColumn(); |
| grid.MasterTableView.Columns.Add(boundColumn); |
| boundColumn.DataField = "Name"; |
| boundColumn.HeaderText = Resources.Strings.Name; |
| templateColumn = new GridTemplateColumn(); |
| grid.MasterTableView.Columns.Add(templateColumn); |
| templateColumn.DataField = "CustomerId"; |
| templateColumn.HeaderText = ""; |
| templateColumn.AllowFiltering = false; |
| templateColumn.ItemTemplate = new ImageLinkTemplate("CustomerId", "~/Images/View.gif", |
| "CustomersView.aspx", Resources.Strings.View); |
| } |
| public override void PopulateGrid(RadGrid grid) |
| { |
| CustomerService service = new CustomerService(); |
| grid.DataSource = service.GetGridData(base.GetCompanyId()); |
| } |
firstTreeView.trackChanges();
| Here is the rad scheduler and the data sources, I get the resources to enter into the db however when I go back to edit them They do not bind the dropdown anymore. Can someone explain what else is needed to get that to happen? <telerik:radscheduler runat="server" Width="797px" SelectedView="MonthView" id="appointmentScheduler" |
| Height="565px" DataEndField="End" DataKeyField="appointmentId" DataSourceID="SqlDataSource1" |
| DataStartField="Start" DataSubjectField="subject" Skin="WebBlue" |
| StartInsertingInAdvancedForm="True" OnAppointmentDataBound="appointmentBound"> |
| <resourcetypes> |
| <telerik:ResourceType DataSourceID="SqlDataSource3" ForeignKeyField="typeId" |
| KeyField="appointmentTypeId" Name="Type" TextField="type" /> |
| </resourcetypes> |
| </telerik:radscheduler> |
| <asp:SqlDataSource ID="SqlDataSource3" runat="server" |
| ConnectionString="<%$ ConnectionStrings:myConnection %>" |
| SelectCommand="SELECT [appointmentTypeId], [type] FROM [v2AppointmentTypes] ORDER BY [type]"> |
| </asp:SqlDataSource> |
| <asp:SqlDataSource ID="SqlDataSource1" runat="server" |
| ConnectionString="<%$ ConnectionStrings:myConnection %>" |
| SelectCommand="SELECT * FROM [v2Appointment]" |
| DeleteCommand="DELETE FROM [v2Appointment] WHERE [appointmentId] = @appointmentId" |
| InsertCommand="INSERT INTO [v2Appointment] ([typeId], [Start], [End], [subject]) VALUES (@typeId, @Start, @End, @subject)" |
| UpdateCommand="UPDATE [v2Appointment] SET [typeId] = @typeId, [Start] = @Start, [End] = @End, [subject] = @subject WHERE [appointmentId] = @appointmentId"> |
| <DeleteParameters> |
| <asp:Parameter Name="appointmentId" Type="Int32" /> |
| </DeleteParameters> |
| <UpdateParameters> |
| <asp:Parameter Name="typeId" Type="String" /> |
| <asp:Parameter Name="Start" Type="DateTime" /> |
| <asp:Parameter Name="End" Type="DateTime" /> |
| <asp:Parameter Name="subject" Type="String" /> |
| <asp:Parameter Name="appointmentId" Type="Int32" /> |
| </UpdateParameters> |
| <InsertParameters> |
| <asp:Parameter Name="typeId" Type="String" /> |
| <asp:Parameter Name="Start" Type="DateTime" /> |
| <asp:Parameter Name="End" Type="DateTime" /> |
| <asp:Parameter Name="subject" Type="String" /> |
| </InsertParameters> |
| </asp:SqlDataSource> |