Jump to content

Grid, listbox or listview responsive

Recommended Posts

Hello again.
Is there any way to show a grid with the resizeable columns?
I have tried TW3Grid adding columns and assigning their sizes.
In resize I have assigned a percentage to each column (colCode = 5, colName = 80, colState = 15, for example) and I change the width to each of the columns:
Grid1.Columns [n] .Width: = Grid.ClientWidth * colCode div 100, etc.
The new columns are displayed correctly but those that already exist do not (it seems that the rows are simple concatenations of text).
I do not know if it can be done with TW3CustomDBgrid, but I have not found examples.
It is also important that they respond to the onClick event (if it can be per cell better than per row, if possible). Maybe it is possible to use listview with several columns?

Link to post
Share on other sites

It is not necessary, but it would be convenient. The idea is to show a list (code, customer or product name, etc. and have an onclick event to open the selected element), which is resized according to the size of the screen ... In short, make the user experience nicer. It would be fantastic!.
The possibilities are many: change the color of each cell, source, etc. But, as I say, the only essential thing is: responsive columns and the onclick event.
Can I expect it to be available for some date?

Very, very, thanks!!

Link to post
Share on other sites
  • Administrators

Yeah, the grid will be part of the RTL when it is finished. If you need to make a multi column list with an onclick event now, you can actually do it pretty easily with TW3ListBox.

First of all, make a custom component (TMyCustomerRow for example) for your line. It can be based on TW3CustomControl and contain child components for the customer, product etc. Just size the columns there as you want.

After that add a ListBox and set its ItemClass to TMyCustomerRow. Also set ListBox.OnShowItem to a procedure where you take care of filling the subcontrols of TMyCustomerRow according to the data you have.

In code, you add rows:

Item := ListBox.AdItem(Caption);
Item.TagValue := Some value you can use to know which row is being painted.
Item.TagObject := Some internal object you can use for the row painting. For example, your customer object

Those TagValue and TagObject you can use in the procedure where you fill your subcontrols. Aka: Paint the line.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...