private
void
TicketView_CellEndEdit(
object
sender, GridViewCellEventArgs e)
{
if
((sender
as
GridViewEditManager).GridViewElement.CurrentCell
is
GridFilterCellElement)
{
RequeryGridData();
}
}
private
void
TicketView_ContextMenuOpening(
object
sender, ContextMenuOpeningEventArgs e)
{
if
(e.ContextMenuProvider
is
GridFilterCellElement)
{
e.ContextMenu.DropDownClosed +=
new
RadPopupClosedEventHandler(FilterContextMenu_Closed);
}
}
void
FilterContextMenu_Closed(
object
sender, EventArgs e)
{
RequeryGridData();
}
private
void
TicketView_ContextMenuOpening(
object
sender, ContextMenuOpeningEventArgs e)
{
if
(e.ContextMenuProvider
is
GridFilterCellElement)
{
e.ContextMenu.DropDownClosed +=
new
RadPopupClosedEventHandler(FilterContextMenu_Closed);
}
}
void
FilterContextMenu_Closed(
object
sender, EventArgs e)
{
//HACK: Have to refresh grid contents, but MUST NOT do it from a filter changing event as
// updating the datasource while the filter change is finalized crashes the program
System.Windows.Forms.Timer timer =
new
System.Windows.Forms.Timer();
timer.Interval = 1;
timer.Tick +=
new
EventHandler(FilterChangedTimer_Tick);
timer.Start();
}
void
FilterChangedTimer_Tick(
object
sender, EventArgs e)
{
(sender
as
System.Windows.Forms.Timer).Dispose();
RequeryGridData();
}
Hi.
I used RadDropDownListEditor in my gridview.when press tab Key and enter it,and start write with keyboard
i have a problem.but when enter this cell with Mouse I don't have any problem.
I used RadDropDownListEditor in ver2011 and don't have any problem.
but now Use ver2012.this problem is exist.
private void GrdCheck_CellBeginEdit(object sender, GridViewCellCancelEventArgs e)
{
if (GrdCheck.CurrentColumn is GridViewComboBoxColumn)
{
if (GrdCheck.CurrentColumn.Name.ToString() == "BankRef")
{
RadDropDownListEditor comboBoxEditor = this.GrdCheck.ActiveEditor as RadDropDownListEditor;
if (comboBoxEditor != null)
{
comboBoxEditor.EditorElement.StretchVertically =
false;
comboBoxEditor.DropDownStyle = Telerik.WinControls.
RadDropDownStyle.DropDownList;
comboBoxEditor.DropDownSizingMode =
SizingMode.UpDownAndRightBottom;
}
}
}
}
private void GrdCheck_CellEditorInitialized(object sender, GridViewCellEventArgs e)
{
if (GrdCheck.CurrentColumn.Name.ToString() == "BankRef")
{
RadDropDownListEditor cmb = GrdCheck.ActiveEditor as RadDropDownListEditor;
if (cmb != null)
{
((
RadDropDownListEditorElement)(cmb).EditorElement).DisplayMember = "Descr";
((
RadDropDownListEditorElement)(cmb).EditorElement).ValueMember = "Id";
((
RadDropDownListEditorElement)(cmb).EditorElement).DataSource =DtBankCheck;
((
RadDropDownListEditorElement)(cmb).EditorElement).SelectedIndex = -1;
((
RadDropDownListEditorElement)(cmb).EditorElement).ShowPopup();
}
}
}