How to add a label control or text into the DataGridView.Tool

0
0

The DataGridView control is very useful to display grid data, and its Tool property is used to display paging button(PrePage, NextPage).

Now we need to append some text to the DataGridView.Tool to show user pager information:”Total Page: 100 Current Page: 1, Total Record:2000″.

How to do this?

 

Thanks.

Attachment
  • You must to post comments
0
0

Hi wzhou,

Tools (aka ComponentTool) have no Text property.

For the functionality you describe, you should use a BindingNavigator.

  • You must to post comments
0
0

Hi again,

There is another possibe approach. An example will be posted on GitHub examples repository. Will notify when ready.

  • You must to post comments
0
0

Hi wzhou,

The fact is that – unlike WinForms – in Wisej the DataGridView control can act as a container for other controls. This gives DGV an extra level of flexibilityas as controls can be docked into th DGV, etc.

The DGV with embedded navigator sample is just plain visual, in the sense the sample doesn’t do anything. It just shows how to embed other controls into a DataGridView.

On one windows you hava a DGV with an embedded BindingNavigator. On the other window, you have a FlowLayoutPanel embedded. Why a FlowLayoutPanel and not a plain Panel? Because you want the buttons on the right side of the “of {0}” label to move as the text label gets longer or shorter.

From the visual point of view, I prefer the FlowLayourPanel over the BindingNavigator. But that’s up to you.

If you like the FlowLayourPanel, you can use the sample as a starting point to make a re-usable control of your own, add navigation functionalities , etc.

  • You must to post comments
Showing 3 results
Your Answer

Please first to submit.