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
mahmood66Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

CodeCruiserCommented:
Try this

Dim edit as ComboboxEdit = gridview1.ActiveEditor

edit.EditValue = 96

or

edit.SelectedItem = ...

0
mahmood66Author Commented:
Dear CodeCruiser,
Tat was not working.
0
CodeCruiserCommented:
If you check the type of ActiveEditor, what do you get back?
0
Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

mahmood66Author Commented:
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();
                }
            }

        }
0
mahmood66Author Commented:
Check the screenshot
type.bmp
0
CodeCruiserCommented:
>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?
0
mahmood66Author Commented:
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... ?
0
CodeCruiserCommented:
Try the validatingeditor event instead.
0
mahmood66Author Commented:
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;
                        }
               }
0
CodeCruiserCommented:
That is the downside. There is a RowValidating event which fires before the row is commited but there is no CellValidating event.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
mahmood66Author Commented:
so u mean to say that its not possible to clear the particular cell or set to 'Select Warehouse' after the message box.
0
CodeCruiserCommented:
>it changing only after the focus on the particular cell is changed..
I thought it is working when you click on some other cell.
0
mahmood66Author Commented:
Its now working, but only if i click some other cell.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.