Link to home
Start Free TrialLog in
Avatar of mahmood66
mahmood66Flag for United Arab Emirates

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
Avatar of Nasir Razzaq
Nasir Razzaq
Flag of United Kingdom of Great Britain and Northern Ireland image

Try this

Dim edit as ComboboxEdit = gridview1.ActiveEditor

edit.EditValue = 96

or

edit.SelectedItem = ...

Avatar of mahmood66

ASKER

Dear CodeCruiser,
Tat was not working.
If you check the type of ActiveEditor, what do you get back?
It was LookUpEdit control..

 private void gvCashierEntryLines_CellValueChanging(object sender, DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs e)
        {
               if (iWareHouse == 1)
                {

                    LookUpEdit edit = new LookUpEdit();
                    edit = (LookUpEdit)gvCashierEntryLines.ActiveEditor;
                    edit.EditValue = 96;
                   
                    //gvCashierEntryLines.SetRowCellValue(e.RowHandle, gColWHouse, 96);
                    //gvCashierEntryLines.UpdateCurrentRow();
                }
            }

        }
Check the screenshot
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?
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... ?
Try the validatingeditor event instead.
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.FocusedColumn == gColWHouse)
                {
                        if (iWareHouse == 1)
                        {
                            e.Value = 96;
                        }
               }
ASKER CERTIFIED SOLUTION
Avatar of Nasir Razzaq
Nasir Razzaq
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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.
Its now working, but only if i click some other cell.