Help please - ComboBoxAdv

Hi there,
I'm using a ComboBoxAdv with a DataTable and DataView - the DataTable is populated by an XML file.

DataView dv = new DataView(dt);
this.cmbData.DataSource = dv;
this.cmbData.DisplayMember = "Description";

However, the Combo box only displays a list of the following text, instead of my table's data:

System.Data.DataRowView

Thanks,
Dimitri

5 Replies

AD Administrator Syncfusion Team February 5, 2007 07:43 PM UTC

I've got it - thanks.

>Hi there,
I'm using a ComboBoxAdv with a DataTable and DataView - the DataTable is populated by an XML file.

DataView dv = new DataView(dt);
this.cmbData.DataSource = dv;
this.cmbData.DisplayMember = "Description";

However, the Combo box only displays a list of the following text, instead of my table's data:

System.Data.DataRowView

Thanks,
Dimitri


AD Administrator Syncfusion Team February 5, 2007 08:09 PM UTC

Hi,
Can you help me with a related/follow up question?

I have a GGC populated by the same source that populates my combo box. Is there a way to link them so that my Combo selection causes the matching row to scroll into view and be selected in the GGC?

Thanks,
Dimitri

>I've got it - thanks.

>Hi there,
I'm using a ComboBoxAdv with a DataTable and DataView - the DataTable is populated by an XML file.

DataView dv = new DataView(dt);
this.cmbData.DataSource = dv;
this.cmbData.DisplayMember = "Description";

However, the Combo box only displays a list of the following text, instead of my table's data:

System.Data.DataRowView

Thanks,
Dimitri


AD Administrator Syncfusion Team February 6, 2007 05:49 PM UTC

Hi Dimitri,

Please try the attached sample and let me know if you are trying something different.
GGC_Group.zip

Best regards,
Haneef


AD Administrator Syncfusion Team February 7, 2007 04:42 PM UTC

Thanks Haneef, that works. What's the best way to get the record values from a selected row in the GGC? I'd like to get at the selected state directly, along the lines of the following..

myGGC.TableControl.Table....[get the currently selected row and its data]

Thanks,



>Hi Dimitri,

Please try the attached sample and let me know if you are trying something different.
GGC_Group.zip

Best regards,
Haneef


AD Administrator Syncfusion Team February 7, 2007 06:40 PM UTC

Hi,

The this.gridGroupingControl1.Table.SelectedRecords property is the collection of selected recrods that you get when you use the grid in ListBoxMode (by setting TableOptions.AllowSelections=None and TableOptionsListBoxMode to something other that None). Here is a code snippet to show this.

foreach(SelectedRecord srec in this.gridGroupingControl1.Table.SelectedRecords)
{
Console.WriteLine(srec.Record);//Record format.
DataRowView row = srec.Record.GetData() as DataRowView; //DataRowView format.
}

Best regards,
Haneef

Loader.
Up arrow icon