This is a migrated thread and some comments may be shown as answers.

RadGridView GridViewComboBoxColumn

10 Answers 175 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Marcelo
Top achievements
Rank 1
Marcelo asked on 21 Jan 2011, 03:56 PM
Galley

I have a column with a RadGridView GridViewComboBoxColumn and would like that when I clicked on the line, this column will open the ComboBox.

It would be
more or less doing this (radComboBox1.ShowDropDown ()) when I clicked on the line.

Is to do this?

10 Answers, 1 is accepted

Sort by
0
Richard Slade
Top achievements
Rank 2
answered on 21 Jan 2011, 04:20 PM
Hello,

In order to have a ComboBox for the editor for your RadGridView cells, you can define one of your columns as a GridViewComboBoxColumn. Please have a look at the documentation here which gives full examples of how to create a GridViewComboBoxColumn.

If this is not what you mean, please give me more details and I'll be happy to help
Thanks
Richard
0
Marcelo
Top achievements
Rank 1
answered on 21 Jan 2011, 04:38 PM
Richard

I have a RadComboBox in my form when the status that it shifts the focus goes to a GridView that contains a column GridViewComboBoxColumn and wanted this column came open.

Thanks for the help ..
Marcelo
0
Richard Slade
Top achievements
Rank 2
answered on 21 Jan 2011, 04:51 PM
Hello Marcelo,

I'm a little confused as to what your requirement is. I understand that you have a RadGridView with a GridViewComboBox column. Do you want to click on the cell and to automatically put the cell into edit mode with the ConmboBox open?
Please explain further and Ill try to help
Richard
0
Marcelo
Top achievements
Rank 1
answered on 21 Jan 2011, 05:54 PM
Well let me try to be more detailed,

I have a ComboBox that indicates which status a person can have and with a RadGridView people to be registered,
after informing the person's data and a status (a combo) the focus goes to the GridView (more just goes to the grid after all the data populated). The grid is populated with data from the person if he has the status levels. You can only save if you set the level of that status. So after I check the status on the grid be populated combo and I'm needing GridViewComboBox that the column is open.

So
I would like to know how to GridViewComboBox stay open after the ComboBox is selected.

Thanks for the help
Marcelo
0
Richard Slade
Top achievements
Rank 2
answered on 21 Jan 2011, 10:56 PM
Hello,

Unless I've missed something, then this in my opinion will cause a problem. Because you want to keep the drop down open, even after selection from the drop down in the RadGridView, then it will not close, even the cell comes out of edit mode. Please let me know if I have not understood your request, or if you can include screenshots then that may also help
regards,
Richard
0
Marcelo
Top achievements
Rank 1
answered on 24 Jan 2011, 04:26 PM
The fire the combo that it's a combo off the grid ...

I managed to make it open with this command:
((RadComboBoxEditor) this.gdvMarcacoes.ActiveEditor). ShowPopup (), plus it only opens if you have already selected a line when there's no line he selected the reference error.



internal void OpenGridViewComboBox(Int32 posicao)
{
    this.gdvMarcacoes.Rows[posicao].IsCurrent = true;
    this.gdvMarcacoes.Columns["classificacao"].IsCurrent = true;
    //this.gdvMarcacoes.BeginEdit();
    if (this.gdvMarcacoes.ActiveEditor is RadComboBoxEditor)
        ((RadComboBoxEditor)this.gdvMarcacoes.ActiveEditor).ShowPopup();
}

With this code (if (this.gdvMarcacoes.ActiveEditor is RadComboBoxEditor)) is the problem that is always ActiveEditor as null .....

Thank you for your attention
Marcelo
0
Jack
Telerik team
answered on 27 Jan 2011, 11:21 AM
Hello Marcelo,

In Q2 2010 we introduced a new combo box control that should replace the old RadComboBox. It is called RadDropDownList and it is used by default in RadGridView. You should change your code the following way:
this.gdvMarcacoes.Rows[posicao].IsCurrent = true;
this.gdvMarcacoes.Columns["classificacao"].IsCurrent = true;
this.gdvMarcacoes.BeginEdit();
if (this.gdvMarcacoes.ActiveEditor is RadDropDownListEditor)
{
    RadDropDownListEditor dropDownListEditor = (RadDropDownListEditor)this.gdvMarcacoes.ActiveEditor;
    RadDropDownListEditorElement editorElement = (RadDropDownListEditorElement)dropDownListEditor.EditorElement;
    editorElement.ShowPopup();
}

I hope this helps.

Regards,
Jack
the Telerik team
Q3’10 SP1 of RadControls for WinForms is available for download; also available is the Q1'11 Roadmap for Telerik Windows Forms controls.
0
Marcelo
Top achievements
Rank 1
answered on 04 Apr 2011, 09:58 PM
Guys,

Well, let me try to improve the description of the problem, I created a control where I put a column with a RadGridView RadComboBoxEditor. On the main screen I have a RadTextBox, and a control with the RadButton RadGridView.
The operation of the screen is this: when I fill out and click on the RadTextBox RadButton I put this value in the RadTextBox RadGridView Control (I created) and the column RadComboBoxEditor need this control to open.
the code I'm using to open is the following:

public void OpenComboBoxClassification (int pRowIndex)
{
    this.gdvMarc.Rows [pRowIndex]. IsCurrent = true;
    this.gdvMarc.Columns ["Classification"]. IsCurrent = true;
    this.gdvMarc.BeginEdit ();
    if (this.gdvMarc.ActiveEditor is RadComboBoxEditor)
        ((RadComboBoxEditor) this.gdvMarc.ActiveEditor). ShowPopup ();
}


plus it always says that the property is null ActiveEditor, did the test by placing a grid on the form and using the same above function and it works.

Could someone help me?

Hugs
0
Jack
Telerik team
answered on 07 Apr 2011, 09:21 AM
Hi Marcelo,

Please open a new ticket, send us your application and we will investigate the issue. As I said in my previous post, the RadComboBoxEditor is deprecated and you should use the RadDropDownListEditor instead. 

I am looking forward to your reply.
 
Greetings,
Jack
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Marcelo
Top achievements
Rank 1
answered on 07 Apr 2011, 01:30 PM
Guys,
Debugging I saw that the problem is because I put the column was as current as ReadeOnly = true, leaving open the combo.
The code I posted is working just fine.

Thanks for the time they spent in helping me.
Tags
GridView
Asked by
Marcelo
Top achievements
Rank 1
Answers by
Richard Slade
Top achievements
Rank 2
Marcelo
Top achievements
Rank 1
Jack
Telerik team
Share this question
or