Telerik Forums
UI for WinForms Forum
1 answer
166 views
Hi,
     There are two columns in a grid placed in a windows form. The first column is a GridViewComboBoxColumn and the second one is a GridViewDataColumn. I have populated the combo box with values. I need to assign the selected value from the drop down to the cell on which it resides. The code i have written is given below.

private void BindData()
        {
            radGridView1.GridElement.BeginUpdate();
            var gridViewLookUpColumn = ((GridViewLookUpColumn)(radGridView1.CurrentRow.Cells["column1"].ColumnInfo));

            if (gridViewLookUpColumn == null) return;

            gridViewLookUpColumn.DataSource = FillData();
            gridViewLookUpColumn.DisplayMember = "Name";
            gridViewLookUpColumn.ValueMember = "Id";
            gridViewLookUpColumn.DropDownStyle = RadDropDownStyle.DropDownList;

            radGridView1.GridElement.EndUpdate();
        }

        private static DataTable FillData()
        {
            var dt = new DataTable();
            dt.Columns.Add(new DataColumn("Name", typeof(String)));
            dt.Columns.Add(new DataColumn("Id", typeof(Int32)));

            var dr = dt.NewRow();
            dr["Name"] = "Test 1";
            dr["Id"] = 1;
            dt.Rows.Add(dr);

            dr = dt.NewRow();
            dr["Name"] = "Test 2";
            dr["Id"] = "2";
            dt.Rows.Add(dr);
            return dt;
        }

 private void radGridView1_CellBeginEdit(object sender, GridViewCellCancelEventArgs e)
        {
            BindData();
        }

        private void radGridView1_CellEndEdit(object sender, GridViewCellEventArgs e)
        {
            try
            {
                var radEditor = radGridView1.ActiveEditor;

                if (radEditor == null) return;
                switch (radEditor.GetType().Name)
                {
                    case "RadComboBoxEditor":
                        {

                            var element = ((RadComboBoxElement)((RadComboBoxEditor)radGridView1.ActiveEditor).EditorElement);
                           
                            if (element == null) return;
                            var selectedText = ((RadComboBoxItem) element.SelectedItem).Text;
                            MessageBox.Show("Begin" + selectedText);

                            radGridView1.CurrentRow.Cells["column1"].CellElement.Text = selectedText;
                            //radGridView1.Rows[e.RowIndex + 1].Cells[e.ColumnIndex + 1].Value = element.SelectedValue;                                
                            break;
                        }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }


I can select the value from the dropdown. But the value assigned to the cell is not displaying. Please help me.

Regards
Shamjith


Jack
Telerik team
 answered on 04 Nov 2009
1 answer
116 views
I my application I have a need to basically merge 2 rows.
So I am using the HtmlViewDefinition to do so.
It all is working great but I want to remove some of the column headers as they are all kind of duplicate(by design) per the data.

The view istructured like this:
 HtmlViewDefinition view = new HtmlViewDefinition();  
 
              view.RowTemplate.Rows.Add(new RowDefinition());  
              view.RowTemplate.Rows.Add(new RowDefinition());  
              view.RowTemplate.Rows[0].Cells.Add(new CellDefinition("Code_V1"));  
              view.RowTemplate.Rows[0].Cells.Add(new CellDefinition("Name_V1"));  
              view.RowTemplate.Rows[1].Cells.Add(new CellDefinition("Code_V2"));  
              view.RowTemplate.Rows[1].Cells.Add(new CellDefinition("Name_V2"));  
 
              this.gvMembers.ViewDefinition = view; 

So the header basically looks like this:

Code_V1        Name_V1
Code_V2        Name_V2

But I want it to look like this:
Code        Name


So I would like to remove the second "row" of the header". 
Or if that is not possible, can I make the height be smaller to basically hide the second row. 
I am not usre how to do either. 
Any ideas os suggestions would be appreciated..

--Chuck
Jack
Telerik team
 answered on 04 Nov 2009
1 answer
142 views
hi,
in the product specs it is mentioned that it supports RTL:


Right-to-left Language and Localization Support

Due to business globalization, the need for multi-lingual applications is a must. Telerik WinForms Dock supports all RTL languages, such as Hebrew and Arabic. RadDock's window captions, drop-down menus and action buttons (close, pin/unpin, etc) are fully localizable through a simple and intuitive localization provider, or through resources.

I tried a few ways but couldn't make it work.
i need it to support hebrew.
I'm using Q2 2009.
please advice.

thanks,
Idan
Julian Benkov
Telerik team
 answered on 04 Nov 2009
3 answers
134 views
There's a "Copy" Option that's Visible and Enabled in the default ContextMenu but it doesn't seem to do anything.  If there's no default behavior when you select it, then it shouldn't be in the default ContextMenu at all.  If users want a Copy option, they can customize / replace the ContextMenu.

I don't see any Event that might be triggered by it.  If there's an Override-able Method it calls, as usual, it's doesn't seem to be documented.

FYI, I thought a good use for it would be to do the same thing that the following KB article implements for the Ctrl-C key (namely copying the CurrentRow's Cells, delimited by Tab's and terminated by a Line Feed, to the Clipboard).  I overrode it's handler to do so.

http://www.telerik.com/support/kb/winforms/gridview/copy-pasting-rows-in-and-between-radgridviews-csv-format.aspx

Telerik WinForms 2009Q2 (2009.2.9.729), VB, .Net 2.0 (2.0.50727), VS 2005 (v8.0.50727.762 SP.050727-7600), XP SP3, Core2Duo 2.99GHZ with 3GB.
Nick
Telerik team
 answered on 04 Nov 2009
1 answer
175 views
Can a split container be set to automatically fill a form's area or does it have to be done programatically?

Found it.  .Dock = DockStyle.Fill
Nick
Telerik team
 answered on 04 Nov 2009
3 answers
154 views
Hi there,

this is my first post here, mainly because until now i have not had any real issues with the controls. 

Controls in Use: Rad Controls For Win Forms, Q1 2008

For my current project i need several Split Button elements on the Ribbon bar.

Normally, not an issue. But Now i am trying to edit the visual Look of them via the 'Edit UI Elements'. Once i make the changes , the visual design is applied at design time. However, once i run my application the control reverts to a OuterInnerBorder state which is not what i am wanting. I want a SingleBorder persisted on the control.

This problem is with all instances of the Split button, and Drop Down Button elements for the Ribbon bar.

I am also editing the size of the Fill Primitives, these too are not persisting the changes i am making once i run my application.

Any one have any ideas as to why this may be???????

Thanks in advance for your replies.

Oh as a side not, the ribbon bar chunk is showing the same behaviors. I turn off Auto Size, and manually define them for some of the chunks (Trying to keep the height the same across all chunks and tabs. Width and height settings are not being maintained on the bar chunks)
Hobbes
Top achievements
Rank 1
 answered on 03 Nov 2009
3 answers
442 views
Hello,
I am using GridViewSummaryRowItem and i found it very useful so far. However I have problem with adding custom format (color, border) to the total row. In examples there is code snippet that uses  cell formatting event to do so:

  if (e.CellElement is GridSummaryCellElement) 
            { 
 //Set formatting... 
            } 


But my GridView doesn't fire either cellfromatting or rowformatting event for the total row, so I have no way how for example set custom background color. Here's my code to setup the total row:

     
      GridViewSummaryRowItem sum = new GridViewSummaryRowItem(); 
            sum.Add(new GridViewSummaryItem("CeleJmeno", "Celkem", GridAggregateFunction.None)); 
            sum.Add(new GridViewSummaryItem("Preplatek", "{0:C}", GridAggregateFunction.Sum)); 
            sum.Add(new GridViewSummaryItem("Zustatek", "{0:C}", GridAggregateFunction.Sum)); 
 
            this.grdHromadnaVyplatnice.MasterGridViewTemplate.SummaryRowsBottom.Add(sum); 

Doug Hamilton
Top achievements
Rank 1
 answered on 03 Nov 2009
4 answers
128 views
I just installed Telerik Q3 2009 WinForms BETA (2009.2.9.1016) over Q2 2009 (2009.2.9.729) and clicking on the Filter Row of a Date Column started generating an error.

System.NullReferenceException: Object reference not set to an instance of an object. 
   at Telerik.WinControls.UI.GridTableElement.get_CurrentCell() 
   at Telerik.WinControls.UI.RadGridView.get_CurrentCell() 
   at Telerik.WinControls.UI.RadGridView.BeginEdit() 
   at Telerik.WinControls.UI.BaseGridBehavior.OnMouseDownLeft(MouseEventArgs e) 
   at Telerik.WinControls.UI.BaseGridBehavior.OnMouseDown(MouseEventArgs e) 
   at Telerik.WinControls.UI.RadGridView.OnMouseDown(MouseEventArgs e) 
   at System.Windows.Forms.Control.WmMouseDown(Message& m, MouseButtons button, Int32 clicks) 
   at System.Windows.Forms.Control.WndProc(Message& m) 
   at System.Windows.Forms.ScrollableControl.WndProc(Message& m) 
   at Telerik.WinControls.RadControl.WndProc(Message& m) 
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) 
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) 
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) 
 

Telerik 2009Q3 Beta (2009.2.9.1016), VS 2005 (v8.0.50727.762 SP.050727-7600), .Net2 (2.0.50727), XP SP3, Core2Duo 2.99GHZ with 3GB.
Nick
Telerik team
 answered on 03 Nov 2009
2 answers
143 views
What I wantto do is in the CellFormatting event(of elsewhere) I want to dynamically add a chart to a cell.
I can create the chart from code with no problem but I don't see a way to add a chart or any other control to a cell.
What I thought I would be able to do is this(pseudo):

 

GridCellElement cell = e.CellElement;

 

cell.Controls.Add(createChart(series1Val, series2Val));


Is there a way to add a chart to a grid and or a cell specifically?
Of if I need to do it at the column level(and use values from other columns) or any other level, please let me know..

Thanks

--Chuck
Nick
Telerik team
 answered on 03 Nov 2009
0 answers
114 views
done
NewBee
Top achievements
Rank 1
 asked on 03 Nov 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?