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
close icon

GGC

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.

7 Replies

RK Ranjeet Kumar Syncfusion Team December 22, 2009 01:28 PM UTC


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 .



RG Ruslan Gasanbekov December 28, 2009 10:21 AM UTC

10x, it is very helpful.


RK Ranjeet Kumar Syncfusion Team December 28, 2009 10:26 AM UTC

Hi Ruslan,

Thanks for your update.

Regards,
Ranjeet.


RG Ruslan Gasanbekov January 3, 2010 12:11 PM UTC

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


RK Ranjeet Kumar Syncfusion Team January 4, 2010 05:15 AM UTC

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.


RG Ruslan Gasanbekov January 4, 2010 12:30 PM UTC

10x it works great!


RK Ranjeet Kumar Syncfusion Team January 5, 2010 04:29 AM UTC

Hi Ruslan,

Thanks for your update.

Regards,
Ranjeet.

Loader.
Live Chat Icon For mobile
Up arrow icon