Telerik Forums
UI for WinForms Forum
2 answers
217 views
Hello again, I found an error, is as follows, have 2 columns in a DataGrid control multicombobox in the first 2 columns show the control in the datagrid multicombobox and the second control sample 3 columns, the error occurs when entering edit mode, I explain the steps:

multicombobox first entrance, is running normally, in the event CellBeginEdit admission the following code:

CType (RadGVBitacoras.ActiveEditor, RadMultiColumnComboBoxElement). DropDownSizingMode = SizingMode.UpDownAndRightBottom  
CType (RadGVBitacoras.ActiveEditor, RadMultiColumnComboBoxElement). ValueMember = "Code"  
CType (RadGVBitacoras.ActiveEditor, RadMultiColumnComboBoxElement). DisplayMember = "Country"  
CType (RadGVBitacoras.ActiveEditor, RadMultiColumnComboBoxElement). Data_bitacora.dataset.Tables DataSource = ( "mars_pais) 
CType (CType (RadGVBitacoras.ActiveEditor, RadMultiColumnComboBoxElement). EditorControl, RadGridView). Data_bitacora.dataset.Tables DataSource = ( "mars_pais)  
CType (CType (RadGVBitacoras.ActiveEditor, RadMultiColumnComboBoxElement). EditorControl, RadGridView). Columns (0). Width = 100  
CType (CType (RadGVBitacoras.ActiveEditor, RadMultiColumnComboBoxElement). EditorControl, RadGridView). Columns (1). Width = 300 

this code is executed to perfection, after having entered the first multicombobox, I will enter the second column which contains the second multicombobox, as I said earlier this control contains 3 columns and have the following code on the previous event:
              
CType (RadGVBitacoras.ActiveEditor, RadMultiColumnComboBoxElement). DropDownSizingMode = SizingMode.UpDownAndRightBottom 
CType (RadGVBitacoras.ActiveEditor, RadMultiColumnComboBoxElement). ValueMember = "Code" 
CType (RadGVBitacoras.ActiveEditor, RadMultiColumnComboBoxElement). DisplayMember = "Department / State
CType (RadGVBitacoras.ActiveEditor, RadMultiColumnComboBoxElement). Data_bitacora.dataset.Tables DataSource = ( "mars_departam as d, as mars_pais p")
CType (CType (RadGVBitacoras.ActiveEditor, RadMultiColumnComboBoxElement). EditorControl, RadGridView). Data_bitacora.dataset.Tables DataSource = ( "mars_departam as d, as mars_pais p") 
CType (CType (RadGVBitacoras.ActiveEditor, RadMultiColumnComboBoxElement). EditorControl, RadGridView). Columns (0). Width = 100 
CType (CType (RadGVBitacoras.ActiveEditor, RadMultiColumnComboBoxElement). EditorControl, RadGridView). Columns (1). Width = 100 
CType (CType (RadGVBitacoras.ActiveEditor, RadMultiColumnComboBoxElement). EditorControl, RadGridView). Columns (2). Width = 300 

this code sends me an error in the last line tells me that the control contains 3 columns but not 2, not recognized by the third, although I corrected the table which has 3 columns basa if, in my opinion this is wrong occasions because the control contains 2 columns of another multicombobox in the first column of my datagrid and glass that the error only occurs if the first entry in Edit mode in multicombobox that contains 2 columns, but only if that income contains 3 columns works as if nothing happened, I hope I can help with this error and thank you for all the help I provide.

Edit: Giving hope to understand, I do not speak English well.
Gilberth
Top achievements
Rank 1
 answered on 26 Aug 2009
3 answers
197 views
 1. Alt-Down key does not drop down the Calendar (look-up feature) like .Net's DataTimePicker and ComboBox and even Telerik's own RadComboBox does.

2. Up / Down keys do the same as the Left / Right keys (i.e. previous / next day) on the Calendar vs. "physically" "up" and "down" in the Calendar grid like .Net does.  It's acting as if you're still in Spin mode in the TextBox part of the Control.

3. Page Up / Page Down keys do nothing vs. previous / next month like .Net does.

4. Ctrl-Page Up / Ctrl-Page Down do nothing vs. previous / next year like .Net does.

I could not find any alternate keys that perform the above actions.  Is there a way to override / add to the navigation keys?

Telerik Q1 2009 (v2009.1.9.414), VS 2005 (v8.0.50727.762 SP.050727-7600), XP SP3 on Core2Duo 2.99GHZ with 3GB.
Boyko Markov
Telerik team
 answered on 26 Aug 2009
1 answer
157 views
I'm trying to solve a couple of problems with using a combobox within my RadGridView and not sure if I have taken the most appropriate methods. So in either scenario, the code below might help someone else, but if this is not the way it was intended or of I'm missing something please let me know. I would much prefer to have all the combobox cells show the combobox live instead of when I "hover" or "click" on them.

First Problem is I wanted all of my cells centered, they are dealing with numbers that look much better centered. Even though I set TextAlignment on the columns to MiddleCenter it did not seem to have any effect.

Second Problem is I have a combobox column in the grid that I have successfully databound through some trial and error. The combo box shows text only when looking at it from the grid perspective and that annoys me, I want it to always be in "Edit" mode.Every attempt to turn all of them into edit mode caused the application to crash, so I settled for only showing one at a time by doing it on the mousemove and cellbeginedit methods.

I added events for cellmousemove and cellbeginedit

Code for Cell Mouse move is below (note that since I am changing the Text Alignment I'm being forced to set the color back to solid?)
This activates the "Begin Edit" for the cell it's over if it has one of the values in my combobox.

        private void calendar_grida_CellMouseMove(object sender, MouseEventArgs e) 
        { 
            if (sender is GridDataCellElement) 
            { 
                GridDataCellElement cInfo = (GridDataCellElement)sender; 
                string cellValue = cInfo.Value.ToString().ToLower(); 
                if (cellValue == "n/a" | 
                    cellValue == "open" | 
                    cellValue == "closed") 
                { 
                    cInfo.RowInfo.Cells["status_taken"].BeginEdit(); 
                } 
            } 
        } 

The problem now is if I change to another group it crashes the application with object reference not set to an object, to fix that I handle the cellBeginEdit event and cancel the beginedit if the currentcell is not the combobox

        private void calendar_grida_CellBeginEdit(object sender, GridViewCellCancelEventArgs e) 
        { 
            string cellValue = this.calendar_grida.CurrentCell.Value.ToString().ToLower(); 
            if (cellValue == "n/a" | 
                cellValue == "open" | 
                cellValue == "closed") 
            { 
                return; 
            } 
            else 
            { 
                e.Cancel = true; 
            } 
        } 


Deyan
Telerik team
 answered on 26 Aug 2009
1 answer
210 views
Hello,

I'm using CellBeginEdit event on RadGridView to optionally cancel the edit depending on the contents on the cell. Some example code is below.

But what if the cell is edited is not in the top level hierarchy? I'm using a hierarchy gridview with relations. RowIndex cannot tell me this. How can I know this? I just want to access the DataBoundItem on the current editing cells row.

public static void CellBeginEdit_ReadonlyRows(object sender, Telerik.WinControls.UI.GridViewCellCancelEventArgs e) 
{ 
    if (e.RowIndex == -1) 
         return; 
 
    RadGridView gridView = sender as RadGridView; 
 
    if (gridView == null) 
         return; 
 
    MyEditableEntry groupItem = gridView.Rows[e.RowIndex].DataBoundItem as MyEditableEntry; 
 
    if (groupItem == null || !groupItem.IsEditable) 
         e.Cancel = true; 
    else 
         e.Cancel = false; 
} 
 


Robert
Top achievements
Rank 1
 answered on 25 Aug 2009
1 answer
353 views
The example posted here

http://www.telerik.com/community/forums/winforms/ui-controls/drop-and-drag-between-two-listbox.aspx

only allows single listboxitem moves. If I set the mousedown event to be

 Private Sub lstMembers_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles lstMembers.MouseDown 
      Dim lstBox As RadListBox = sender 
      lstBox.DoDragDrop(lstBox.SelectedItems, DragDropEffects.Move) 
   End Sub 




The listbox does not select the proper values.

Is there a way you can drag multiple values?

Thanks

-Matt
Robert
Top achievements
Rank 1
 answered on 25 Aug 2009
6 answers
515 views
Hi,
I am using check box column to select row.
In fact when the check box is selected, I am storing the DataBondItem of checked row in an Arraylist.

The constraint here is, at a time only one check box has to be checked.
When the next row is checked. The privious check box should be unchecked.

The above is the total functionality.

I am using, BeginEdit and ActiveEditorValuechanged event to perform the above functionality.

The problem here is I am getting 'Object Reference Error' once in a while.

Can anybody suggest better way to obtain the above functionality ?

Current Code for reference :

 void radGrid_CellBeginEdit(object sender, GridViewCellCancelEventArgs e)
        {
            currentRowIndex = e.RowIndex;
            CurrentRowDataItem = this.radGrid.Rows[e.RowIndex].DataBoundItem;

            try
            {
                CurrentRowDataItem = this.radGrid.Rows[e.RowIndex].DataBoundItem;
                if (radGrid.Columns[e.ColumnIndex] is GridViewCheckBoxColumn)
                {
                    //When the editor is clicked properly
                    if (radGrid.ActiveEditor != null && radGrid.ActiveEditor.Value != null)
                    {
                        //create handler for active Editor
                        radGrid.ActiveEditor.ValueChanged += new EventHandler(ActiveEditor_ValueChanged);
                    }
                }
            }
            catch { }
        }

        void ActiveEditor_ValueChanged(object sender, EventArgs e)
        {
            //Only when the value is not null
            if (radGrid.ActiveEditor != null && radGrid.ActiveEditor.Value != null)
            {
                //remove the handler, because next time when the editor is clicked new handler wil be created
                radGrid.ActiveEditor.ValueChanged -= new EventHandler(ActiveEditor_ValueChanged);
                try
                {
                    //Here check the any row's check box selected in the Grid or not.
                    if (this.selectedRows != null && radGrid.ActiveEditor != null)
                    {
                        //current data item
                        object item = radGrid.CurrentRow.DataBoundItem;

                        if (radGrid.ActiveEditor.Value.ToString().ToLower() == "true")
                        {
                            this.selectedRows.Clear();
                            this.selectedRows.Add(item);

                            if (PreviousRowDataItem == null || previousCheck == -1)
                            {
                                //previousCheck = currentRowIndex;
                                PreviousRowDataItem = this.radGrid.CurrentRow.DataBoundItem;
                            }
                            
                            //set current index of previously selected row. It has to be checked and set because while sorting index may change
                            previousCheck = GetActualCheck(PreviousRowDataItem);

                            //Uncheck the previously selected
                            if (previousCheck != -1)
                            {
                                //set false if its true
                                if (radGrid.Rows[previousCheck].Cells[0].Value.ToString().ToLower() == "true")
                                {
                                    radGrid.Rows[previousCheck].Cells[0].Value = Boolean.FalseString;
                                }
                            }
                            //change the previous rowdata to current dataitem
                            if (currentRowIndex != -1)
                            {
                                PreviousRowDataItem = this.radGrid.CurrentRow.DataBoundItem;
                            }

                            if (OnSelectionChange != null)
                            {
                                OnSelectionChange();
                            }
                        }
                        //if uncheck clear the selected rows
                        else
                        {
                            this.selectedRows.Clear();
                        }

                        //if the Edit is finished, have to call this Default function otherwise the edit should not be commited
                        bool b = radGrid.EndEdit();
                    }
                }
                catch (Exception ex)
                {
                    Nexus.UI.BaseMdiParent.RaiseException(this, ex);
                }
            }
        }






Vassil Petev
Telerik team
 answered on 25 Aug 2009
1 answer
186 views
Telerik has by far the best HTML editor on the market for ASP and as was noted by Telerik, its one of the best selling products that Telerik has. This begs the question - why is there not something similar provided by Telerik for WinForms? We are having to look at other companies to provide that functionality and the ones that are rich enough are not compatible in look and feel with Telerik. Tools like TXTextControl are very rich, but it would be good to see this kind of support in the Telerik suite to complete the offering - its a bit of a gaping hole.

Also, while the basic HTML-Like support is useful in things like the grid, it would be even more useful with just a few more formatting features such as Background-Color (so you could highlight a section of the text with a yellow background for example) or strikethrough (so you could show edits where a section of text was deleted). We are trying to mirror our web product which the Telerik Grid allows us to do and again are having to resort to third party alternatives.

Alternatively Rich Text would be an option in either case - the key is to be able to display the data with a few more options.

Are there any plans for either?
Vassil Petev
Telerik team
 answered on 25 Aug 2009
2 answers
223 views
Hello,

I want to disable to modify the checkBox in the gridView. I make AllowEditRow à false but the user can always modify the checkBox.

Thanks in advance.
Boryana
Telerik team
 answered on 24 Aug 2009
2 answers
146 views
Hello Telerik,

Does RadGrid has a in-built pagination functionality? 
can i get some idea about implementing the pagination functionality for RadGridView

Thanks
Kranthi
Nick
Telerik team
 answered on 24 Aug 2009
1 answer
642 views
hi all
i use radMDI form and show a radchild form
in radchild form i use a rad grid
i want rad grid clicked will show a dialog form and when the dialog form close will refresh gird in parent form
anybody help me
thanks
Deyan
Telerik team
 answered on 24 Aug 2009
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
PdfViewer and PdfViewerNavigator
CommandBar
ListControl
Carousel
GanttView
Diagram, DiagramRibbonBar, DiagramToolBox
Panorama
New Product Suggestions
VirtualGrid
Toolstrip (obsolete as of Q3 2010)
Label
AutoCompleteBox
Spreadsheet
ContextMenu
Panel
Visual Studio Extensions
TitleBar
SplitContainer
Documentation
Map
DesktopAlert
CheckedDropDownList
ProgressBar
MessageBox
TrackBar
Rotator
SpinEditor
CheckedListBox
StatusStrip
SyntaxEditor
Wizard
CollapsiblePanel
LayoutControl
ShapedForm
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
NavigationView
BindingNavigator
RibbonForm
Styling
Barcode
PopupEditor
TaskBoard
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
SmartPasteButton
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?