private void Form3_Load(object sender, EventArgs e)
{
this.masterCountryTableAdapter.Fill(this.dsDataSet.MasterCountry);
ThemeResolutionService.ApplyThemeToControlTree(this.radGridView1, "Breeze");
}
private void button1_Click(object sender, EventArgs e)
{
currentTheme =
ThemeResolutionService.GetTheme("Breeze");
//if (currentTheme.ThemeProperties.ContainsKey("BaseColor"))
//{
// this.colorForm.SelectedHslColor = (HslColor)currentTheme.ThemeProperties["BaseColor"];
// return;
//}
HslColor baseColor = HslColor.FromColor(Color.FromArgb(250, 0, 0));
//this.colorForm.SelectedHslColor = baseColor;
currentTheme.AddColorBlend(
"BaseColor", baseColor);
}
Console.WriteLine(radComboBox1.SelectedValue); |
IList<MyObject> orte = new List<MyObject>(); |
orte.Add(new MyObject(1, "aaa")); |
orte.Add(new MyObject(2, "bbb")); |
orte.Add(new MyObject(3, "bbb")); |
radComboBox1.DisplayMember = "Ort"; |
radComboBox1.ValueMember = "Id"; |
radComboBox1.DataSource = orte; |
Thank you,
using System; |
using System.Collections.Generic; |
using System.ComponentModel; |
using System.Data; |
using System.Drawing; |
using System.Linq; |
using System.Text; |
using System.Windows.Forms; |
using IMMC.XPExplorerBar; |
using IMMC.Forms; |
using IMMC.Business; |
using IMMC.Data; |
using IMMC.Properties; |
using IMMC.Forms.Properties; |
using System.Data.SqlClient; |
using System.Windows.Forms.DataVisualization.Charting; |
using Telerik.WinControls.UI; |
using Telerik.WinControls.UI.Scheduler; |
using Telerik.WinControls.UI.Scheduler.Dialogs; |
namespace IMMC |
{ |
public partial class frmRadControls : Form |
{ |
public frmRadControls() |
{ |
InitializeComponent(); |
} |
private List<MyAppointment> appointments = new List<MyAppointment>(); |
protected override void OnLoad(EventArgs e) |
{ |
base.OnLoad(e); |
DateTime baseDate = DateTime.Today; |
DateTime[] start = new DateTime[] { baseDate.AddHours(14.0), baseDate.AddDays(1.0).AddHours(9.0), baseDate.AddDays(2.0).AddHours(13.0) }; |
DateTime[] end = new DateTime[] { baseDate.AddHours(16.0), baseDate.AddDays(1.0).AddHours(15.0), baseDate.AddDays(2.0).AddHours(17.0) }; |
string[] summaries = new string[] { "Mr. Brown", "Mr. White", "Mrs. Green" }; |
string[] descriptions = new string[] { "", "", "" }; |
string[] locations = new string[] { "City", "Out of town", "Service Center" }; |
MyAppointment appointment = null; |
for (int i = 0; i < summaries.Length; i++) |
{ |
appointment = new MyAppointment(start[i], end[i], summaries[i], |
descriptions[i], locations[i]); |
this.appointments.Add(appointment); |
} |
//this.radScheduler.AppointmentFactory = new CustomAppointmentFactory(); |
//schedulerBindingDataSource1.EventProvider.AppointmentFactory = radScheduler.AppointmentFactory; |
} |
private void radButton_Click(object sender, EventArgs e) |
{ |
SchedulerBindingDataSource dataSource = new SchedulerBindingDataSource(); |
AppointmentMappingInfo appointmentMappingInfo = new AppointmentMappingInfo(); |
appointmentMappingInfo.Start = "Start"; |
appointmentMappingInfo.End = "End"; |
appointmentMappingInfo.Summary = "Subject"; |
appointmentMappingInfo.Description = "Description"; |
appointmentMappingInfo.Location = "Location"; |
appointmentMappingInfo.UniqueId = "Id"; |
SchedulerMapping idMapping = appointmentMappingInfo.FindByDataSourceProperty("Id"); |
//idMapping.ConvertToDataSource = new ConvertCallback(this.ConvertIdToDataSource); |
//idMapping.ConvertToScheduler = new ConvertCallback(this.ConvertIdToScheduler); |
dataSource.EventProvider.Mapping = appointmentMappingInfo; |
dataSource.EventProvider.DataSource = this.appointments; |
this.radScheduler.DataSource = dataSource; |
} |
} |
} |
Dear Telerik Users
I'm having a problem with drag and drop functionality in a hierarchical Gridview.
As I drag rows and drop them on top of another row, the underlying (datasource-bound) datatable-entries get updated (Datarow["ParentId"] = dropCell["ParentId"].
This means, that after dragging, the entries appear under another parent in hierarchy. The gridview has to reflect these changes in the underlying database by adjusting the size of the expanded hierarchy-grid.
Even thought in general it's working, but there are a lot of incoherencies,
- expand/collapse is running out of sync
- parents with children sometimes cannot be expanded
- the children of the last row in the mastertemplate never shows the children even though expanded (children are "hidden")
closing and reopening the gridview solves the out-of-sync issues until I restart drag and dropping + expanding and collapsing
Question:
What is the "official way" of keeping the underlying datatables and the visual elements syncronized?
I've tried:
1. Datatable.AcceptChanges()
2. DataRow.BeginEdit() - EndEdit()
3. dropTemplate.Update(GridUINotifyAction.... ==> every action)
4. RadGridView.Update() RadGridview.Refresh()
The only effect I've noticed is that the "GridUINotifyAction.AddRows" seems to adapt the size of the expanding parent.
Sorry, maybe it's a trival mistake, but I do not see it and I'm almost there...
Thank you.
Markus