Pergunta

I am using Devexpress Xtragrid Gridcontrol to show stuff in the grid. Each row shows the values of one object, which is represented as text cell besides two comboboxes. To represent the comboboxes I am using repositoryItemComboBox and ComboBoxItemCollection. I have also defined this event for the gridview

 prjGridView_MouseDown(object sender, MouseEventArgs e)
    {
        var hitInfo = prjGridView.CalcHitInfo(e.Location);
        if (hitInfo.InRowCell)
        {
            int rowHandle = hitInfo.RowHandle;
            GridColumn column = hitInfo.Column;
            if (hitInfo.Column.Name.Equals("UsersItems"))
            {
               //Update the cell combobox data
            }

How can I get the control in the cell shown in the hitInfo. I need this to update the values of the combobox in that cell, each "UserItems" combobox can have different items.

thanks, ES

Foi útil?

Solução 2

Found a very simple method. I defined this in the class

private ComboBoxItemCollection phaseColl

within the molusedown event I simply use the RowHandle to extract the correct object that is being represented in the row and update the combobox. I think this is a very simple implementation since one cannot look at multiply controls at the same time this will work.

-es

Outras dicas

You can use ActiveEditor property of gridview.

var activeEditor = prjGridView.ActiveEditor;
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top