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!