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: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

CellType in GridDataBoundGrid

Thread ID:





71275 Jan 24,2008 09:43 AM UTC Feb 8,2008 10:27 AM UTC WinForms 1
Tags: GridControl
Mathieu Gyorffy
Asked On January 24, 2008 09:43 AM UTC

I'm using a GridDataBoundGrid (Syncfusion
The DataSource of the grid contains the Parent and the Children DataTables. It also contains a DataRelation between the 2 tables.
The Grid's Binder also contains this DataRelation.

In the grid, I see the following rows:


For the Parents and Children DataTables, I have 3 columns: Name, Value and Tag (Tag is hidden) + the column for the relation which is also hidden.

Until now, everything's fine.

I 'd like to have different cell types (Text, ReadOnly, ComboBox...) depending on :
- the nature of the row (Parent or Child)
- the data represented by the cell(which can be found in the Tag)

In order to do this, I've implemented the Model_QueryCellInfo event (as in your GDBGMultiHeader example) and I'm trying to set the gridQueryCellInfoEventArgs.Style.CellType.
However, I don't know how to get the DataTable Row corresponding to the cell for which Model_QueryCellInfo is being called.

Could you tell me how to do this or tell me if there is a better way to change the CellType depending on the data bound to it?

Thanks in advance

SubhaSheela R [Syncfusion]
Replied On February 8, 2008 10:27 AM UTC

Hi Mathieu,

Thank you for using Syncfusion products.

1. There is no other possibility to set the cell type of the particular cell in GridDataBoundGrid. You can handle QueryCellInfo event to set cell types to the particular cell in GridDataBoundGrid using its CellType property.
2. You can retrieve the selected row by passing GridBoundDataGrid's DataSource and its DataMember to the BindingContext method of the GridBoundDataGrid and assign it to the CurrencyManager class object. Then typecasting this object to DataRowView object, you can get the selected record.
Below is the code snippet:

CurrencyManager cm = (CurrencyManager)BindingContext[gridDataBoundGrid1.DataSource, gridDataBoundGrid1.DataMember];
DataRowView drv = (DataRowView)cm.Current;
this.label1.Text = "ParentID:" + drv["parentID"].ToString() + "\n EmpID:" + drv["EmpID"].ToString() + "\n EmpName:" + drv["EmpName"].ToString() + "\nQuantity:" + drv["Quantity"].ToString() + "\nPrice:" + drv["Price"].ToString();

Please refer the sample available in the link below and let me know if it helps:


Subhasheela R


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