I am new to Telerik thing and working on an application using Telerik WinForm controls. I am adding user controls dynamically into a panel based on options selected in the main tree. One such user control constitutes a detailed form having lots of fields.
below is the way I am displaying the user control in a panel:
loEntityForm =
new EntityForm(_OwnerID); // User control to be added dynamically
pnlResourceRight.Controls.Clear(); // Clearing existing user controls if any
pnlResourceRight.Controls.Add(loEntityForm);
loEntityForm.Dock =
DockStyle.Fill;
Now this loEntityForm flickers a lot before being properly rendered.
I have used already used one possible slolution in the contructor
i.e
InitializeComponent();
SetStyle(
ControlStyles.UserPaint, true);
SetStyle(
ControlStyles.AllPaintingInWmPaint, true);
SetStyle(
ControlStyles.DoubleBuffer, true);
SetStyle(
ControlStyles.ResizeRedraw);
but it doesn't solve my problem. Please suggest.
Hello,
I'm installed the trial version on one machine successfully. So far its great, and my company will be purchasing the software after we confirm it meets our needs. However, when trying to install the software on another machine I get the following error message:
"The installer has insufficient privileges to access this directory: C:\ProgramData\..\RadControls for WinForms Q2 2010 SP2."
Tried running it as both a standard user and administrator. Tried logging in as administrator. Nothing works.
The system is Windows 7 Professional, 64-bit. I know how to change the permissions so the install will proceed, the problem is the error message does not display the full path. Can you tell me what it is so I can create the directories manually and apply the permissions needed?
private void SetFilter(GridKnownFunction filterFnType, string searchInput)
{
FilterExpression filter;
string input = searchInput.Trim();
if (!string.IsNullOrEmpty(input))
{
foreach (GridViewDataColumn column in this._GridTextColumns)
{
filter = new FilterExpression(FilterExpression.BinaryOperation.OR, filterFnType, "@FilterEditor1");
filter.Parameters.Add("@FilterEditor1", input);
column.FilterDescriptor = filter;
}
}
else
{
this.grid_Data.MasterTemplate.FilterDescriptors.Clear();
}
}
Hi
I created my custom cell and column:
Cell:
using
System;
using
System.Collections.Generic;
using
System.Linq;
using
System.Text;
using
Telerik.WinControls.UI;
using
System.Windows.Forms;
using
System.Drawing;
using
System.Diagnostics;
namespace
GridViewUnboundMode
{
public
class
EditableCheckBoxCellElement : GridDataCellElement
{
private
RadCheckBoxElement _chk;
private
RadTextBoxElement _txtBox;
private
RadLabelElement _lbl;
public
EditableCheckBoxCellElement(GridViewColumn column, GridRowElement row)
:
base
(column, row)
{
}
protected
override
void
CreateChildElements()
{
base
.CreateChildElements();
_chk =
new
RadCheckBoxElement();
_chk.Margin =
new
Padding(0, 2, 0, 0);
_chk.MinSize =
new
Size(20, 20);
_chk.Text =
string
.Empty;
_chk.ToggleState = Telerik.WinControls.Enumerations.ToggleState.Off;
_chk.ToggleStateChanged +=
new
StateChangedEventHandler(_chk_ToggleStateChanged);
_txtBox =
new
RadTextBoxElement();
_txtBox.Margin =
new
Padding(0, 2, 0, 0);
_txtBox.MinSize =
new
Size(10, 20);
_txtBox.Text =
"sss"
;
_lbl =
new
RadLabelElement();
_lbl.Text =
"Not assigned"
;
_lbl.Margin =
new
Padding(0, 4, 0, 0);
_lbl.MinSize =
new
Size(1, 20);
_lbl.TextWrap =
false
;
_lbl.Font =
new
Font(_lbl.Font.Name, _lbl.Font.Size, FontStyle.Italic);
_lbl.ForeColor = Color.Gray;
this
.Children.Add(_chk);
this
.Children.Add(_lbl);
}
void
_chk_ToggleStateChanged(
object
sender, StateChangedEventArgs args)
{
if
(_chk.ToggleState == Telerik.WinControls.Enumerations.ToggleState.On)
{
if
(
this
.Children.Contains(_lbl))
{
this
.Children.Remove(_lbl); }
this
.Children.Add(_txtBox);
}
else
if
(_chk.ToggleState == Telerik.WinControls.Enumerations.ToggleState.Off)
{
if
(
this
.Children.Contains(_txtBox))
{
this
.Children.Remove(_txtBox); }
this
.Children.Add(_lbl);
}
}
protected
override
SizeF ArrangeOverride(SizeF finalSize)
{
if
(
this
.Children.Count == 2)
{
this
.Children[0].Arrange(
new
RectangleF(0, 0, 20, 20));
this
.Children[1].Arrange(
new
RectangleF(21, 0, finalSize.Width - 28, 20));
if
(
this
.Children[1] == _lbl)
{ _lbl.MinSize =
new
Size(Convert.ToInt32(finalSize.Width - 28), 20); }
}
return
finalSize;
}
public
override
object
Value
{
get
{
return
_txtBox.Text;
}
set
{
_txtBox.Text = value.ToString();
}
}
public
bool
IsChecked
{
get
{
return
_chk.ToggleState == Telerik.WinControls.Enumerations.ToggleState.On;
}
set
{
if
(value)
{ _chk.ToggleState = Telerik.WinControls.Enumerations.ToggleState.On; }
else
{ _chk.ToggleState = Telerik.WinControls.Enumerations.ToggleState.Off; }
}
}
}
}
Column:
using
System;
using
System.Collections.Generic;
using
System.Linq;
using
System.Text;
using
Telerik.WinControls.UI;
namespace
GridViewUnboundMode
{
public
class
EditableCheckBoxColumn : GridViewDataColumn
{
public
EditableCheckBoxColumn():
base
()
{
}
public
override
Type GetCellType(GridViewRowInfo row)
{
if
(row
is
GridViewDataRowInfo)
{
return
typeof
(EditableCheckBoxCellElement);
}
return
base
.GetCellType(row);
}
}
}
When I create new row I do something like this:
private
void
btnAddNewRows_Click(
object
sender, EventArgs e)
{
GridViewRowInfo rowInfo =
this
.radGridView1.Rows.AddNew();
int
columnIndex = 0;
int
rowIndex = rowInfo.Index;
foreach
(GridViewCellInfo cellInfo
in
rowInfo.Cells)
{
cellInfo.Value =
string
.Format(
"{0}-{1}"
, columnIndex, rowIndex);
columnIndex++;
}
}
The problem is that in this loop when I set GridViewCellInfo.Value to some value, property EditableCheckBoxCellElement.Value is not set to this value.
I also don`t know how to get access to EditableCheckBoxCellElement because I need to control property EditableCheckBoxCellElement.IsChecked.
How can I control values for controls that are inside my EditableCheckBoxCellElement?
Data binding is not an option in my case.
Regards