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.
Unfortunately, activation email could not send to your email. Please try again.

GGC

Thread ID:

Created:

Updated:

Platform:

Replies:

92123 Dec 21,2009 10:28 AM Jan 4,2010 11:29 PM Windows Forms 7
loading
Tags: GridControl
Ruslan Gasanbekov
Asked On December 21, 2009 10:28 AM

Hello,

Couple of questions:

I have a GCC with grouping enabled, which is bound to DataTable.

1.How can I get the collection of all DataRows (Records) in grid (in case of grouping enabled or disabled) and how can I get their respective datasources ?
2.How can I get the underlying datasource of the property TableControl.CurrentCell ?
3.Is it possible to show instead of collapsed group row (which doesn't has any cells), an empty row with empty cells (but at which the controls for each culumn are drawn)?
4.How can I cause column headers not to be drawn (or visibility= false ) ?


10x.

Ranjeet Kumar [Syncfusion]
Replied On December 22, 2009 08:28 AM


Hi Ruslan,

Thanks for your interest in Syncfusion Products.

Q1. How can I get the collection of all DataRows (Records) in grid (in case of grouping enabled or disabled) and how can I get their respective datasources ?

Sol. Please click on button with text "Parent Records Collection" to get all the DataRows in grid and to view associated datasource.
button2_Click event has been handled for this solution.


Q2. How can I get the underlying datasource of the property TableControl.CurrentCell ?

Sol. To get the underlying datasource of property TableControl.Currentcell, Please click on the cell and this has been achieved by handleing
this.gridGroupingControl1.TableControlCellClick += new GridTableControlCellClickEventHandler(gridGroupingControl1_TableControlCellClick);

Q3. Is it possible to show instead of collapsed group row (which doesn't has any cells), an empty row with empty cells (but at which the controls for each culumn are drawn)?

Sol. A group row can not be null, means without a single cell.

Q4. How can I cause column headers not to be drawn (or visibility= false ) ?

Sol. Please click on the button with text "Hide Headers" to hide the column headers and this has been achieved by handling button1_Click event.

Please find the sample attached from the following link :

http://www.syncfusion.com/uploads/redirect.aspx?&team=support&file=F-92123GGC_Questions172601096.zip


Regards,
Ranjeet .


Ruslan Gasanbekov
Replied On December 28, 2009 05:21 AM

10x, it is very helpful.

Ranjeet Kumar [Syncfusion]
Replied On December 28, 2009 05:26 AM

Hi Ruslan,

Thanks for your update.

Regards,
Ranjeet.

Ruslan Gasanbekov
Replied On January 3, 2010 07:11 AM

Hello,

I would like you to look at this slightly modified code sample
you've sent me. I've added an event handler to the chekbox control event, the datasource of the underlying record (when check box is clicked for the "first" time ) is displayed incorrectly.

To reproduce:

1.Compile and Run.
2.Click the checkbox of the third record - see that datasource for the first record is actually displayed.
3.Click any other checkbox - see that datasource for third record is displayed.
4.Click any cell (dont click the checkbox), see that correct datasource is displayed.

Please let me know how to get the correct datasource during
checkbox clicked event.

10x.



F-92123GGC_Questions_Response_157e5aae.rar

Ranjeet Kumar [Syncfusion]
Replied On January 4, 2010 12:15 AM

Hi Ruslan,

Thanks for your update.

To get the underlying datarow on clicking checkbox, you can handle the code in TableControlCheckBoxClick event instead of invoking the TableControlCellClick event in it. Here is the code snippet handled in it.


// Event :
this.gridGroupingControl1.TableControlCheckBoxClick+=new GridTableControlCellClickEventHandler(gridGroupingControl1_TableControlCheckBoxClick);

// Handler :

// Get the table's visible element based on the row index
Element el = this.gridGroupingControl1.Table.DisplayElements[e.Inner.RowIndex];

// Gets the record from the element
Record r = el.GetRecord();
MessageBox.Show(r.ToString());



Please find the sample from the following link :

http://www.syncfusion.com/uploads/redirect.aspx?&team=support&file=RE-F-92123GGC_Questions-138689870.zip

Please let me know if it works for you.

Regards,
Ranjeet.

Ruslan Gasanbekov
Replied On January 4, 2010 07:30 AM

10x it works great!

Ranjeet Kumar [Syncfusion]
Replied On January 4, 2010 11:29 PM

Hi Ruslan,

Thanks for your update.

Regards,
Ranjeet.

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.

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.

;