Telerik Forums
UI for WinForms Forum
3 answers
516 views
Hi all.
I have a WindowsForm Aplication with a RadGridView(RadGridView3) added into mainForm.
I have a class "Class1" with a shared function:

Imports

 

Telerik.WinControls.UI

 

Public

Class Class1

Public Shared Function gridul_3() As RadGridView

Dim cerinte0 As New GridViewCheckBoxColumn()

Dim cerinte1 As New GridViewCheckBoxColumn()

Dim cerinte20 As New GridViewCheckBoxColumn()

Dim cerinte3 As New GridViewCheckBoxColumn()

Dim cerinte4 As New GridViewCheckBoxColumn()

Dim _teme As New GridViewTextBoxColumn()

Dim aptitudini As New GridViewCommandColumn()

Dim nivel0 As New GridViewCheckBoxColumn()

Dim nivel_0 As New GridViewCheckBoxColumn()

Dim nivel1 As New GridViewCheckBoxColumn()

Dim nivel20 As New GridViewCheckBoxColumn()

Dim nivel3 As New GridViewCheckBoxColumn()

Dim nivel4 As New GridViewCheckBoxColumn()

Dim observatii As New GridViewTextBoxColumn()

Dim columnGroupsView As ColumnGroupsViewDefinition

mainForm.RadGridView3.Columns.Clear()

mainForm.RadGridView3.AutoSize =

False

mainForm.RadGridView3.BackColor = System.Drawing.

Color.White

mainForm.RadGridView3.Dock = System.Windows.Forms.DockStyle.Fill

mainForm.RadGridView3.ForeColor = System.Drawing.Color.Black

mainForm.RadGridView3.MasterTemplate.AllowAddNewRow = True  

mainForm.RadGridView3.MasterTemplate.AllowRowReorder =

False

mainForm.RadGridView3.MasterTemplate.AutoExpandGroups =

True

 mainForm.RadGridView3.AutoGenerateColumns = False

 mainForm.RadGridView3.AllowAddNewRow = True

 mainForm.RadGridView3.AllowEditRow = True

 mainForm.RadGridView3.AllowRowResize = False

'add columns name

cerinte0.FieldName = "Nu_stie"

cerinte0.HeaderText =

"0"

 cerinte0.Width = 28

 

cerinte0.IsAutoGenerated =

True

cerinte1.FieldName =

"Stie_cu_ajutor"

 cerinte1.HeaderText = "1"

 cerinte1.Width = 28

 

cerinte1.IsAutoGenerated =

True

 cerinte20.FieldName = "Stie_singur"

 cerinte20.HeaderText = "2"

 cerinte20.Width = 28

 

cerinte20.IsAutoGenerated =

True

 cerinte3.FieldName = "Invata_si_pe_altii"

cerinte3.HeaderText =

"3"

 cerinte3.Width = 28

 

cerinte3.IsAutoGenerated =

True

 

cerinte4.FieldName =

"Expert"

 cerinte4.HeaderText = "4"
cerinte4.Width = 28

 

cerinte4.IsAutoGenerated =

True

 

_teme.FieldName =

"Teme_parcurse"

 _teme.HeaderText = "Asteptari "

 _teme.Width = 260

 

_teme.IsAutoGenerated =

True

 

aptitudini.Name =

"cauta_aptitudini"

 

aptitudini.HeaderText =

"*"

 aptitudini.FieldName = "*"

 aptitudini.Width = 18

 

aptitudini.IsAutoGenerated =

True

 

nivel_0.FieldName =

"N_Nu_stie"

 nivel_0.HeaderText = "0"

 nivel_0.Width = 28

 

nivel_0.IsAutoGenerated =

True

 

nivel1.FieldName =

"N_Stie_cu_ajutor"

 nivel1.HeaderText = "1"

 nivel1.Width = 28

 

nivel1.IsAutoGenerated =

True

 

nivel20.FieldName =

"N_Stie_singur"

 nivel20.HeaderText = "2"

nivel20.Width = 28

nivel20.IsAutoGenerated =

True

 

nivel3.FieldName =

"N_Invata_si_pe_altii"

 nivel3.HeaderText = "3"

 nivel3.Width = 28

 

nivel3.IsAutoGenerated =

True

 

nivel4.FieldName =

"N_Expert"

 

nivel4.HeaderText =

"4"  

nivel4.Width = 28

nivel4.IsAutoGenerated =

True

observatii.FieldName =

"Observatii"

observatii.HeaderText =

"Observatii"

observatii.Width = 124

observatii.IsAutoGenerated =

True

'add column into grid

With mainForm.RadGridView3.MasterTemplate

 .Columns.Add(cerinte0)

.Columns.Add(cerinte1)

.Columns.Add(cerinte20)

.Columns.Add(cerinte3)

.Columns.Add(cerinte4)

.Columns.Add(_teme)

.Columns.Add(aptitudini)

.Columns.Add(nivel_0)

.Columns.Add(nivel1)

.Columns.Add(nivel20)

.Columns.Add(nivel3)

.Columns.Add(nivel4)

.Columns.Add(observatii)

End With

' define groups

columnGroupsView =

New ColumnGroupsViewDefinition()

 columnGroupsView.ColumnGroups.Add(New GridViewColumnGroup("Cerinte post si alte cerinte"))

 columnGroupsView.ColumnGroups.Add(New GridViewColumnGroup("Asteptarile superiorului de la" & vbCrLf & " comportamentul subalternului"))

 columnGroupsView.ColumnGroups.Add(New GridViewColumnGroup("A"))

columnGroupsView.ColumnGroups.Add(New GridViewColumnGroup("Nivel angajat"))

 columnGroupsView.ColumnGroups.Add(New GridViewColumnGroup("Specificare observatii"))

 'add the subgroup and the columns into the first group

columnGroupsView.ColumnGroups(0).Rows.Add(New GridViewColumnGroupRow())

 columnGroupsView.ColumnGroups(0).Rows(0).Columns.Add(mainForm.RadGridView3.Columns("Nu_stie"))

columnGroupsView.ColumnGroups(0).Rows.Add(New GridViewColumnGroupRow())

columnGroupsView.ColumnGroups(0).Rows(0).Columns.Add(mainForm.RadGridView3.Columns("Stie_cu_ajutor"))

 columnGroupsView.ColumnGroups(0).Rows.Add(New GridViewColumnGroupRow())  

columnGroupsView.ColumnGroups(0).Rows(0).Columns.Add(mainForm.RadGridView3.Columns("Stie_singur"))  

columnGroupsView.ColumnGroups(0).Rows.Add(New GridViewColumnGroupRow())  

columnGroupsView.ColumnGroups(0).Rows(0).Columns.Add(mainForm.RadGridView3.Columns("Invata_si_pe_altii"))  

columnGroupsView.ColumnGroups(0).Rows.Add(

New GridViewColumnGroupRow())

columnGroupsView.ColumnGroups(0).Rows(0).Columns.Add(mainForm.RadGridView3.Columns("Expert"))

'add the subgroup and the columns into the second group

columnGroupsView.ColumnGroups(1).Rows.Add(

New GridViewColumnGroupRow())

columnGroupsView.ColumnGroups(1).Rows(0).Columns.Add(mainForm.RadGridView3.Columns("Teme_parcurse"))

columnGroupsView.ColumnGroups(2).Rows.Add(New GridViewColumnGroupRow())  

columnGroupsView.ColumnGroups(2).Rows(0).Columns.Add(mainForm.RadGridView3.Columns("cauta_aptitudini"))

columnGroupsView.ColumnGroups(3).Rows.Add(

New GridViewColumnGroupRow())  

columnGroupsView.ColumnGroups(3).Rows(0).Columns.Add(mainForm.RadGridView3.Columns("N_Nu_stie"))

columnGroupsView.ColumnGroups(3).Rows.Add(New GridViewColumnGroupRow())

 columnGroupsView.ColumnGroups(3).Rows(0).Columns.Add(mainForm.RadGridView3.Columns("N_Stie_cu_ajutor"))

 columnGroupsView.ColumnGroups(3).Rows.Add(New GridViewColumnGroupRow())

 columnGroupsView.ColumnGroups(3).Rows(0).Columns.Add(mainForm.RadGridView3.Columns("N_Stie_singur"))

 columnGroupsView.ColumnGroups(3).Rows.Add(New GridViewColumnGroupRow())

 columnGroupsView.ColumnGroups(3).Rows(0).Columns.Add(mainForm.RadGridView3.Columns("N_Invata_si_pe_altii"))

columnGroupsView.ColumnGroups(3).Rows.Add(New GridViewColumnGroupRow())

columnGroupsView.ColumnGroups(3).Rows(0).Columns.Add(mainForm.RadGridView3.Columns("N_Expert"))

columnGroupsView.ColumnGroups(4).Rows.Add(

New GridViewColumnGroupRow())

columnGroupsView.ColumnGroups(4).Rows(0).Columns.Add(mainForm.RadGridView3.Columns("Observatii"))

group definition
mainForm.RadGridView3.ViewDefinition = columnGroupsView

Return mainForm.RadGridView3

End Function
End Class

This function returns me the  mainForm.RadGridView3.


In the Load method ai call the mentioned function and I obtain the Radgridview3 with custon header columns.

Private

Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

Class1.gridul_3()

End Sub

 

My question is how can I meke an height adjustment for grid header because i can't see all the column header text? 
I need to give an increased height for  each ColumnGroups added.

Thanks!
 

Ivan Petrov
Telerik team
 answered on 19 Apr 2012
1 answer
135 views
I was wondering if i can expand the series legend box and have more information in it like the attached picture. I would like to have legend look like what it has for "top 5 spending" is it possible?
Peshito
Telerik team
 answered on 19 Apr 2012
10 answers
396 views
Hello, I am trying to install Winforms Q2 2011 on a Win7 64bit machine with VS2008 and VS2010. The installation hangs after copying the files leaving a status bar empty. I have tried to reboot, uninstall, re-install, repair, clean registry etc, but it always hangs at the same location, and the product cannot be installed. I was sucessfull in installing Q2 Reporting and Q2 WPF and Q2 Silverlight.

Thanks
Petar
Telerik team
 answered on 19 Apr 2012
1 answer
203 views
Hi,
I use the telerik GridView and read datas from a XML in this. Now I will write an XML from the GridView. I will read it same as a normaly windows list view element so this code i used for this:
foreach (ListViewItem lvi in lvPending.Items)
                {
 
                    writer.WriteStartElement("transaction");
                    writer.WriteStartElement("eventId");
                    writer.WriteString(lvi.SubItems[0].Text);
                    writer.WriteEndElement();//eventID
                    writer.WriteStartElement("orderNumber");
                    writer.WriteString(lvi.SubItems[1].Text);
So my question how can I read this with a teleric grid view?
foreach (GridDataItem item in RadGrid1.Items)
{
   
}

doesn´t run. I got the error:The type or namespace name 'GridDataItem' could not be found (are you missing a using directive or an assembly reference?)  

Thanks for help
Thomas
Stefan
Telerik team
 answered on 19 Apr 2012
2 answers
130 views
When using the row filter button for DateTime Columns if a row has a null value the filter fails.
This can easily be reproduced using the Demo samples by going into the Nwind.mdb and setting one of the Employees Hiring Dates to NULL and then going to Demo Samples for Winforms -> GridView -> Filtering -> Filtering and clicking the filter button under hiring and selecting Is not null.
Julian Benkov
Telerik team
 answered on 18 Apr 2012
6 answers
329 views
I have two RadGrids on the same page.  They have the same list of people in both grids, just with different information in each.  When I scroll one grid, I want to make sure that I scroll the other one to the same person.  They are the same height.  I have implemented two scroll events in the form's OnLoad:
 
this.gv1.GridElement.VScrollBar.Scroll += new ScrollEventHandler(gv1_VScrollBar_Scroll);
this.gv2.GridElement.VScrollBar.Scroll += new ScrollEventHandler(gv2_VScrollBar_Scroll);

And then I have:

void gv1_VScrollBar_Scroll(object sender, ScrollEventArgs e)

 

{

    gv2.GridElement.VScrollBar.Value = e.NewValue;

}
 

 

void gv2_VScrollBar_Scroll(object sender, ScrollEventArgs e)

{

    gv1.GridElement.VScrollBar.Value = e.NewValue;

}

 

Here's the problem.  It works for gv1.  The event never even fires for gv2.  If I comment out the functioning one, the other still doesn't work.  Off the top of my head, the only difference I can come up with is that gv2 is heirarchical.  Any thoughts?
Thanks,
Dan

Svett
Telerik team
 answered on 18 Apr 2012
1 answer
161 views
HI..
 I am trying to customize an existing RadTheme and have achieved pretty much what was required. However I am unable to change the color of the text of the RadForm. Apparently the new text color is applied for RadForm and RadTitle in Visual Style Builder. But when previewing, the new color is not visible. 
I've attached an image for your clear understanding.

Reards,
Zubair
Boryana
Telerik team
 answered on 18 Apr 2012
1 answer
378 views
How to create a Theme Selector just like in Telerik Theme Viewer?
Stefan
Telerik team
 answered on 18 Apr 2012
3 answers
210 views
I am a newbia with RadScheduler control. I would like to add another check event for example prompting user a message before showing the Edit Appointment Dialog Form,  when you double click to add new appointment. Please help me. Thanks.
Ivan Todorov
Telerik team
 answered on 18 Apr 2012
1 answer
141 views
Hello,

I can't seem to get this work:

- I have a spineditor set to min of 0, and max 100.
- when i run the form and enter a number within the range above (for example, say 8), then leave the spineditor, the value changes back to zero. 
- I then have to reenter my value (ie, 8) and it keeps it the second time i enter it.

Any ideas to prevent this from happening?  I have no code in the leave event either.

thanks
Francis
Ivan Petrov
Telerik team
 answered on 18 Apr 2012
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
Wizard
CollapsiblePanel
LayoutControl
ShapedForm
SyntaxEditor
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?