mahmood66
asked on
Dev Express - Xtra Grid Problem
Check out the screen shot, i have a case here like,
When ever i am selecting the ware house, i am checking whether the particular commodity is in the selected warehouse, if not the attached message will display, after this message i want to set that particular cell value to "Select warehouse".
I used the attached code and it s working fine only for the first time i am selecting, for the second time, its not working.
Note : I am using third party control called "Dev Express - Xtra Grid"
Error.bmp
Error1.jpg
Error2.jpg
When ever i am selecting the ware house, i am checking whether the particular commodity is in the selected warehouse, if not the attached message will display, after this message i want to set that particular cell value to "Select warehouse".
I used the attached code and it s working fine only for the first time i am selecting, for the second time, its not working.
Note : I am using third party control called "Dev Express - Xtra Grid"
Error.bmp
Error1.jpg
Error2.jpg
ASKER
Dear CodeCruiser,
Tat was not working.
Tat was not working.
If you check the type of ActiveEditor, what do you get back?
ASKER
It was LookUpEdit control..
private void gvCashierEntryLines_CellVa lueChangin g(object sender, DevExpress.XtraGrid.Views. Base.CellV alueChange dEventArgs e)
{
if (iWareHouse == 1)
{
LookUpEdit edit = new LookUpEdit();
edit = (LookUpEdit)gvCashierEntry Lines.Acti veEditor;
edit.EditValue = 96;
//gvCashierEntryLines.SetR owCellValu e(e.RowHan dle, gColWHouse, 96);
//gvCashierEntryLines.Upda teCurrentR ow();
}
}
}
private void gvCashierEntryLines_CellVa
{
if (iWareHouse == 1)
{
LookUpEdit edit = new LookUpEdit();
edit = (LookUpEdit)gvCashierEntry
edit.EditValue = 96;
//gvCashierEntryLines.SetR
//gvCashierEntryLines.Upda
}
}
}
ASKER
Check the screenshot
type.bmp
type.bmp
>LookUpEdit edit = new LookUpEdit();
Dont use New with it as you are referring to an existing control not creating a new one.
Did it work?
Dont use New with it as you are referring to an existing control not creating a new one.
Did it work?
ASKER
I tried that too, it s not working....
when i removed that line and ececuted,
Note : when the system executing this line, 'edit.EditValue = 96' ... the changing event is again firing
is there any other event... ?
when i removed that line and ececuted,
Note : when the system executing this line, 'edit.EditValue = 96' ... the changing event is again firing
is there any other event... ?
Try the validatingeditor event instead.
ASKER
It is working in the validating event ... but not changing once the message appears... it changing only after the focus on the particular cell is changed..
if (gvCashierEntryLines.Focus edColumn == gColWHouse)
{
if (iWareHouse == 1)
{
e.Value = 96;
}
}
if (gvCashierEntryLines.Focus
{
if (iWareHouse == 1)
{
e.Value = 96;
}
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
so u mean to say that its not possible to clear the particular cell or set to 'Select Warehouse' after the message box.
>it changing only after the focus on the particular cell is changed..
I thought it is working when you click on some other cell.
I thought it is working when you click on some other cell.
ASKER
Its now working, but only if i click some other cell.
Dim edit as ComboboxEdit = gridview1.ActiveEditor
edit.EditValue = 96
or
edit.SelectedItem = ...