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

GridGroupingControls - No Results Found Display

Thread ID:

Created:

Updated:

Platform:

Replies:

49779 Sep 26,2006 05:58 PM UTC Oct 5,2006 10:12 AM UTC WinForms 15
loading
Tags: GridControl
Badri Rajani Kanth
Asked On September 26, 2006 05:58 PM UTC

Dear Syncfusion,

We are using v 4.2.0.37.

In our GGC, i want to display "No results found" message. I dont want to derive and paint as shown in the sample at http://64.78.18.34/Support/Forums/message.aspx?MessageID=38826

I am wondering if I can add a new row (similer to caption row being added at the top). This new row should look like any other row but span across all columns and should be able to display long string message.

We should be able to turn this on/off. Currently i want to use this for "No results found" display. But later i may display total no of rows displayed etc..

How can I do this?

Rgds
Rajani Kanth

Administrator [Syncfusion]
Replied On September 27, 2006 04:54 AM UTC

Hi Rajani,

You will have to use the custom engine and derive the GridTableControl, overriding OnPaint method and draw the required Image to get an image stay on the GroupingGrid.

Here is a sample for implementing it.
http://www.syncfusion.com/Support/user/uploads/GGCNoRecordBackImage_68fe9286.zip

Let me know if you need any further assistance.

Regards,
Haneef

Badri Rajani Kanth
Replied On September 27, 2006 08:43 AM UTC

Thank You Haneef,

But there is a problem using custom engine.
As I already reported (http://64.78.18.34/Support/Forums/message.aspx?MessageID=48782), all my grid will throw error while saving grid settings. So I cant use this unless the grid settings error is fixed by syncfusion.

Is there any work around for me?

Rgds
Rajani Kanth


Badri Rajani Kanth
Replied On September 28, 2006 09:02 AM UTC

Haneef,

Can we not add a label to gridGroupingControl.GridTablePanel.Controls?

I added a label but it not displayed. No error also. If we can always display label next to the column header(when row count == 0), that should be fine. It appreas like a new row.

How can I do this?

Rgds
Rajani Kanth

Administrator [Syncfusion]
Replied On September 28, 2006 09:22 AM UTC

Hi Rajani,

Try the below code

Label label = new Label();
label.Text = "No Results found";
label.Size = new Size(this.gridGroupingControl1.Size.Width,this.gridGroupingControl1.GroupDropPanel.ClientSize.Height );

this.gridGroupingControl1.GroupDropPanel.Controls.Add( label);

//Bring the label control to front of the Z - order.
label.BringToFront();

to add the label control to GroupDropPanel.

Best Regards,
Haneef

Badri Rajani Kanth
Replied On September 28, 2006 09:52 AM UTC

Haneef,

Sdding label to GroupDropPanel is displaying the message above the column headers.

In similer lines, adding a label to GridTablePanel (instead of GroupDropPanel) is working fine.
And also I can make hide/show this label.

Now my question is, how Can I fix the location of this label.
It should always start at the location where normally a data row starts.
I have to keep all conditions (rowheader, grouped, with add new row, or any other).

Rgds
Rajani kanth

Badri Rajani Kanth
Replied On September 28, 2006 10:05 AM UTC

Haneef,

When no data rows available, if we can find out the location of white area beginning (after the grid, which is diplayed in control color), that would be fine.

I mean the minumim location where we can get below flag false, in _TableControlMouseDown event.

bool clickedInsideGrid =
e.TableControl.PointToRowCol(new System.Drawing.Point(e.Inner.X, e.Inner.Y), out rowIndex, out colIndex);

Rgds
Rajani Kanth

Badri Rajani Kanth
Replied On September 28, 2006 10:15 AM UTC

Haneef,

I am using the below lines to set the location..

int noOfRows = this.gridGroupingControl1.TableModel.RowCount;
int gridTotalHeight = this.gridGroupingControl1.TableModel.RowHeights.GetTotal(0, noOfRows);
this.label1.Location = new System.Drawing.Point(0, gridTotalHeight);

But I dont know if this works in all the conditions.

Can u plz look into this..

Rgds
Rajani Kanth

Badri Rajani Kanth
Replied On September 28, 2006 10:31 AM UTC

Haneef,

Also I need one more event.

I want to display this label after the no of rows are found.

All my grids will be bound to dataviews/tables. And when no of rows in this dataviews/tables changes, which is the grid event that gets fired first, in which I can get grid rows count and apply the previous said grid height calculation? And this event should be fired only once.

Rgds
Rajani Kanth

Administrator [Syncfusion]
Replied On September 28, 2006 10:57 AM UTC

Hi Rajani,

You can handle the TableControlPrepareViewStyleInfo event to set the location of the label control in a Grid. Please refer to the below code snippet to achieve this.

private void gridTableControlPrepareViewStyleInfo(object sender, Syncfusion.Windows.Forms.Grid.Grouping.GridTableControlPrepareViewStyleInfoEventArgs e)
{
GridTable table = e.TableControl.Table;
if( table.Records.Count == 0)
{
GridTableCellStyleInfo style = e.Inner.Style as GridTableCellStyleInfo;

Element el = style.TableCellIdentity.DisplayElement;
if( el.Kind == DisplayElementKind.ColumnHeader && e.Inner.ColIndex == 0 )
{
GridCellRendererBase cr = e.TableControl.CellRenderers["TextBox"];
Point pt = cr.GetCellBoundsCore(e.Inner.RowIndex ,e.Inner.ColIndex).Location;
label.Location = new Point (pt.X,pt.Y + table.DefaultColumnHeaderRowHeight);
}
}
else
label.Location = new Point(-1000,-1000);
}

Sample : http://www.syncfusion.com/Support/user/uploads/GGCNoRecordBackImage_40f0d2d5.zip

Best Regards,
Haneef

Badri Rajani Kanth
Replied On September 28, 2006 11:40 AM UTC

Haneef,

This eevent gets fired many times right. More that 10 times. Can I have another event that gets fired only once?

Rgds
Rajani Kanth

Badri Rajani Kanth
Replied On September 28, 2006 11:51 AM UTC

Haneef,

Also, if I set add new row = true, this label will overlap that new row.

I this I am fine with the way of calculating grid height and placing label after that. Plz tell me if any thing wrong in that.

Now I just want an event that gets fired only once when no of rows changed, from 0 to max/max to 0.

Rgds
Rajani Kanth

Badri Rajani Kanth
Replied On October 3, 2006 08:53 AM UTC

Haneef,

Can you plz reply me.

Rgds
Rajani Kanth

Administrator [Syncfusion]
Replied On October 3, 2006 09:22 AM UTC

Hi Rajani,

The CustomSectionInGroup browser samples demonstrates how to customize the layout of grid. It adds a custom section for each group and displays the SummarySection above the details. The sample also shows how to derive custom elements from the Group and the ChildTable and how to hook them into a customized Engine object. Below is a sample path

\Syncfusion\Essential Studio\4.3.0.25\windows\Grid.Grouping.Windows\Samples\CustomSectionInGroup\cs

Also refer to the KnowledgeBase article "How do I efficiently customize the child table/group by using a custom engine?" for more information.

http://www.syncfusion.com/support/kb/grid/Default.aspx?ToDo=view&questId=363

Thanks,
Haneef

Badri Rajani Kanth
Replied On October 4, 2006 09:56 AM UTC

Hi Haneef,

As I said earlier, adding label is working fine.

Now I just want to know if there any event which gets fired first and only once when the no of records changed in the grid data source. Assuming that first can max records then min, then zero and then can be any number. I am trying with list data change events.

Rgds
Rajani Kanth

Administrator [Syncfusion]
Replied On October 5, 2006 10:12 AM UTC

Hi Rajani,

The TableSourceListChanged event arises whenever the datasource changes. Or you can even use the SourceListRecordChanged event when any record is changed in the GridGroupingControl. Let me know if this helps.

Regards,
Haneef

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.

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

;