or
radGridView1.CurrentRow.Cells[radGridView1.CurrentColumn.Name].Value.ToString()
//
// MachineTypeDropDownList
//
this
.MachineTypeDropDownList.AutoCompleteDisplayMember =
"M_Type"
;
this
.MachineTypeDropDownList.AutoCompleteValueMember =
"MachineID"
;
this
.MachineTypeDropDownList.DataBindings.Add(
new
System.Windows.Forms.Binding(
"SelectedIndex"
,
this
.machineDataBindingSource,
"MachineID"
,
true
));
this
.MachineTypeDropDownList.DataBindings.Add(
new
System.Windows.Forms.Binding(
"SelectedItem"
,
this
.machineDataBindingSource,
"M_Name"
,
true
));
this
.MachineTypeDropDownList.DataBindings.Add(
new
System.Windows.Forms.Binding(
"SelectedValue"
,
this
.machineDataBindingSource,
"MachineID"
,
true
));
this
.MachineTypeDropDownList.DataBindings.Add(
new
System.Windows.Forms.Binding(
"Text"
,
this
.machineDataBindingSource,
"M_Name"
,
true
));
this
.MachineTypeDropDownList.DataSource =
this
.machineDataBindingSource;
this
.MachineTypeDropDownList.DisplayMember =
"M_Type"
;
this
.MachineTypeDropDownList.Location =
new
System.Drawing.Point(182, 52);
this
.MachineTypeDropDownList.Name =
"MachineTypeDropDownList"
;
this
.MachineTypeDropDownList.Size =
new
System.Drawing.Size(136, 20);
this
.MachineTypeDropDownList.TabIndex = 0;
this
.MachineTypeDropDownList.Text =
"System.Data.DataViewManagerListItemTypeDescriptor"
;
this
.MachineTypeDropDownList.ValueMember =
"MachineID"
;
this
.MachineTypeDropDownList.DataBindingComplete +=
new
Telerik.WinControls.UI.ListBindingCompleteEventHandler(
this
.MachineTypeDropDownList_DataBindingComplete);
this
.MachineTypeDropDownList.Initialized +=
new
System.EventHandler(
this
.MachineTypeDropDownList_Initialized);
this
.MachineTypeDropDownList.DropDownListElement.Items.Count
or
this.MachineTypeDropDownList.Items.Count
private
void
MachineTypeDropDownList_DataBindingComplete(
object
sender, Telerik.WinControls.UI.ListBindingCompleteEventArgs e)
{
System.Diagnostics.Debug.WriteLine(
"this.MachineTypeDropDownList.DropDownListElement.Items --------------------------------"
+
this
.MachineTypeDropDownList.DropDownListElement.Items.Count);
System.Diagnostics.Debug.WriteLine(
"this.MachineTypeDropDownList.Items --------------------------------"
+
this
.MachineTypeDropDownList.Items.Count);
}
private
void
MachineTypeDropDownList_Initialized(
object
sender, EventArgs e){}
Private
Sub
snMain_NavigateBackwardsClick(sender
As
Object
, e
As
EventArgs)
Handles
snMainNav.NavigateBackwardsClick
RangeStartDate = rsScheduler.ActiveView.StartDate.AddDays(-1)
RangeEndDate = rsScheduler.ActiveView.EndDate.AddDays(1)
exceptionTimes = GetSchedulerExceptionTimesByDateRange(, RangeStartDate, RangeEndDate)
GetAppointmentsByDateRange()
End
Sub
Private
Sub
rsScheduler_CellFormatting(sender
As
Object
, e
As
SchedulerCellEventArgs)
Handles
rsScheduler.CellFormatting
' Other Code
For
Each
Exception
In
exceptionTimes
'Block etc
Next
End
Sub
I would like for my grid to autosize according to the form size. When the form is resized, I would like the grid to expand. Is there a setting for this anywhere?
private
void
GridView_EditorRequired(
object
sender, EditorRequiredEventArgs e)
{
if
(e.EditorType ==
typeof
(RadMultiColumnComboBoxElement))
{
PersonChecker newEditor =
new
PersonChecker();
e.Editor = newEditor;
}
}
public
class
PersonChecker : BaseInputEditor
{
public
override
object
Value
{
get
{
String all =
""
;
RadMultiColumnComboBoxElement editor = ((RadMultiColumnComboBoxElement)
this
.EditorElement);
foreach
(GridViewRowInfo gvri
in
editor.Rows)
{
if
(Convert.ToBoolean(gvri.Cells[0].Value) ==
true
)
{
if
(all !=
""
)
all +=
"; "
;
all += Convert.ToString(gvri.Cells[1].Value);
}
}
return
all;
}
set
{
Console.WriteLine(
"to do"
);
}
}
protected
override
RadElement CreateEditorElement()
{
RadMultiColumnComboBoxElement editor =
new
RadMultiColumnComboBoxElement();
editor.EditorControl.AutoGenerateColumns =
false
;
editor.Columns.Clear();
GridViewCheckBoxColumn check =
new
GridViewCheckBoxColumn();
check.HeaderText =
""
;
check.Name =
"Check"
;
check.MinWidth = 40;
check.MaxWidth = check.MinWidth;
check.ReadOnly =
false
;
editor.Columns.Add(check);
GridViewTextBoxColumn username =
new
GridViewTextBoxColumn();
username.HeaderText =
"Username"
;
username.Name =
"Username"
;
username.MinWidth = 200;
editor.Columns.Add(username);
editor.Rows.Clear();
editor.Rows.Add(
new
Object[] {
false
,
"Person 1"
});
editor.Rows.Add(
new
Object[] {
false
,
"Person 2"
});
editor.Rows.Add(
new
Object[] {
false
,
"Person 3"
});
//foreach (Person person in FormMain._persons)
//{
// editor.Rows.Add(
// new Object[] { false, person.SP_Username }
// );
//}
editor.EditorControl.ShowRowHeaderColumn =
false
;
editor.AutoSizeDropDownToBestFit =
true
;
editor.PopupClosing -= Editor_PopupClosing;
editor.PopupClosing += Editor_PopupClosing;
editor.EditorControl.CellClick -= EditorControl_CellClick;
editor.EditorControl.CellClick += EditorControl_CellClick;
return
editor;
}
private
void
EditorControl_CellClick(
object
sender, GridViewCellEventArgs e)
{
if
(e.ColumnIndex == 0 && e.RowIndex > -1)
{
e.Row.Cells[0].Value = !Convert.ToBoolean(e.Row.Cells[0].Value);
}
}
private
void
Editor_PopupClosing(
object
sender, RadPopupClosingEventArgs args)
{
if
(args.CloseReason == RadPopupCloseReason.Mouse)
{
args.Cancel =
true
;
}
}
public
override
void
BeginEdit()
{
base
.BeginEdit();
this
.EditorElement.Focus();
}
public
override
bool
EndEdit()
{
return
base
.EndEdit();
}
public
override
Type DataType
{
get
{
return
typeof
(
string
); }
}
}