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

GGC Some Questions/Problems

Thread ID:

Created:

Updated:

Platform:

Replies:

79999 Mar 6,2009 10:47 AM UTC Mar 12,2009 12:55 PM UTC WinForms 5
loading
Tags: GridControl
Emanuil Achim
Asked On March 6, 2009 10:47 AM UTC

Hi all,

I'm very new in using the Syncfusion grid (GridGroupingControl), so maybe I make some stupid mistakes. This is a real powerful grid (I like it), but I need a little help. In my example I got what I want (thanks for all examples from you), but following I still missed:
1. Under the child table appears an empty place, I don't like it. This is probably because of hiding the title and the header in the child view. How can I avoid this place?
2. I would like to be able, if the child table is open, to navigate with the tab key from the last cell in the master row in parent table, to the child’s first row and not to the next parent row.
3. How can I hide the RowHeader from parent and child as well?
4. It all works fine, but if I click the "change" button (I want to clean the entire grid and fill with new data) it crashes in the GetTableModel (NullReferenceException). I do something wrong, but I don’t know what.

For your help and any suggestions, thank you in advance!

Regards,
Emil




BindingArrayList_2e75b4c5.zip

Nisha Arockiya A [Syncfusion]
Replied On March 9, 2009 01:16 PM UTC

Hi Emil,

Thanks for your interet in Syncfusion Products.

1. Under the child table appears an empty place, I don't like it. This is probably because of hiding the title and the header in the child view. How can I avoid this place?

Please try using the code similar to this.

private void grid_QueryCellStyleInfo(object sender, GridTableCellStyleInfoEventArgs e)
{
if (e.TableCellIdentity.TableCellType == GridTableCellType.NestedTableCell)
{
Element cell = e.TableCellIdentity.DisplayElement;
Record r = cell.ParentRecord as Record;
if (r != null && r.NestedTables.Count > 0 &&
r.NestedTables[0].ChildTable.GetFilteredRecordCount() == 0)
{
e.Style.CellType = "Static";
e.Handled = true;
}
}
}


2. I would like to be able, if the child table is open, to navigate with the tab key from the last cell in the master row in parent table, to the child’s first row and not to the next parent row.

The up/down arrow keys work fine if all of the parent records are collapsed - either key navigates through the records up or down. The problem is when I expand one or more of the parent rows to show their child rows. This produces some strange behavior - namely that the "child" rows are skipped over when pushing the up/down arrow keys.

3. How can I hide the RowHeader from parent and child as well?

The TableOptions.ShowRowHeader property has been set to false which makes it to be hidden. The GroupCaptionPlusMinus button has been drawn on table’s ( 0, 0 ) position i.e., top row of RowHeader. This causes the plusminus button to be hidden.

Another way to hide RowHeader and have plusMinus button, is by having a custom GroupCaption and accordingly drawing a button accordingly.


4. It all works fine, but if I click the "change" button (I want to clean the entire grid and fill with new data) it crashes in the GetTableModel (NullReferenceException). I do something wrong, but I don’t know what.

You can try this code snippets to reset the datasource for the grid and see if it helps.


this.gridGroupingControl1.DataSource = null;
this.gridGroupingControl1.DataMember = null;
this.gridGroupingControl1.ResetTableDescriptor();
this.gridGroupingControl1.TableDescriptor.Relations.Clear();
this.gridGroupingControl1.DataSource = newdatasource;
this.gridGroupingControl1.Refresh();


Please let me know any difficulties.

Regards,
Nisha.




Emanuil Achim
Replied On March 10, 2009 06:06 AM UTC

Hi Nisha,

thanks a lot for your answer. The results are:

1. It doesn't work on this way. r.NestedTables[0].ChildTable.GetFilteredRecordCount() is never 0 (in my case is 4). I also think even if the next 2 lines are reched, it will not work. So the empty space is still shown after the child.
2. I understand and it ist OK.
3. It works fine, thanks.
4. It doesn't work, it crashes this time on this.gridGroupingControl1.ResetTableDescriptor();. But in this case I have another solution, so by now it doesn't matter.

Thank you very much once again.

Regards,
Emil


Nisha Arockiya A [Syncfusion]
Replied On March 11, 2009 11:30 AM UTC

Hi Emil,

Thanks for the Update.

Solution for Query 1:

Try setting the TableOptions.ShowRowHeader property to hide/show the first column(rowheader) of the Grid. Here is a code snippet

this.gridGroupingControl1.TableOptions.ShowRowHeader = false;

Please let me know if this serve your needs.

Regards,
Nisha.



Emanuil Achim
Replied On March 11, 2009 02:27 PM UTC


Hi Nisha,

to hide the row headers worked fine, thanks. Problem 1 was because of "hiding the title and the header in the child view". Under the child table appears an empty place because of this (you can run my example in attachment on first message and you will see). The solution you recomanded doesn't work.

Regards,
Emil

>Hi Emil,

Thanks for the Update.

Solution for Query 1:

Try setting the TableOptions.ShowRowHeader property to hide/show the first column(rowheader) of the Grid. Here is a code snippet

this.gridGroupingControl1.TableOptions.ShowRowHeader = false;

Please let me know if this serve your needs.

Regards,
Nisha.





Nisha Arockiya A [Syncfusion]
Replied On March 12, 2009 12:55 PM UTC

Hi Emil,

Thanks for the Update.

Please try to hide the column headers and title bar instead or making its size to be zero like the code snippet.


//Instead of this,..
if ((e.Index == 0) || (e.Index == 1))
{
e.Size = 0;
e.Handled = true;
}
//Try like this..
//dataGridViewTranslation.TopLevelGroupOptions.ShowColumnHeaders = false;
dataGridViewTranslation.ChildGroupOptions.ShowColumnHeaders = false;



Please let me know if this helps.

Regards,
Nisha.


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.

Please sign in to access our forum

or the page will be automatically redirected to 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

;