Telerik Forums
UI for WinForms Forum
1 answer
328 views

Hello,

I have an interesting theme issue with the grid. We have many screens where the grid is used to select the data you are working on and then we allow the users to edit fields for the records based on the grid selection.  The editing is done outside of the grid.

When the users are editing data we do not allow them to change the record they are on until they save the data. For this I flip the grid to the disabled state when editing begins, when they save or cancel the edit I then enable the grid.

I have my grid property for "UseDefaultDisabledPaint" to false, which does not grey out the entire grid and leaves it with our color selections.

The issue is the SelectedRow color is turned off. A single SelectedCell from the row is colored, but not the entire row. I need to have the entire row colored when the grid is disabled. I looked into the Visual Style Builder for this property and even in the ADD events I cannot select any property for the row when IsSelected or IsCurrent is true and IsDisabled is also true.

 

Is there a way to accomplish this with the theme or a way I can do it in code on the based grid? Read Only will not work as I need to not allow a selection of the grid. I was considering modifying the RowsChanging event to stop the users from changing rows, but I would have to also code for filtering, sorting and other events. Disabled would do the trick, I just need to get the entire row to remain colored. Can I do this in the theme or in code?

Thank you in advance,

Ben

 

I have attached two screen shots. Enabled and disabled samples.

I can also send our theme if you need it.

 

Dimitar
Telerik team
 answered on 18 Oct 2016
1 answer
132 views

Hello,

 

I am trying to add a custom filter option to the filter context menu that appears when you click the filter button above a column in a gridview.  This custom filter option will search for empty string values "" within the column.  I read some other related forum posts that pointed me towards the 'FilterPopupInitialized' event.  However, when I tried to wire up this event handler, I can never seem to hit a breakpoint set on my code inside this method.

Any thoughts on why I can't seem to get to my breakpoint?  Also, is this the right approach for adding a custom filter option to the gridview filter context menu?

 

Thanks,

Matt

Dimitar
Telerik team
 answered on 17 Oct 2016
5 answers
162 views
Problem:
What should be done to force the Command button to change its content right away, without changing the focus to other cell?

 

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 Telerik.WinControls.UI;
 
namespace GridApp
{
    public partial class RadForm1 : Telerik.WinControls.UI.RadForm
    {
        public RadForm1()
        {
            InitializeComponent();
            radGridView1.Rows.Add(new object[1] { "zero" });
            radGridView1.Rows.Add(new object[1] { "one" });
            radGridView1.Rows.Add(new object[1] { "two" });
            radGridView1.Rows.Add(new object[1] { "three" });
            radGridView1.Rows.Add(new object[1] { "four" });
        }
 
        private void radGridView1_CommandCellClick(object sender, Telerik.WinControls.UI.GridViewCellEventArgs e)
        {
            switch (e.ColumnIndex)
            {
                case 1:
                    RadButtonElement b = (RadButtonElement)((GridCellElement)radGridView1.CurrentCell).Children[0];
                    b.Tag = true ^ (bool)b.Tag;
                    break;
                default:
                    break;
            }
        }
 
        private void radGridView1_CellFormatting(object sender, Telerik.WinControls.UI.CellFormattingEventArgs e)
        {
            if (e.ColumnIndex == 1)
            {
                RadButtonElement b = (RadButtonElement)e.CellElement.Children[0];
                b.ImageAlignment = ContentAlignment.MiddleCenter;
                b.TextAlignment = ContentAlignment.MiddleCenter;
                // set bool data as switch
                if (b.Tag == null) b.Tag = false;
                b.Text = ((bool)b.Tag) ? "locked" : "open";
            }
        }
    }
}

 

 

 

Hristo
Telerik team
 answered on 17 Oct 2016
3 answers
95 views

I have a winform with a radgridview with filtering enabled. The data source is a dataset. The purpose of the form is to make various global updates to a weight column in the database. So for example the user first sets a filter, for example on a specific zipcode, and say that there are 4 rows that meet that condition. Next to the grid I have a text box and a command button. The user inputs the package weight that is for the filtered zip and clicks a submit button. The code then applies the package weight to the filtered records - this works - and all the values for package weight get properly set and are shown in the grid. Then I have a 'save all' button - this is *almost working'.  Previously the code I had in the save button click was:

            this.tblDISTRIBUTIONACTIVITYBindingSource1.EndEdit();
           this.tmcprod1024DataSet1.AcceptChanges();
           nretval = this.tblDISTRIBUTIONACTIVITYTableAdapter1.Update(tmcprod1024DataSet1.tblDISTRIBUTIONACTIVITY);

And in this case, the backend data was never updated, no updates whatsoever.  However, I then read some online posts and realized that I needed to eliminate the "acceptchanges" line. After I eliminated that line things were *almost correct* but still not there yet. Now, taking the example above with 4 filtered records, when I click the save button, if say for example the third record is highlighted in the grid, then the three non-highlighted records get updated on the backend, but the highlighted record  doesn't get updated. Regardless of which row is highlighted at the time of clicking save, the data on the highlighted  row doesn't get updated.  Can someone please explain what is wrong and how I can fix this? Thanks.

The code that changes the weight value in the grid, upon clicking the command button, is as follows:

            foreach (var onerow in radGridView1.ChildRows)
            {
                double dnumber;
                dnumber = Convert.ToDouble(maskedTextBox2.Text);
           
                onerow.Cells["customerratethisorder"].Value = dnumber;

        }

 

 

 

Hristo
Telerik team
 answered on 14 Oct 2016
20 answers
1.8K+ views
Okay quick question. I know I can remove the Maximize, Minimize, and Close button from the top of the Ribbonbar, but how do I remove the one that appears when opening an MDI Child object?

So what happens is that I am using the Ribbonbar on the MDI Parent. When I open a MDI Child I don't want to display the Maximize, Minimize, Close button for it.

I have also tried to do this via the child object using me.minimizebox = false but it still shows up. What is weird is once I use the maximize button on the child form the buttons get removed.

Any help would be appreciated. Oh by the way I am using the shaped form so I don't see any standard window borders.

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 14 Oct 2016
16 answers
1.8K+ views
I am trying to display a set of data grouped by type. I don't want the user to set up the grouping, I just want the grid to appear with the groupings I define.

I found this help topic:
http://www.telerik.com/help/winforms/gridview-grouping-setting-groups-programmatically.html
And wrote the three lines of code that it said to add:

' Set up grouping
Dim descriptor As New GroupDescriptor
descriptor.GroupNames.Add("ReportTypeId", System.ComponentModel.ListSortDirection.Ascending)
Me.ReportGridView.GroupDescriptors.Add(descriptor)

I run the application and I see no groupings. The grid contents look the same.

I assume there is something else I need to do beyond what is in the help topic? Are there some grid settings I need to turn on/off to get this to work?
Dess | Tech Support Engineer, Principal
Telerik team
 answered on 14 Oct 2016
5 answers
81 views

Hi,

I m new to using Telerik controls and working on using a radgridview in my project. I have to bind a string DB column(Y/N) to a check box column in the grid and when user changes the check boxes, appropriate check box state has to be converted as Y/N and save back to the business entity object which was bonded. I have used the type converters to convert the TRUE/FALSE values to Y/N, but for some reason, they are again becoming as TRUE/FALSE before committing the dataset. Can anyone throw some light on whats happening here?

Also not sure about which event to handle when user changes the check boxes and appropriately change corresponding Be updated. Thanks much in advance.

 

Grid column binding with DB column with type converter:

GridViewCheckBoxColumn checkBoxColumn = new GridViewCheckBoxColumn();
checkBoxColumn.DataType = typeof(string);
checkBoxColumn.Name = LocationDo.GenerateSheetsColumn;
checkBoxColumn.FieldName = LocationDo.GenerateSheetsColumn;
checkBoxColumn.HeaderText = "Generate Tests?";
checkBoxColumn.DataTypeConverter = new ToggleStateConverter();
dgvLocations.MasterTemplate.Columns.Add(checkBoxColumn);
dgvLocations.Columns[LocationDo.GenerateSheetsColumn].Width = 55;

 

Property definition:

[TypeConverter(typeof(ToggleStateConverter))]
public string GenerateSheets
{
         get { return _GenerateSheets; }
         set { _GenerateSheets = value; }
}

 

Thanks,

 -Chandra

 

Dimitar
Telerik team
 answered on 14 Oct 2016
6 answers
95 views

Greetings.

I'm newbie, as 2nd day newbie.. never used .net, nor tools like this...

I developed a demo for trying to engage Company Director and purchase tools...

after little strugle, it worked..   My system is built with openedge 11.6.3.

 

When I run the windows desktop application (client networking, prowin32.exe) (client-server and few appserver apps) on Director's windows 10 pc,

Got error about:  "telerik.winforms.radchart" not installed and stuff....  I installed several products from telrik.com, but I bet they are for developing time, not runtime..

 

Is anybody able to guide me on this task?

 

Thanks in advance....

Greetings from Mexico.

Dimitar
Telerik team
 answered on 14 Oct 2016
1 answer
259 views

I would like to decorate the text of my nodes at runtime with a label showing the child count in a different color and font.  How can I achieve this?

 

Dimitar
Telerik team
 answered on 13 Oct 2016
3 answers
154 views

Hi,

I have a radgridview control which has a binding of a data set (A), In a specific scenario couple of columns in A which has a value in it should show in a combo box control which actually have a set of different possible values in it. I have separate data sets(B & C) bound for those combo box columns. However the current value of the column from A should automatically select in the appropriate value of combo boxes of ( B & C) when I load the data. How can I achieve this. Below is the sample code I have.

dgvLocations.DataSource = _LocationBo.Do.Table.DefaultView;  // Main datagridview control data source - A

 

GridViewComboBoxColumn configColumn = new GridViewComboBoxColumn();
dgvLocations.MasterTemplate.Columns.Add(configColumn);
configColumn.HeaderText = "Configuration";
configColumn.DataSource = _LocationConfigCdBo.Do.Table.DefaultView;
configColumn.FieldName = LocationDo.V_ConfigurationColumn;                 // Column name mapping from the A dataset
configColumn.ValueMember = LocationConfigCdDo.TypeCdColumn;           // Column name mapping from the B dataset
configColumn.DisplayMember = LocationConfigCdDo.DescColumn;
configColumn.Name = LocationDo.V_ConfigurationColumn;

 

The combo box was successfully loading the values from the dataset B, however it is not showing the selected value from the A. Please advice.

-Chandra.

Dimitar
Telerik team
 answered on 13 Oct 2016
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
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
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?