Telerik Forums
UI for WinForms Forum
1 answer
139 views

Hi

When the combined width occupied by rowheaders and columnheaders is less than the width of the container of pivotgrid, horizontal scrollbar appears on the screen.

But when the row headers alone occupy width more than the width of the container of pivotgrid, horizontal scrollbar does not appear. Enabling autoscroll on the container of pivotgrid does not help in this case.

Hristo
Telerik team
 answered on 12 Jan 2018
2 answers
170 views

hi

im using 

design a radMultiComboBox with 3 column(two column is visible) and one column to select "ValueMember". use the below code for "filtering" :

1.customerlist.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
2.CompositeFilterDescriptor compositeFilter = new CompositeFilterDescriptor();
3.FilterDescriptor prodName = new FilterDescriptor("FullName", FilterOperator.Contains, "");
4.compositeFilter.FilterDescriptors.Add(prodName);
5.compositeFilter.LogicalOperator = FilterLogicalOperator.Or;
6.this.customerlist.EditorControl.FilterDescriptors.Add(compositeFilter);

 

every thing work perfectly, but in my project, when user type the name that not in DB, the application show the messagebox and open new form to add item into database.

private void customerlist_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
            {
                if (!string.IsNullOrEmpty(customerlist.Text))
                {
                    string name = customerlist.Text;
                    rollback:
                    if (_db.Customer.Any(p => p.FullName.Contains(customerlist.Text.Trim())))
                    {
                        int id = int.Parse(customerlist.SelectedValue.ToString());
                        var result = _db.Customer.First(p => p.CustomerId == id);
                        txttel.Text = result.HomeTel;
                        txtmobile.Text = result.Mobile;
                        txtaddress.Text = result.Address;
                        SendKeys.Send("{tab}");
                        str = null;
                    }
                    else
                    {
                        RadMessageBox.Show(this, "مشتری جدید باید در لیست مشتریان ثبت شود");
 
                        using (FrmAddPerson frm = new FrmAddPerson())
                        {
                            frm.txtfullname.Text = customerlist.Text;
                            frm.radGroupBox1.Enabled = false;
                            frm.radGridView1.Enabled = false;
                            frm.ShowDialog();
                        }
                        cCustomer();
                        customerlist.Text = name;
                        goto rollback;
 
                    }
                }
            }
        }

when user press enter, this code should be work, but radmulticolumncombobox.Text property, is null (" "). while must be show what's user typed in combobox.

for example, in radmulticolumncombobox.Datasource, these exist : john,david,oliver , and user input : jason => radmulticolumncombobox.Text should be = "jason", but it's null.

Mehdi
Top achievements
Rank 1
 answered on 12 Jan 2018
17 answers
1.3K+ views
I read many of the posts here on how to properly set BeginEdit to programmatically set a cell into Edit mode. However, the code is not working for me.

Here is the code I am using:
Dim currentCell = RemindersGridView.Rows(RemindersGridView.Rows.Count - 1).Cells(2)
currentCell.RowInfo.IsCurrent = True
currentCell.ColumnInfo.IsCurrent = True
currentCell.BeginEdit()

It does not work under these circumstances:
1) The second time the code is called.
I have the code in an Add button, so when the user clicks Add to add a new row, the 3rd cell is automatically opened for edit. This works the first time I click the Add button. But if I press it a second time, it does not work. I tried to call EndEdit before this code, and that did not help.

2) If the cell is a drop down list.
If the cell to automatically open for edit is a drop down list, the code does not work. It does not show the comboBox editor.

Any tips for fixing either of these issues is appreciated!

thanks!
Hristo
Telerik team
 answered on 12 Jan 2018
1 answer
4.2K+ views

hi,

in a winforms app, i am using a RadGridView with MultiSelect = true and i am trying to create a column with check-boxes that will be checked for each row that is selected.
i want this column to work in both ways:
  1) the check-boxes should update themselves each time the list of selected rows is changed.
  2) the user should be able to select additional rows by checking the check-boxes in this column.

currently i was able to implement the first request (the check-boxes are updating themselves according to the selected rows), but not the second one.

i subscribed to the SelectionChanged event of the grid, i unchecked the previously selected check-boxes and then checked the ones from the currently selected rows. here is the code:


        private readonly List<GridViewRowInfo> previouslySelectedRows = new List<GridViewRowInfo>();

        private void HandleGridSelectionChanged(object sender, EventArgs e)
        {
                UnCheckPreviouslySelectedRows();
                CheckCurrentlySelectedRows();
                StoreCurrentlySelectedRows();
        }

        private void UnCheckPreviouslySelectedRows()
        {
            foreach (GridViewRowInfo row in previouslySelectedRows)
            {
                row.Cells["Select"].Value = false;
            }
        }

        private void CheckCurrentlySelectedRows()
        {
            IEnumerable<GridViewCellInfo> cells = radGridView1.SelectedRows
                .Select(x => x.Cells["Select"]);

            foreach (GridViewCellInfo cell in cells)
            {
                cell.Value = true;
            }
        }

        private void StoreCurrentlySelectedRows()
        {
            previouslySelectedRows.Clear();
            previouslySelectedRows.AddRange(radGridView1.SelectedRows);
        }

did someone implement something similar?
can someone help me with the second task (to let the user select/unselect rows by checking/unchecking the check-boxes)?

thank you,
alez

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 12 Jan 2018
1 answer
378 views

I use Telerik WinForm DateTimePicker.
I can customize it with below code:
Font headerFont = new Font( "Arial", 9.0f, FontStyle.Bold );Font datesFont = new Font( "Arial", 9.0f, FontStyle.Italic );RadDateTimePickerCalendar calendarBehavior = this.radDateTimePicker1.DateTimePickerElement.GetCurrentBehavior() as RadDateTimePickerCalendar;RadCalendar calendar = calendarBehavior.Calendar as RadCalendar;RadCalendarElement calendarElement = calendar.CalendarElement as RadCalendarElement; calendarElement.CalendarNavigationElement.Font = headerFont; calendarElement.CalendarNavigationElement.ForeColor = Color.Yellow; calendarElement.CalendarNavigationElement.BackColor = Color.White; calendarElement.CalendarNavigationElement.BackColor2 = Color.Gray; calendarElement.CalendarNavigationElement.BackColor3 = Color.DarkGray; calendarElement.CalendarNavigationElement.BackColor4 = Color.Gainsboro; calendarElement.CalendarNavigationElement.BorderColor = Color.DarkGray;MonthViewElement monthView = calendarBehavior.Calendar.CalendarElement.CalendarVisualElement as MonthViewElement;foreach ( RadItem item in monthView.TableElement.Children ){ item.Font = datesFont;}int outint;foreach ( CalendarCellElement cell in ( ( MonthViewElement ) calendarBehavior.Calendar.CalendarElement.Children[ 0 ].Children[ 2 ] ).TableElement.Children ){if ( !int.TryParse( cell.Text, out outint ) ){ cell.Font = new Font( this.radDateTimePicker1.Font.FontFamily, 12 );}}
How can I change the month select font?

 

and also i want set these customization when navigation and select month in zoom or popup

 

Could you help me?

Hristo
Telerik team
 answered on 11 Jan 2018
3 answers
309 views

Hi

1. If the current filter output has no results, what is the proper way to update the datasource of virtualgrid so that it shows no data message and when the filter is reset, it properly populates the virtualgrid again. I am unable to do so; once an empty dataset is set as source, I am unable to repopulate the virtualgrid when the filter is removed. Can you provide an example which uses datatable as datasource rather than a list (as shown in other examples).

2. I want to also add my own custom filtering option to imeplement a regex based filtering (similar to contains,startswith etc).How can I do this.

3. The examples and docs show that data must be re-fetched from the database to update the grid. Since I have millions of rows, I want to know what is the better choice for filtering - re-fetching the data from the database or filtering in-app using LINQ? 

Thanks.

 

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 10 Jan 2018
4 answers
583 views
I wanted to use RadPopupEditor with a gridview as an associated Control to implement a multiselectmultiColumncombobox.

In Design time, my User Control has a radPopUpEditor and a gridview. I am trying to set the value of radPopUpEditor.AssociatedControl within the property window when an exception occurs saying "Error using the dropdown: Unable to cast object of type 'System.Windows.Forms.UserControl' to type 'System.Windows.Forms.Form'".

I did the same on a form with the same controls (a radPopUpEditor and a radgridview).
Though No Error exception occurs, the gridview is not available choice in the AssociatedControl Property.

With this, I have two questions.

1. Is it possible to use radPopUpEditor within a User Control? 
2. what type of controls can I use to as RadPopupEditor.AssociatedControl?

Abbas
Top achievements
Rank 1
Iron
 answered on 10 Jan 2018
4 answers
934 views

I need to be able to programmatically get a list of the column headers that are currently being displayed in the grid.  I.e. my grid has 8 columns; however, the user may have changed the order and hidden some of the remaining columns (via the column chooser). 

How do I ask the grid to give me the columns currently displayed and in left to right order?

Chris Kirkman
Top achievements
Rank 1
 answered on 09 Jan 2018
2 answers
367 views

Hi

I have two radlistviews in a radpageview control in stack viewmode. Both the listviews can potentially have large amounts of data (> 5 million rows) simultaneously. Both the lists need to be loaded when application starts and display a flat list of items (without grouping and sorting) but I need the filtering functionality.

1. I want to show a waiting sign (or a progressbar if possible) so that the user knows he has to wait for the list to load before starting any interactions.It will be good if the lists can be populated in chunks rather than all at once.

2. I want display the details of the selected item when the user double clicks or press enter key on any dataitem. How do I achieve this.

3. I feel ashamed to ask this one - Can I access the selected item text anytime I need it directly from the control or I can only access it on some event and need to store it somewhere for later use?

4. I load the data to populate the lists from the database as dataset using async/await method.The step where I assign the dataset as datasource to listview is very time consuming and makes my application hang.I am not binding the data to the lists as described in the docs here. I simply set the datasource, datamember and displaymember properties.

From a performance perspective, is it a better approach to bind the data as described in the docs?

Please suggest a high performance solution so that my app does not hang or freeze and can easily handle data upto 10 million items per list at least.

Thanks.

Rohit
Top achievements
Rank 1
 answered on 09 Jan 2018
4 answers
215 views

Hello --

I am using the following to populate a datagrid and to setup hierarchical relationships for a parent/child grid:

 

private void radButton1_Click(object sender, EventArgs e)
        {
 
            FlexEDIEntities db = new FlexEDIEntities();
 
            var gridData = (from d in db.billing_transactions
                            where d.status == 1
                            select new
                            {
                                d.Id,
                                d.stop_details.con_name,
                                d.stop_details.con_address1,
                                d.stop_details.con_city,
                                d.weight_billed,
                                d.base_amount,
                               count =  d.billing_transaction_accessorial_charge.Count
                            }).ToList();
 
 
            main_grid.DataSource = gridData;
            if (this.main_grid.Relations.Count == 0) // does not exist yet
            {
                
            GridViewRelation relation = new GridViewRelation(this.main_grid.MasterTemplate);
            relation.ChildTemplate = accessorial_template;
            relation.RelationName = "TransToCharges";
            relation.ParentColumnNames.Add("Id");
            relation.ChildColumnNames.Add("billing_transaction_id");
            this.main_grid.Relations.Add(relation);
 
            }
        }

 

I have a lot of these to do in this project so I am trying to not have to have a bunch of extra data sources in the project.

It is not necessary that the datagrid update the underlying data source as edits will be handled by dedicated screens.
Can I set up the child data source using a linq query, either by modifying the one above or having a second one that is dedicated for the child relationship?

 

Thank you --

 

Joe

Hristo
Telerik team
 answered on 09 Jan 2018
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
MessageBox
TrackBar
Rotator
SpinEditor
CheckedListBox
StatusStrip
LayoutControl
ShapedForm
SyntaxEditor
Wizard
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
Overlay
Security
LocalizationProvider
Dictionary
SplashScreen
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
Top achievements
Rank 1
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ivory
Top achievements
Rank 1
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
YF
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Top achievements
Rank 1
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ivory
Top achievements
Rank 1
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
YF
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?