this.RadGridView_Object.AutoSize = true; |
this.RadGridView_Object.MasterGridViewTemplate.AllowAddNewRow = false; |
this.RadGridView_Object.MasterGridViewTemplate.AllowCellContextMenu = false; |
this.RadGridView_Object.MasterGridViewTemplate.AllowColumnChooser = false; |
this.RadGridView_Object.MasterGridViewTemplate.AllowColumnHeaderContextMenu = false; |
this.RadGridView_Object.MasterGridViewTemplate.AllowColumnReorder = false; |
this.RadGridView_Object.MasterGridViewTemplate.AllowDeleteRow = false; |
this.RadGridView_Object.MasterGridViewTemplate.AllowDragToGroup = false; |
this.RadGridView_Object.MasterGridViewTemplate.AllowRowResize = false; |
this.RadGridView_Object.MasterGridViewTemplate.AutoExpandGroups = true; |
this.RadGridView_Object.MasterGridViewTemplate.EnableSorting = false; |
this.RadGridView_Object.MasterGridViewTemplate.ShowFilteringRow = false; |
this.RadGridView_Object.MasterGridViewTemplate.ShowRowHeaderColumn = false; |
this.RadGridView_Object.ShowGroupPanel = false; this.RadGridView_Object.AutoSizeRows = true; |
// Start update | |
pRadGridView.GridElement.BeginUpdate(); | |
// Erase content | |
pRadGridView.MasterGridViewTemplate.AutoGenerateColumns = false; | |
pRadGridView.DataSource = null; | |
pRadGridView.MasterGridViewTemplate.Rows.Clear(); | |
pRadGridView.MasterGridViewTemplate.Columns.Clear(); | |
#region Add columns | |
#region Special Column for colorization | |
GridViewDataColumn Colorization_Column = new GridViewDataColumn("Colorization", "Colorization"); | |
Colorization_Column.IsVisible = false; | |
Colorization_Column.HeaderText = "Colorization"; | |
pRadGridView.MasterGridViewTemplate.Columns.Add(Colorization_Column); | |
#endregion | |
/// ADD SOME OTHER COLUMNS | |
#endregion | |
#region Add Group View Definition | |
ColumnGroupsViewDefinition _ColumnGroupsViewDefinition = new ColumnGroupsViewDefinition(); | |
/// Add colums groups, some columns, two lines | |
pRadGridView.ViewDefinition = _ColumnGroupsViewDefinition; | |
#endregion | |
#region Databind | |
foreach(Object item in ListOfObject) | |
{ | |
GridViewDataRowInfo row = pRadGridView.MasterGridViewTemplate.Rows.AddNew(); | |
row.Cells["col1"].Value = item.value1; | |
// and others | |
} | |
#endregion | |
// End of update | |
pRadGridView.GridElement.EndUpdate(); | |
// Best fit columns | |
pRadGridView.MasterGridViewTemplate.BestFitColumns(); |
___________________________________________________ |
| TextElement TextElement | |
|__________________________________________________| |
|_TextBox ________________________________|_Button_| |
protected override void CreateChildItems(RadElement parent) |
{ |
base.InitializeTextElement(); |
title.Text = "Title"; |
title.Class = "Title"; |
validation.Text = "* Validation failed"; |
validation.Visibility = ElementVisibility.Collapsed; |
validation.Class = "Validation"; |
validation.ForeColor = Color.Red; |
AcceptsTab = false; |
TabStop = true; |
textBoxElement.Size = new Size(402, 20); |
button.Image = global::revival.Properties.Resources.file_16; |
button.ImageAlignment = System.Drawing.ContentAlignment.MiddleCenter; |
button.TabIndex = 0; |
button.Dock = DockStyle.Right; |
button.ButtonElement.StretchHorizontally = false; |
button.ButtonElement.StretchVertically = false; |
button.ButtonElement.Margin = new Padding(4, 0, 0, 0); |
button.ButtonElement.Padding = new Padding(1); |
BoxLayout layoutTexts = new BoxLayout(); |
layoutTexts.Orientation = Orientation.Horizontal; |
layoutTexts.StretchVertically = false; |
layoutTexts.Children.Add(title); |
layoutTexts.Children.Add(validation); |
BoxLayout layoutEditor = new BoxLayout(); |
layoutEditor.Orientation = Orientation.Horizontal; |
layoutEditor.StretchVertically = false; |
// how do i get the textbox to render to the left and the button to the right? |
layoutEditor.Children.Add(textBoxElement); |
layoutEditor.Children.Add(button.ButtonElement); |
BoxLayout layout = new BoxLayout(); |
layout.Orientation = Orientation.Vertical; |
layout.Children.Add(layoutTexts); |
layout.Children.Add(layoutEditor); |
RootElement.Children.Add(layout); |
Size = new Size(425, 34); |
} |
Hi,
We are using WinForms Q1 2008 SP1 RadGridView.
The problem we are facing is that even though we have disabled drag drop of the columns in the grid, if the user tries to drag any column header outside the form or within the grid other column and wait for few seconds (>= 5 Sec) , following runtime error is coming
object reference not set to instance of an object.
What we are trying to do is disable column drag and drop of grid columns, I have already tried MasterGridViewTemplate.AllowDragToGroup = False , column chooser , column reorder everything false.
Note : we are having timer tick event set for 5 seconds which refreshes the grid every after 5 sec.
if we remove timer event , above problem gets resolved.
Even we dont want effect of drag and drop.
We need solution for this with timer enabled ASAP.
Please help.
Regards
Vishal