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 Some Questions/Problems

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

5 Replies

NA Nisha Arockiya A Syncfusion Team 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.





EA Emanuil Achim 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



NA Nisha Arockiya A Syncfusion Team 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.




EA Emanuil Achim 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.






NA Nisha Arockiya A Syncfusion Team 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.


Loader.
Live Chat Icon For mobile
Up arrow icon