We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

GridListControl

Thread ID:

Created:

Updated:

Platform:

Replies:

4883 Jun 6,2003 07:03 AM UTC Jun 6,2003 07:48 AM UTC WinForms 1
loading
Tags: GridControl
Biagio
Asked On June 6, 2003 07:03 AM UTC

When i use a GridListCOntrol as a CellStyle, in the primary DataTable it load the ValueMember; How can i assign not only the ValueMember, but some other fields to the primary DataTable?

Administrator [Syncfusion]
Replied On June 6, 2003 07:48 AM UTC

> When i use a GridListCOntrol as a CellStyle, in the primary DataTable it load the ValueMember; How can i assign not only the ValueMember, but some other fields to the primary DataTable? > If I understand what you want, I think you would have to work with the actual two tables involved. The two tables wound be the datasource for the gridlistcontrol cell (say listTable) and the datasource for the griddataboundgrid (say gridTable). You would grab the values from the listTable, and set then directly into the datarow in the gridTable. To grab the values from the listTable, you can use the CurrentCellClosedDropDown event. Here is code that works in the CellTypes sample we shipped that uses the USStates object in an array list. For a datatable datasource, you would cast the object to a DataRowView.
private void grid_CurrentCellClosedDropDown(object sender, Syncfusion.Windows.Forms.PopupClosedEventArgs e)
{
	GridCurrentCell cc = this.gridControl1.CurrentCell;
	GridDropDownGridListControlCellRenderer cr = cc.Renderer as GridDropDownGridListControlCellRenderer;
	if(cr != null)
	{
		USState state = (USState)cr.ListControlPart.SelectedItem;
		Console.WriteLine(state.LongName);
	}
}
Once you have the values (from the DataRowView.Row member), you would then put them directly into the gridTable by the Current datarowview in this table through its CurrencyManager.
CurrencyManager cm = (CurrencyManager)this.BindingContext[dataGrid1.DataSource, dataGrid1.DataMember];
DataRowView drv = (DataRowView)	cm.Current;
DataRow dr = drv.Row;
//set the values into dr

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;