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. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to find row using GridStyleInfo in cellmodel?

Thread ID:





24888 Feb 13,2005 04:22 PM UTC Feb 13,2005 04:50 PM UTC WinForms 1
Tags: GridControl
Juha Palomaki
Asked On February 13, 2005 04:22 PM UTC

I want to customize the contents of datasource for my GridComboBox cell depending on a value in the same row. For example if productType field is 1, combobox should display values a,b,c; if productType is 2, then it should display c,d,e and so on. I''m trying to do this by extending the GridComboBoxCellModel and overriding the GetDataSource(GridStyleInfo info) method. Currently my problem is that I can''t figure out how to get hold of the current row so that I could read the value from the "productType" column. I can get the rowIndex from styleInfo, but don''t know what I should do with it. I''m using GridGroupingControl.

Administrator [Syncfusion]
Replied On February 13, 2005 04:50 PM UTC

Try casting the GridStyleInfo to a GridTableStyleInfo object. Once it is a GridTableStyleInfo, you can try to get the GridRecordRow, and from there get at the for for the row.
GridTableCellStyleInfo tStyle = style as GridTableCellStyleInfo;
if(tStyle != null)
	GridRecordRow grr = tStyle.TableCellIdentity.DisplayElement as GridRecordRow;
	if(r != null)
		DataRowView drv = grr.GetData() as DataRowView;
		if(drv != null)


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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

Live Chat Icon For mobile
Live Chat Icon