[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1265
  • Last Modified:

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
0
mahmood66
Asked:
mahmood66
  • 7
  • 6
1 Solution
 
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
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
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
 
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

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 7
  • 6
Tackle projects and never again get stuck behind a technical roadblock.
Join Now