or
public partial class ListViewFullRowSelect : Form
{
public ListViewFullRowSelect()
{
InitializeComponent();
radListView1.ViewType = Telerik.WinControls.UI.ListViewType.DetailsView;
radListView1.FullRowSelect = false;
List<
Test
> testList = new List<
Test
>();
Random r = new Random();
for (int i = 0; i < 500; i+=3)
{
int nextvalue = r.Next(10)+1;
testList.Add(new Test(i, i + " times " + nextvalue+ " = " + i * nextvalue));
}
radListView1.DataSource = testList;
}
}
public class Test
{
public int id { get; set; }
public string result { get; set; }
public Test(int id, string name)
{
this.id = id;
this.result = name;
}
}
If
ConfigureCorner.ShowDialog() = Windows.Forms.DialogResult.OK
Then
Telerik.WinControls.RadMessageBox.Show(
Me
,
"Action applied"
,
Me
.Name,
MessageBoxButtons.OK,
Telerik.WinControls.RadMessageIcon.Info)
End
If
ConfigureCorner.Dispose
GC.Collect()
GC.WaitForPendingFinalizers()
GC.WaitForFullGCApproach()
GC.WaitForFullGCComplete()
GC.Collect()
ItemsCollection<T> : IBindingList, IList<T> where T : Item
{}
delegate
void
RuleResultParameterDelegate(
string
value);
// this delegate is used to allow the code to call back to itself, as needed in the UI thread
private
void
RuleExecuted(
string
ruleResult)
{
// if this is not the main UI thread, then call this function via a delegate
if
(InvokeRequired)
{
BeginInvoke(
new
RuleResultParameterDelegate(RuleExecuted),
new
object
[] { ruleResult });
return
;
}
GridViewRowInfo row =
new
GridViewRowInfo(radGridView_EnvResults.MasterView);
row.Cells[
"colTargetHost"
].Value = “abc”;
row.Cells[
"colRuleName"
].Value = “efg”;
var selectedRow = radGridView_EnvResults.CurrentRow;
radGridView_EnvResults.Rows.Add(row);
if
(selectedRow !=
null
)
{
radGridView_EnvResults.GridBehavior =
new
MyBehavior();
}
}
public
class
MyBehavior : BaseGridBehavior
{
public
override
bool
ProcessKey(KeyEventArgs keys)
{
if
(
this
.GridControl.CurrentRow
is
GridViewNewRowInfo)
{
if
(keys.KeyData == Keys.Enter || keys.KeyData == Keys.Down || keys.KeyData == Keys.Up)
{
this
.GridControl.EndEdit();
this
.GridControl.GridNavigator.SelectPreviousRow(1);
this
.GridControl.GridNavigator.SelectFirstColumn();
this
.GridControl.BeginEdit();
}
else
if
(
this
.GridControl.GridNavigator.IsLastColumn(
this
.GridControl.CurrentColumn) && keys.KeyData == Keys.Tab)
{
this
.GridControl.EndEdit();
this
.GridControl.GridNavigator.SelectPreviousRow(1);
this
.GridControl.GridNavigator.SelectFirstColumn();
this
.GridControl.BeginEdit();
}
else
if
(keys.KeyData == Keys.Tab)
{
this
.GridControl.GridNavigator.SelectNextColumn();
}
return
true
;
}
else
{
return
base
.ProcessKey(keys);
}
}
}
this
.radDock1.Padding =
new
System.Windows.Forms.Padding(0);