Telerik Forums
UI for WinForms Forum
0 answers
88 views
how change backcolor multicolumncombobox?
I change backcolor but change not any thing
Ali
Top achievements
Rank 1
 asked on 09 Mar 2013
4 answers
261 views
I'm sure i messed this up somehow, but i can't figure out how at this point.

i had a schedule control with resources on it.  they were colored different colors.  it worked fine.

now i added databinding to add appointments to it.  bound to custom business objects.  now everything shows in a weird gray/black shade. see the example.  if i remove databinding it works fine again (of course there's no appointments).

I can't get the appointment summary to show either.  what am i doing wrong for that?  it's there if i double click and edit an appointment the summary/description are there, so i know binding is correct, but it won't show on the appointment itself.

here's my databinding code.  it's all done in code, nothing on the form itself.

			var appointmentMappingInfo = new AppointmentMappingInfo();
			appointmentMappingInfo.BackgroundId = "ApptStatus";
			appointmentMappingInfo.Description = "Description";
			appointmentMappingInfo.End = "EndDate";
			//appointmentMappingInfo.Location = "Location";
			//appointmentMappingInfo.MasterEventId = "ParentID";
			//appointmentMappingInfo.RecurrenceRule = "RecurrenceRule";
			appointmentMappingInfo.ResourceId = "ProviderId";
			//appointmentMappingInfo.Resources = "SchedulerAppointment";
			appointmentMappingInfo.Start = "StartDate";
			//appointmentMappingInfo.StatusId = "StatusID";
			appointmentMappingInfo.Summary = "Subject";
			schedulerBindingDataSource1.EventProvider.Mapping = appointmentMappingInfo;
 
 
			var resourceMappingInfo = new ResourceMappingInfo();
			resourceMappingInfo.Id = "Id";
			resourceMappingInfo.Name = "Name";
 
			schedulerBindingDataSource1.ResourceProvider.Mapping = resourceMappingInfo;
 
			_bsAppts = SchedulerRepository.GetAppointments();
 
			schedulerBindingDataSource1.ResourceProvider.DataSource = _opList;
			schedulerBindingDataSource1.EventProvider.DataSource = _bsAppts;
 
 
			schMain.DataSource = schedulerBindingDataSource1;

_opList is a binding list of your Resource object.
_bsAppts is a binding list of my business object appointments

Thanks!

EDIT to get the appintment summary to show, i had to handle the appointmentformatting event and change the forecolor of appointmentelement to black.  i still have the weird color problem above.
Julian Benkov
Telerik team
 answered on 08 Mar 2013
1 answer
127 views
Hello Team
I have a requirement in gridview where user inserts columns to the grid and also removes when ever he wants, when he removes the column i need to delete the column from database, see the below image



when user clicks the contextmenu Remove Field i need to delete the column from the database table

for this i have written  MenuItemRemove.Click += new EventHandler(MenuItemRemove_Click);

void MenuItemRemove_Click(object sender, EventArgs e)
{
  string iColName = radgridview1.CurrentColumn.Name;
// delete query to delete the above column from the database
}

my problem here is i selected fifth column in the grid, and the current column is always returning column index as 0 which means column one, how to capture the selected column index or name when clicked the context menu remove in my example

please help me


Stefan
Telerik team
 answered on 08 Mar 2013
2 answers
210 views
Hi,

I defined a DateTime column with TimePicker editor in a grid.
When I press the clock, the clock editor is opened, the problem is when I leave the cell without closing the editor (pressing the done, in some cases the editor is closed and in some times its still open, even when I am in a different cell (Decimal column for example). I can still change the time in the editor but it's not connect to anything.

This is how I defined the column:
var dateColumnOut = new GridViewDateTimeColumn
         {
             HeaderText = "Date Time Out",
             Name = Data.cJobCardData.JobCardColumns.DateTimeOut,
             FieldName = Data.cJobCardData.JobCardColumns.DateTimeOut,
             Format = DateTimePickerFormat.Long,
             EditorType = GridViewDateTimeEditorType.TimePicker,
             FormatString = "{0: M/d/yyyy h:mm tt}",
             TextAlignment = ContentAlignment.MiddleCenter,
             Width = colWidth
         };

I checked the CurrentCellChange: The event is fired and I can fill the new cell values. Still, the clock editor is opened and I don't know how to close it.

What am I doing wrong ????
Shlomo Pleban
Top achievements
Rank 1
 answered on 07 Mar 2013
4 answers
291 views
How do I get the display text of a cell? (The output of the CellFormatting() event.) Everything seems to return the value in the data source.
Jay
Top achievements
Rank 1
 answered on 07 Mar 2013
1 answer
264 views
I need to create an UI which allows me to select entries from one list box and add it to another listbox at the run time. Now, the listbox1 may contain combo box and checkbox as the items. For example, if I add a combo box labelled Quarter with values "Q1, Q2, Q3, Q4" as an item in listbox1 and select the entry Q1 in it, and click on the "Add" button, it should be added to listbox2. Vice versa should also be possible. This should be possible at the run time. How could I add combo box and checkbox as an item to the listbox? Also, please suggest if for the add-remove buttons, the code I've is correct. Please look into the attachment for the UI which would help to understand this better.

private void MoveListBoxItems(ListBox source, ListBox destination)
    {
        ListBox.SelectedObjectCollection sourceItems = source.SelectedItems;
        foreach (var item in sourceItems)
        {
            destination.Items.Add(item);
        }
        while (source.SelectedItems.Count > 0)
        {
            source.Items.Remove(source.SelectedItems[0]);
        }
    }

    private void button1_Click(object sender, EventArgs e)
    {
        MoveListBoxItems(listBox1, listBox2);
    }

    private void button2_Click(object sender, EventArgs e)
    {
        MoveListBoxItems(listBox2, listBox1);
    }
Peter
Telerik team
 answered on 07 Mar 2013
3 answers
216 views
Hi,

I have a RadMaskedEditBox bound to BindingSource which is connected to some column with numeric (Int32) in DataTable in some DataSource.
Values are properly displayed in the control, but I want users to be able to nullify the column value in the table
by deleting existing value from the RadMaskedEditBox and leaving it empty.
Is there any way of configuring RadMaskedEditBox to achieve this? Or maybe some other control is better for the job?
This feature does not exist in standard WinForms TextBox and I am currently searching for the controls that would do that task without any tweaking etc.

Thanks,
Piotr
Peter
Telerik team
 answered on 07 Mar 2013
6 answers
187 views
Hi

I'm having an issue trying to delete appointments programmatically. What I'm doing is handling the AppointmentAdded Event and contrasting the appointment subject (which will contain someones name) against a DB. If the appointment subject (Name) does not appear in the aforementioned DB, then the appointment must be deleted. The problem is that the appointment refuses to be deleted.

Here's the code that I'm using:
Private Sub RadScheduler1_AppointmentAdded(sender As Object, e As Telerik.WinControls.UI.AppointmentAddedEventArgs) Handles RadScheduler1.AppointmentAdded
      Dim app As AppointmentWithPhone = TryCast(e.Appointment, AppointmentWithPhone)
 
      If NameExistsInDB(app.Subject) = False Then
          Debug.WriteLine("Before: " & RadScheduler1.Appointments.Count)
 
          Me.RadScheduler1.Appointments.Remove(app)
 
          Debug.WriteLine("After: " & RadScheduler1.Appointments.Count)
      End If
  End Sub

The output in both debug cases is the same. If I have two appointments and add a third with a name that does not exist in the DB (thus forcing my application to enter inside the "IF") I get this:

Debug output:
Before: 3
After: 3


Can you help me out? Am I doing it the right way or is there some other way to delete an appointment?
Thanks!
Ivan Petrov
Telerik team
 answered on 07 Mar 2013
2 answers
200 views
Hello, 

I'm Using Telerik For WinForms Q1 2013 . i've Filtered GridView with Excel Like Filtering . 

i want send Filtered Rows to a DataTable and After that  send dataTable to StimulReport . 

My Problem is i want send filtered rows exactly not all of rows and records , 

is there possible ? how can i do that ?
Svett
Telerik team
 answered on 07 Mar 2013
1 answer
154 views

I am creating a hierarchy grid using object relational data.  I am adding a GridViewRelation manually to link the two classes together.  The data loads correctly at first, but then selecting a child row will cause all child rows in that position to be duplicated and selected.

After initial data load, everything looks great.

(See dataload.png)


Select Child 2_1 and all first position children are selected.

(see select1.png)


Select Child 3_2 and now all second position children are selected, and the first position children are now duplicates of each other and read Child 4_1.

(see select2.png)


Here is the code:

namespace TestGrid
{
    public partial class Form1 : Form
    {
        private BindingList<MasterObject> data;
 
        public Form1()
        {
            InitializeComponent();
            SetupGrid();
        }
 
        private void SetupGrid()
        {
            LoadMasterTemplate(grid.MasterTemplate);
            GridViewTemplate childTemplate = new GridViewTemplate();
            LoadChildTemplate(childTemplate);
            grid.MasterTemplate.Templates.Add(childTemplate);
 
            GridViewRelation relation = new GridViewRelation(grid.MasterTemplate, childTemplate);
            relation.RelationName = "Children";
            relation.ChildColumnNames.Add("Children");
            grid.Relations.Add(relation);
        }
 
        private void LoadMasterTemplate(GridViewTemplate template)
        {
            template.Columns.Clear();
            template.EnableFiltering = false;
            template.AllowAddNewRow = false;
            template.ShowChildViewCaptions = false;
            template.AutoGenerateColumns = false;
            template.EnableGrouping = false;
 
            GridViewTextBoxColumn colNode = new GridViewTextBoxColumn("NodeDesc");
            colNode.HeaderText = "Node";
            colNode.Name = "Node";
            colNode.ReadOnly = true;
            template.Columns.Add(colNode);
 
            GridViewTextBoxColumn colName = new GridViewTextBoxColumn("Name");
            colName.HeaderText = "Name";
            colName.Name = "Name";
            template.Columns.Add(colName);
 
            template.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill;
        }
 
        private void LoadChildTemplate(GridViewTemplate template)
        {
            template.Columns.Clear();
            template.EnableFiltering = false;
            template.EnableGrouping = false;
            template.AllowAddNewRow = false;
            template.AutoGenerateColumns = false;
 
            GridViewTextBoxColumn colNode = new GridViewTextBoxColumn("NodeDesc");
            colNode.HeaderText = "Node";
            colNode.Name = "Node";
            colNode.ReadOnly = true;
            template.Columns.Add(colNode);
 
            GridViewTextBoxColumn colIP = new GridViewTextBoxColumn("Name");
            colIP.Name = "Name";
            colIP.HeaderText = "Name";
            template.Columns.Add(colIP);
 
            template.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill;
        }
 
        private void LoadData()
        {
            data = new BindingList<MasterObject>();
 
            for (int i = 1; i < 5; i++)
            {
                MasterObject m = new MasterObject();
                m.Name = "Master " + i;
                for (int x = 1; x < i; x++)
                {
                    ChildObject c = new ChildObject();
                    c.Name = "Child " + i + "_" + x;
                    m.Children.Add(c);
                }
                data.Add(m);
            }
 
            grid.DataSource = data;
        }
 
        private void button1_Click(object sender, EventArgs e)
        {
            // Load Data In Grid
            LoadData();
        }
 
        private void button2_Click(object sender, EventArgs e)
        {
            // Add Child to 1
            MasterObject m = data[0];
            ChildObject c = new ChildObject();
            c.Name = "Child " + "1_" + (m.Children.Count + 1);
            m.Children.Add(c);
        }
 
        private void button3_Click(object sender, EventArgs e)
        {
            // Add Child to 2
            MasterObject m = data[1];
            ChildObject c = new ChildObject();
            c.Name = "Child " + "2_" + (m.Children.Count + 1);
            m.Children.Add(c);
        }
    }
 
    public class MasterObject
    {
        private string name;
        public string Name
        {
            get
            {
                return name;
            }
            set
            {
                if (name != value)
                {
                    name = value;
                }
            }
        }
 
        public string NodeDesc
        {
            get
            {
                return "MasterObject";
            }
        }
 
        private BindingList<ChildObject> children;
        public BindingList<ChildObject> Children
        {
            get
            {
                return children;
            }
            set
            {
                children = value;
            }
        }
 
        public MasterObject()
        {
            children = new BindingList<ChildObject>();
        }
    }
 
    public class ChildObject
    {
        private string name;
        public string Name
        {
            get
            {
                return name;
            }
            set
            {
                if (name != value)
                {
                    name = value;
                }
            }
        }
 
        public string NodeDesc
        {
            get
            {
                return "ChildObject";
            }
        }
 
        public ChildObject() { }
    }
}
Svett
Telerik team
 answered on 07 Mar 2013
Narrow your results
Selected tags
Tags
GridView
General Discussions
Scheduler and Reminder
Treeview
Dock
RibbonBar
Themes and Visual Style Builder
ChartView
Calendar, DateTimePicker, TimePicker and Clock
DropDownList
Buttons, RadioButton, CheckBox, etc
ListView
ComboBox and ListBox (obsolete as of Q2 2010)
Form
Chart (obsolete as of Q1 2013)
PageView
MultiColumn ComboBox
TextBox
RichTextEditor
PropertyGrid
Menu
RichTextBox (obsolete as of Q3 2014 SP1)
Panelbar (obsolete as of Q2 2010)
PivotGrid and PivotFieldList
Tabstrip (obsolete as of Q2 2010)
MaskedEditBox
CommandBar
PdfViewer and PdfViewerNavigator
ListControl
Carousel
GanttView
Diagram, DiagramRibbonBar, DiagramToolBox
Panorama
New Product Suggestions
VirtualGrid
Toolstrip (obsolete as of Q3 2010)
AutoCompleteBox
Label
Spreadsheet
ContextMenu
Panel
Visual Studio Extensions
TitleBar
Documentation
SplitContainer
Map
DesktopAlert
CheckedDropDownList
ProgressBar
TrackBar
MessageBox
Rotator
SpinEditor
CheckedListBox
StatusStrip
LayoutControl
SyntaxEditor
Wizard
ShapedForm
TextBoxControl
CollapsiblePanel
Conversational UI, Chat
DateTimePicker
TabbedForm
CAB Enabling Kit
GroupBox
WaitingBar
DataEntry
ScrollablePanel
ScrollBar
ImageEditor
Tools - VSB, Control Spy, Shape Editor
BrowseEditor
DataFilter
FileDialogs
ColorDialog
Gauges (RadialGauge, LinearGauge, BulletGraph)
ApplicationMenu
RangeSelector
CardView
WebCam
BindingNavigator
Styling
Barcode
PopupEditor
RibbonForm
TaskBoard
Callout
NavigationView
ColorBox
PictureBox
FilterView
Accessibility
VirtualKeyboard
DataLayout
Licensing
ToastNotificationManager
ValidationProvider
CalculatorDropDown
Localization
TimePicker
BreadCrumb
ButtonTextBox
FontDropDownList
BarcodeView
Security
LocalizationProvider
Dictionary
SplashScreen
Overlay
Flyout
Separator
SparkLine
TreeMap
StepProgressBar
ToolbarForm
NotifyIcon
DateOnlyPicker
AI Coding Assistant
Rating
TimeSpanPicker
Calculator
OfficeNavigationBar
TaskbarButton
HeatMap
SlideView
PipsPager
AIPrompt
TaskDialog
TimeOnlyPicker
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?