| ___________________________________________________ |
| | 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
Hello Telerik team,
I used to have set of columns that have a MinWidth and MaxWidth set by designs. Resizing is allowed.
The MinSize is being used to set a default minimal width when shown initially
Once the control has been painted it should set the minimum width of the rows to Zero, so that the user can adjust the width to their own desire.
This is shown in the following code...
private bool _isFirstPaint = true;
private void MyGridViewContainer_Paint(object sender, PaintEventArgs e)
{
if (_isFirstPaint == true)
{
//after 1st draw, we reset the minimum column width so that the collumns can be resized by the user below the initial minimum width set by design.
foreach (GridViewColumn column in this.radGridView1.Columns)
{
column.MinWidth = 0 ;
}
this.Paint -= new PaintEventHandler(MyGridViewContainer_Paint
_isFirstPaint = false;
}
else
{
_isFirstPaint =
false;
}
}
The problem is that this used to work with the 2008Q2 version, but not with the above versions.
Since we now switched to 2008.3.1204 and just a little later to 2008.3.1321, this problem has arrisen.
Please let us know what to do to overcome this change in behaviour.
Kind regards,
Jack