Telerik Forums
UI for WinForms Forum
1 answer
237 views

Hi,

I am using the radSchduler for a new project. I encountered and error when trying to save a modified appointment.

"Update requires a valid UpdateCommand when passed DataRow collection with modified rows."

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 19 Oct 2021
1 answer
145 views

Hi

is there any way to change the font of the add new row in WinForms grid view

thanks in advance

regards

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 19 Oct 2021
2 answers
248 views

Hi, how do I resolve this error? Please see attachement.

RadScheduler: Error Could not find Schema information for the attribute 'urn:schemas-microsoft.com:xml-msdata:UseCurrentLocale'.

Thanks and best regards,

Dominic

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 18 Oct 2021
1 answer
156 views

I want to implement my own version of load on demand feature for RadCheckedDropDownList (if there's already one that meets my requirements then sorry for posting).

When the RadCheckedDropDownList's  OnKeyUp event happens for alphanumeric char I want to send async request to my ASP.NET Web Service - when webservice's request is completed I want to either (both options are viable for me):

a) add new items (that are not already existing) to the DataSource,

b) save somewhere items that are already checked and load items to the DataSource,

and show Popup scrolled to the item that is matching the text that already user inserted into RadCheckedDropDownList's RadCheckedDropDownListEditableAreaElement.

My code so far:


private void LoadOnDemandCompleted( object sender, GetDropDownMenuItemsPagedCompletedEventArgs e )
{
	//RadCheckedDropDownListOnDemand - my class that inherits RadCheckedDropDownList
	if ( e.Error != null || e.Result == null || (int)e.UserState != this.RadCheckedDropDownListOnDemand.RequestId )
	{
		//WS call errored out, nothing was returned, or the request number is not matching
		return;
	}

	if ( !( this.RadCheckedDropDownListOnDemand.DataSource is List<RadCheckedListDataItem> mainDataSource ) )
		return;

	//Properties explanation:
	//Value == string to display
	//Id == id in database
	//ChoiceOrder - order in which the RadCheckedListDataItem should appear -> lower ChoiceOrder means it is higher on the list

	var itemsFiltered = e.Result.Select( re => new RadCheckedListDataItem( re.Value )
	{
		Value = re.Id,
		Tag = re.ChoiceOrder,
	} )
	.Where( item => !mainDataSource.Any( mainDataSourceItem => (int)item.Value == (int)mainDataSourceItem.Value ) )
	.ToList();

	//don not want to add items that are already existing in 
	if ( itemsFiltered.Count > 0 )
	{					
		mainDataSource.AddRange( itemsFiltered );

		//want to refresh item list for CheckedDropDownListElement
		if ( !( this.RadCheckedDropDownListOnDemand.CheckedDropDownListElement.DataSource is List<RadCheckedListDataItem> listElementDataSource ) )
			return;

		listElementDataSource.AddRange( itemsFiltered );

		//this does not show the newly added items
		this.RadCheckedDropDownListOnDemand.CheckedDropDownListElement.ShowPopup();				
	}
}

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 18 Oct 2021
2 answers
415 views
When I move a TaskBoard card up or down within a TaskBoard Column, how do I get the Index location for the card that was moved?
Dess | Tech Support Engineer, Principal
Telerik team
 answered on 18 Oct 2021
1 answer
176 views

With certain sizes of RadTextBoxControl, the selected text does not get highlighted properly. Some lines are not highlighted, even though they are selected.

I have attached a sample project that shows the issue. Just run the project and you will see it.

Stoyan
Telerik team
 answered on 15 Oct 2021
2 answers
597 views

Ok, this one's just weird. The Close (X) button on MessageBox's  TitleBar is not working. I click on it and nothing happens.

ds = Telerik.WinControls.RadMessageBox.Show(Me, "Are you sure?", "Clear form", MessageBoxButtons.YesNo, RadMessageIcon.Question, MessageBoxDefaultButton.Button1)

Help.

Edit: interestingly, it's the same with regular (native) MessageBox. As if the button is disabled. But why even show it then?

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 15 Oct 2021
1 answer
572 views

Hello,

I would like to display multiline text with a varying text length on my user interface.
As the space on the device display is quite limited, but the displayed text sometimes pretty long, I thought about using a multiline radTextbox or a radRichTextEditor rather than simple labels, as they provide the autoscroll property which would work perfectly for varying text lengthes.
As the textboxes would be there only for displaying purposes (the text shouldn't be editable), i thought their property "focusable = false" would be the solution to prevent the controls from getting focused and therefore from getting edited.
Unfortunately, both the radTextBox and radRichTextEditor stay focusable even if the property is set to false. Also in combination with IsReadOnly = true the controls still gain focus when clicking on them. Is there another property which needs to be modified in combination to make focusable = false work?

Thank you in advance for your help and have a nice day!

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 15 Oct 2021
1 answer
153 views

It would be nice if we had 2 more events on the columns as well

TaskBoardColumnCollapsing, TaskBoardColumnCollapsed

These would be necessary when the control is database driven since the TaskBoardColumnCollapsed would trigger a database update for the TaskBoardColumns Table.

If it's already there... can you tell me how I can access that event?

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 14 Oct 2021
1 answer
138 views

Hello , i want to see if GridViewMultiComboBox is suitable for our application and i want the end user to type any text gridview multicombo box column and i checked  https://www.telerik.com/forums/editable-values-for-new-row-using-gridviewmulticomboboxcolumn but it is giving me problem after end user type and add new item to dropdown list editor , when i go to different row and try to change selected value og MultiComboBox , it doesnt fire selectedvalue changed ..

Also when you change the selected value of GridviewMultiComboBox column it should automatically get the price of the item , update gridview item price column , and multiply with quantity column and update total column ,,,it does that but after i added new item manually , it doesnt do that ..Code is below ..If you see the pictures , after added dropdown list item , changing the item from the list doesnt effect the price and item number and total column anymore

 

                                                                    

        private void ERPDataForm_Load(object sender, EventArgs e)
        {

                this.radGridView1.MasterTemplate.AutoGenerateColumns = false;
                this.radGridView1.EnableFiltering = false;
                this.radGridView1.MasterTemplate.ShowHeaderCellButtons = false;
                this.radGridView1.MasterTemplate.ShowFilteringRow = false;
                this.radGridView1.MasterTemplate.EnableGrouping = false;
                this.radGridView1.MasterTemplate.AllowAddNewRow = true;
                this.radGridView1.AddNewRowPosition = SystemRowPosition.Bottom;      
                this.radGridView1.AllowAutoSizeColumns = true;
                this.radGridView1.MasterTemplate.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill;

                GridViewDecimalColumn qtyColumn = new GridViewDecimalColumn();
                qtyColumn.Name = "QtyColumn";
                qtyColumn.HeaderText = "Qty";
                qtyColumn.FieldName = "Quantity";
                qtyColumn.DecimalPlaces = 0;
                qtyColumn.TextAlignment = ContentAlignment.MiddleCenter;
                qtyColumn.Width = 80;
                radGridView1.MasterTemplate.Columns.Add(qtyColumn);

                GridViewDecimalColumn itemIDColumn = new GridViewDecimalColumn();
                itemIDColumn.Name = "itemIDColumn";
                itemIDColumn.HeaderText = "Item ID";
                itemIDColumn.FieldName = "ItemID";
                itemIDColumn.DecimalPlaces = 0;
                itemIDColumn.TextAlignment = ContentAlignment.MiddleCenter;
                itemIDColumn.Width = 100;
                radGridView1.MasterTemplate.Columns.Add(itemIDColumn);

       
                DataTable gg = new DataTable();
                gg = CreateDataTable2();
                GridViewMultiComboBoxColumn descriptionColumn = new GridViewMultiComboBoxColumn();
                descriptionColumn.DataSource = gg;
                descriptionColumn.Name = "DecriptionColumn";
                descriptionColumn.HeaderText = "Description";
                descriptionColumn.DisplayMember = "DescX";
                descriptionColumn.FieldName = "ItemID";

                descriptionColumn.ValueMember = "ItemIDX";
                descriptionColumn.DropDownStyle = RadDropDownStyle.DropDown;
                descriptionColumn.AutoCompleteMode = AutoCompleteMode.Suggest;
                descriptionColumn.Width = 500;
                descriptionColumn.AutoSizeMode = BestFitColumnMode.AllCells;          


                radGridView1.MasterTemplate.Columns.Add(descriptionColumn);

                GridViewDecimalColumn itemPriceColumn = new GridViewDecimalColumn();
                itemPriceColumn.Name = "itemPriceColumn";
                itemPriceColumn.HeaderText = "Unit Price";
                itemPriceColumn.FieldName = "ItemPrice";
                itemPriceColumn.DecimalPlaces = 2;
                itemPriceColumn.TextAlignment = ContentAlignment.MiddleRight;
                itemPriceColumn.Width = 120;
                itemPriceColumn.FormatString = "${0:###,###0.00}";

                radGridView1.MasterTemplate.Columns.Add(itemPriceColumn);

                GridViewDecimalColumn itemTotalColumn = new GridViewDecimalColumn("Total Amount");
                itemTotalColumn.Name = "itemTotalColumn";
                itemTotalColumn.HeaderText = "TOTAL";
                itemTotalColumn.FieldName = "ItemTotal";
                itemTotalColumn.Width = 110;
                itemTotalColumn.Expression = "itemPriceColumn * QtyColumn";
                itemTotalColumn.FormatString = "${0:###,###0.00}";
                radGridView1.MasterTemplate.Columns.Add(itemTotalColumn);

                BusinessLayerInvoiceItems BLII = new BusinessLayerInvoiceItems();

                ArrayList al = new ArrayList();
                al = BLII.GetInvoiceItemsbyInvoiceID(INVOICEID);          

                this.radGridView1.DataSource = al;


                this.radGridView1.CellEditorInitialized += new GridViewCellEventHandler(radGridView1_CellEditorInitialized);
               this.radGridView1.EditorRequired += new EditorRequiredEventHandler(radGridView1_EditorRequired);

               this.radGridView1.CellBeginEdit += new GridViewCellCancelEventHandler(radGridView1_CellBeginEdit);       

}

  private DataTable CreateDataTable2()
  {

            DataTable dtable2 = new DataTable();
            //set columns names
            dtable2.Columns.Add("ItemIDX", typeof(System.Int32));
            dtable2.Columns.Add("Descx", typeof(System.String));            
            dtable2.Columns.Add("ItemPrice", typeof(System.String));
            dtable2.Columns.Add("ItemQuantity", typeof(System.String));


            BusinessLayerItem BLC = new BusinessLayerItem();
            ArrayList al = new ArrayList();
            Item c = new Item();


            al = BLC.GetItems();

            DataRow drowX = dtable2.NewRow();

            drowX["ItemIDX"] = -1;
            drowX["DescX"] = "";            
            drowX["ItemPrice"] = "";
            drowX["ItemQuantity"] = "";
            dtable2.Rows.Add(drowX);


            for (int i = 0; i < al.Count; i++)
            {



                //Add Rows
                DataRow drow = dtable2.NewRow();

                drow["ItemIDX"] = ((Item)al[i]).ItemId;
                drow["DescX"] = ((Item)al[i]).ItemName.ToUpper();                
                drow["ItemPrice"] = ((Item)al[i]).ItemPrice;
                drow["ItemQuantity"] = ((Item)al[i]).ItemQuantity;
                dtable2.Rows.Add(drow);


            }
            return dtable2;
        }

 

        protected void radGridView1_EditorRequired(object sender, EditorRequiredEventArgs e)
        {
            if (e.EditorType == typeof(RadMultiColumnComboBoxElement) )
            {
                if (!isrowadded)
                {
                    e.EditorType = typeof(CustomRadMultiColumnComboBoxElement);                    
                    isrowadded = false;
                }
                else
                {
                    e.EditorType = typeof(RadMultiColumnComboBoxElement);
                }

            }
        }

        protected void radGridView1_CellEditorInitialized(object sender, GridViewCellEventArgs e)
        {
            RadMultiColumnComboBoxElement mccbEditor = e.ActiveEditor as RadMultiColumnComboBoxElement;

            if (mccbEditor != null)
            {
                FilterDescriptor descriptor = new FilterDescriptor("DescX", FilterOperator.StartsWith, null);
                mccbEditor.EditorControl.FilterDescriptors.Add(descriptor);              
                mccbEditor.AutoSizeDropDownToBestFit = true;
            }            

        }

        bool isColumnAdded;
        void radGridView1_CellBeginEdit(object sender, GridViewCellCancelEventArgs e)
        {
            if (this.radGridView1.CurrentColumn is GridViewMultiComboBoxColumn)
            {
                if (!isColumnAdded)
                {
                    isColumnAdded = true;
                    RadMultiColumnComboBoxElement editor = (RadMultiColumnComboBoxElement)this.radGridView1.ActiveEditor;
                    editor.EditorControl.MasterTemplate.AutoGenerateColumns = false;
                    editor.EditorControl.Columns.Add(new GridViewTextBoxColumn("ItemIDX"));
                    editor.EditorControl.Columns.Add(new GridViewTextBoxColumn("DescX"));
                    editor.EditorControl.Columns.Add(new GridViewTextBoxColumn("ItemPrice"));
                    editor.EditorControl.Columns.Add(new GridViewTextBoxColumn("ItemQuantity"));
                    editor.AutoSizeDropDownToBestFit = true;           


                    editor.SelectedIndexChanged += new EventHandler(ProcCode_multiColumnComboElement_SelectedIndexChanged);

                }
            }
        }


        void ProcCode_multiColumnComboElement_SelectedIndexChanged(object sender, EventArgs e)
        {

            if (radGridView1.ActiveEditor is RadMultiColumnComboBoxElement)
            {
                RadMultiColumnComboBoxElement multiColumnComboElement = (RadMultiColumnComboBoxElement)radGridView1.ActiveEditor;

                    GridViewRowInfo row = multiColumnComboElement.EditorControl.CurrentRow;
                    if (row != null)
                    {
                        radGridView1.CurrentRow.Cells[1].Value = row.Cells[0].Value;
                        radGridView1.CurrentRow.Cells[3].Value = row.Cells[2].Value;                 
                    }

             }                         

   
        }

        bool isrowadded = false;

        private void radGridView1_UserAddedRow(object sender, GridViewRowEventArgs e)
        {     
            GridViewRowInfo rowX = e.Row;
            rowX.Tag = "new row";
            isrowadded = true;
            this.radGridView1.CurrentRow = this.radGridView1.Rows[this.radGridView1.Rows.Count - 1];

        }     

Custom CLASS Below

public class CustomRadMultiColumnComboBoxElement : RadMultiColumnComboBoxElement

    {


        public CustomRadMultiColumnComboBoxElement()

        {

            this.AutoFilter = true;

        }

        protected override Type ThemeEffectiveType

        {

            get

            {

                return typeof(RadMultiColumnComboBoxElement);

            }

        }


   


        public override void ProcessReturnKey(System.Windows.Forms.KeyEventArgs e)

        {

            try

            {

                string text = this.Text;


                if (!string.IsNullOrEmpty(text))

                {


                    GridViewRowInfo newCurrentRow = this.FindItemExact(text) as GridViewRowInfo;


                    if (newCurrentRow == null)

                    {

                        this.AddTextAsRow(text);

                    }

                }


                base.ProcessReturnKey(e);

            }

            catch (Exception ex)

            {

                base.ProcessReturnKey(e);

            }

        }


        public override object Value

        {

            get

            {

                this.AddTextAsRow(this.Text);

                return base.Value;

            }

            set

            {

                base.Value = value;

            }

        }


        private int id = 0;

        private void AddTextAsRow(string text)

        {

            for (int i = 0; i < this.EditorControl.Rows.Count; i++)

            {


                GridViewRowInfo newCurrentRow = this.EditorControl.Rows[i] as GridViewRowInfo;

                string trr = newCurrentRow.Cells[1].Value.ToString();

                if (trr == Text.Trim() || Text.Trim()=="")

                {

                    return;

                }

            }


            

            GridViewDataRowInfo row = (GridViewDataRowInfo)this.EditorControl.Rows.AddNew();

            row.Cells["ItemIDX"].Value = id;

            row.Cells["DescX"].Value = text;

            row.Cells["ItemPrice"].Value = id;

            row.Cells["ItemQuantity"].Value = id;



           // this.EditorControl.Rows.Add(id, text);

            

            id++;

        }

    }

                                                                                  
Dess | Tech Support Engineer, Principal
Telerik team
 answered on 13 Oct 2021
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
SplitContainer
Documentation
Map
DesktopAlert
CheckedDropDownList
ProgressBar
MessageBox
TrackBar
Rotator
SpinEditor
CheckedListBox
StatusStrip
CollapsiblePanel
LayoutControl
ShapedForm
SyntaxEditor
Wizard
TextBoxControl
Conversational UI, Chat
DateTimePicker
TabbedForm
CAB Enabling Kit
WaitingBar
GroupBox
DataEntry
ScrollablePanel
ScrollBar
ImageEditor
Tools - VSB, Control Spy, Shape Editor
BrowseEditor
DataFilter
FileDialogs
ColorDialog
Gauges (RadialGauge, LinearGauge, BulletGraph)
ApplicationMenu
RangeSelector
CardView
WebCam
BindingNavigator
RibbonForm
Styling
Barcode
PopupEditor
TaskBoard
NavigationView
Callout
ColorBox
PictureBox
FilterView
Accessibility
VirtualKeyboard
DataLayout
Licensing
ToastNotificationManager
ValidationProvider
CalculatorDropDown
Localization
TimePicker
BreadCrumb
ButtonTextBox
FontDropDownList
BarcodeView
Overlay
Security
LocalizationProvider
Dictionary
TreeMap
StepProgressBar
SplashScreen
Flyout
Separator
SparkLine
ToolbarForm
NotifyIcon
DateOnlyPicker
AI Coding Assistant
Rating
TimeSpanPicker
Calculator
OfficeNavigationBar
TaskbarButton
HeatMap
SlideView
PipsPager
AIPrompt
TaskDialog
TimeOnlyPicker
SpeechToTextButton
+? more
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?