Telerik Forums
UI for WinForms Forum
4 answers
135 views

I need AutoComplete functionality for RadTextBoxControl that will allow me to identify the object selected by the user.


Public Class Person
    Public Property GuidPerson As Guid
    Public Property FirstName As String
    Public Property LastName As String
    Public ReadOnly Property FullName As String
        Get
            Return String.Format("{0} {1}", FirstName, LastName)
        End Get
    End Property
    Public Sub New(fName As String, lname As String)
        GuidPerson = Guid.NewGuid
        FirstName = fName
        LastName = lname
    End Sub
End Class

Public Class RadForm4
    Private listPerson As New List(Of Person)
    Public Sub New()
        InitializeComponent()

        listPerson.Add(New Person("John", "Snow"))
        listPerson.Add(New Person("Arya", "Stark"))
        listPerson.Add(New Person("Brandon", "Stark"))
        listPerson.Add(New Person("Catelyn", "Stark"))

        RadTextBoxControl1.AutoCompleteMode = AutoCompleteMode.Suggest
        RadTextBoxControl1.AutoCompleteDataSource = listPerson
        RadTextBoxControl1.AutoCompleteDisplayMember = "FullName"

    End Sub
    Private Sub RadButton1_Click(sender As Object, e As EventArgs) Handles RadButton1.Click
        'HOW TAKE 'GuidPerson' from selected item in RadTextBoxControl1
    End Sub
End Class

How to capture a user-selected object?

For example, in RadDropDownList I would do it like this:

Dim searchValue As Person = TryCast(RadDropDownList1.SelectedItem.DataBoundItem, Person)

I don't want to use RadAutoCompleteBox because I want to display the results text and not tokens

Regards

Jack


 

 

Jacek
Top achievements
Rank 2
Iron
Iron
Iron
 answered on 05 Oct 2022
1 answer
111 views

Hello,

i'm trying to use the scheduler as a planner. 

I've got a EF Model

Shifts

    public partial class Shifts
    {
        public int empId { get; set; }
        public int Id { get; set; }
        public int day { get; set; }
        public System.DateTime start { get; set; }
        public System.DateTime end { get; set; }
        public int location { get; set; }
    
        public virtual employee employee { get; set; }
    }

Locations

    public partial class location
    {
        public location()
        {
            this.Shifts = new HashSet<Shifts>();
        }
    
        public int Id { get; set; }
        public string name { get; set; }
   
        public virtual ICollection<Shifts> Shifts { get; set; }

    }

Employee


public partial class employee
    {
        public employee()
        {
            this.aktiveSchichten = new HashSet<Shifts>();
        }
    
        public int Id { get; set; }
        public string firstName { get; set; }
        public string lastName { get; set; }

        public virtual ICollection<aktiveSchichten> aktiveSchichten { get; set; }
    }

How do i add start and end for single schedulers by day - possibly integer 0-6? I'm trying to display weekly timeprofiles to load/save

 var mitarbeiter = db.employee;
            var schichten = db.Shifts.Where(a => a.location == (int)radMultiColumnComboBox2.SelectedValue);
            foreach (var schicht in schichten)
            {
                radScheduler1.Appointments.BeginUpdate();
                int count = 1;
                foreach (var ma in mitarbeiter)
                {
                    this.radScheduler1.Resources.Add(new Resource(count++, ma.firstName + ma.lastName));
                }
                DateTime start = ?;
                DateTime end = ?;
                Appointment appointment1 = new Appointment(start, end, schicht.employee.firstName + schicht.employee.firstName, "test");
                appointment1.BackgroundId = (int)AppointmentBackground.Anniversary;
                appointment1.StatusId = (int)AppointmentStatus.Unavailable;
                radScheduler1.Appointments.Add(appointment1);
                radScheduler1.Appointments.EndUpdate();
           }


 

Maria
Telerik team
 answered on 05 Oct 2022
1 answer
148 views

Using available examples, applying different formatting to row header does not work as the RowElement never comes in as a GridTableHeaderRowElement. New rows are formatting correctly.

 

 private void RadGridView1_RowFormatting(object sender, RowFormattingEventArgs e)
        {
            try
            {
                if ((string)e.RowElement.RowInfo.Tag == "new row")
                {
                    e.RowElement.DrawFill = true;
                    e.RowElement.BackColor = System.Drawing.Color.LightCyan;
                    e.RowElement.ForeColor = System.Drawing.Color.Black;
                    e.RowElement.Text = "New";
                    e.RowElement.TextAlignment = System.Drawing.ContentAlignment.TopLeft;
                }
                else if (e.RowElement is GridTableHeaderRowElement)
                {
                    e.RowElement.DrawFill = true;
                    e.RowElement.BackColor = System.Drawing.Color.Navy;
                    e.RowElement.NumberOfColors = 1;
                    e.RowElement.ForeColor = System.Drawing.Color.White;
                    e.RowElement.Text = "";
                }
                else
                {
                    e.RowElement.ResetValue(LightVisualElement.DrawFillProperty, Telerik.WinControls.ValueResetFlags.Local);
                    e.RowElement.ResetValue(LightVisualElement.BackColorProperty, Telerik.WinControls.ValueResetFlags.Local);
                    e.RowElement.ResetValue(LightVisualElement.NumberOfColorsProperty, Telerik.WinControls.ValueResetFlags.Local);
                    e.RowElement.ResetValue(LightVisualElement.ForeColorProperty, Telerik.WinControls.ValueResetFlags.Local);
                    e.RowElement.Text = "";
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show($"Uncaught error in {System.Reflection.MethodBase.GetCurrentMethod().Name}: {ex.Message}");
            }
        }

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 05 Oct 2022
1 answer
144 views

Hello

 

I want to format the thousand separators in a PIVOTVIEW

My Code :

                e.CellElement.GradientStyle = Telerik.WinControls.GradientStyles.Solid;
                e.CellElement.ForeColor = Color.LightGreen;
                e.CellElement.Alignment = ContentAlignment.MiddleRight;
                //e.CellElement.Text = String.Format("{0:N3}");

the ForeColor is working,

but aligment right does not work ( see screen below)

and string format gives error

Maria
Telerik team
 answered on 04 Oct 2022
1 answer
206 views

Is it possible to serialize a spreadsheet?

My app has a way that it can save text-only data (but not .xls or other files) and I'd like to save the current contents of a RadSpreadsheet control, so I can open it again later. This would let my users add/remove columns, add/remove charts etc.

Is there an easy way to do this?

Dimitar
Telerik team
 answered on 04 Oct 2022
3 answers
128 views

Hi all,

When inserting a row everything goes okay.
But when I delete that same row again using the radgridview contextmenu option Delete Row

Then the debugger shows the following error massage:
'System.Data.DBConcurrencyException: 'Concurrency violation: the DeleteCommand affected 0 of the expected 1 records.''

My code is below.

What am I doing wrong?

Chris.

 public partial class mainForm : Form
    {

        public static OleDbConnection con3 = new OleDbConnection(@"Provider=Microsoft.ACE.OLEDB.12.0;Data Source = " + Application.StartupPath + "\\parts.accdb");
        public static DataTable dt = new DataTable();
        public OleDbDataAdapter adapter;
        public OleDbCommandBuilder commandbuider;
        public mainForm()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            string SQL = "SELECT * from supplier";
            adapter = new OleDbDataAdapter(SQL, con3);
            commandbuider = new OleDbCommandBuilder(adapter);

            adapter.Fill(dt);

            PartsGrid.DataSource = dt;

            PartsGrid.RowsChanged  += new GridViewCollectionChangedEventHandler(PartsGrid_Update);

        }

        private void PartsGrid_Update(object sender, GridViewCollectionChangedEventArgs e)
        {
            if (adapter.Update(dt) > 0)
            {
                MessageBox.Show("done");
            }
        }
    }

 

Chris
Top achievements
Rank 2
Iron
 answered on 04 Oct 2022
1 answer
101 views

I use Telerik.WinControls.UI.RadChartView

I try to use RadChartView for show graphical lines. I have prepared series of ScatterLineSeries and upload its to RadChartView.Series. First page can show successfully. Unfortunately I can not show next page. I setting break after uploading data to RadChartView. Visual Studio mark by red color any changes (differences) in RadChartView properties and data.

I can see only small changes in data value and no more.

So, data for showing on second page is similar to data on the first page. However RadChartView show absolutely empty page.

Can anybody advice for me, what checklist I can pass to understand why second page is clear blank page?

 

 

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 04 Oct 2022
1 answer
101 views

Easy to reproduce.

Unzip attached. I've only included the project as the zipped solution with its lib was too big to upload.

In function that's located in a RadForm

void DoSomething(Form form)
{
  MessageBox.Show(form.FormBorderStyle.ToString());

  MessageBox.Show(this.FormBorderStyle.ToString());

}

It returns "none" if form is a RadForm. The 2nd messagebox shows "sizeable" as this is a radform.

I wondered why it's doing this if a RadForm is a descendent.

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 03 Oct 2022
1 answer
608 views
Hello good day,
Help me with this I know it's something simple but I can't find it.
how to print automatically without showing the report viewer a telerik report made in vb.net

the report has a parameter and I would like it to be printed automatically
Justin
Telerik team
 answered on 30 Sep 2022
0 answers
135 views
Hello good day,
Help me with this I know it's something simple but I can't find it.
how to print automatically without showing the report viewer a telerik report made in vb.net

the report has a parameter and I would like it to be printed automatically
Hector
Top achievements
Rank 1
 asked on 29 Sep 2022
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
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Iron
Iron
Andrey
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Iron
Iron
Andrey
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?