Hide selected columns in datagrid vb6 - datagrid

I have a datagrid object and the users requested to be able to select any columns and hide them.
I guess I have to loop through the columns and check if they are selected(?) but I can't find a way to do this.
Could someone give me a tip in this?
I feel like creating excel in vb6, so if it's possible to make excel to use oracle datatable as it's source, I'm up for that too :)
Thanks in advance.

The DataGrid has a HeadClick event you could easily use for this. It provides the colindex of the clicked column.
You could combine this with a CheckBox having its Style = vbButtonGraphical to make a "hide clicked columns" push-on-push-off button or something if you want a clicked column heading to have multiple meanings.

Related

How to get the selected rows in ASPxGridView?

I have a grid with ASPxCheckBox in Data Item Template. How to get KeyFieldValue of all rows whose checkbox is checked. I am trying to do this using client-side code and do it for whole grid not on visible index. Is it possible?
Note: I cannot use simple row selection command column as I am using it for some other purpose.
if you dontuse client-side code, you should use detailrow in aspxgridview. And you must use beforeperformdataselect event. if you really need checkbox, you can add checkbox a new field in asapxgridview.

I want to use Gridview as input fields, with no data to begin with. Is there an easy way to do this?

Thank you in advance.
Using .NET and VB I am looking to use Gridview as an input form grid with checkboxes. I would like each person who fills out the form to have a unique entry in the DB so the data source would be empty. Is there any way to display the checkboxes and have the gridview show up without any source data? We are trying to stay away from dummy data.
You could define your columns in the EmptyDataTemplate
http://forums.asp.net/p/1436652/3240106.aspx
http://geekswithblogs.net/casualjim/archive/2006/05/04/77151.aspx
please refer to below articles that would explain how to show a grid header when there is no data. then you can simply hide/unhide footer row where you can enter data and save the data.
http://technico.qnownow.com/2012/06/11/how-to-add-footerrow-to-gridview-which-has-no-value-initially/
http://technico.qnownow.com/2012/06/07/show-grid-header-when-there-are-no-rows-in-gridview-control/

Trying to extend flex datagrid to add an "add new row" row

I am trying to extend the flex datagrid component so that I can have an "add new row" row like MS Access but I can't get it to work. I have tried a few different methods but I can't get anything to actually work.
By extend I really mean alter the Adobe code as some of the private vars I needed to do something else but I should be able to merge extend code with Adobe's.
Thanks for your help.
You have to make the datagrid editable and then add a new object (or whatever you are using) with empty data to the datagrid's data provider.
Here is an example I have created.

buttons in a datagrid in flex

i am using a data grid in flex and i am generating data from a mysql server. However, my problem is with adding a button within the datagrid so each row has one.
i have set the columns itemRenderer to mx.controls.Button although with the buttons shown in the grid there is no label on them (even though one has been set) and the assigned click event does not trigger when hitting the button. anyone have any ideas or guidance on what i am doing wrong.
Thanks
Mark
Not to worry I have sorted it. anyone with a similar issue i suggest reading this
http://www.axelscript.com/2008/02/29/using-the-itemrenderer-with-a-datagrid-in-flex/
an excellent source.

Adding drag & drop to a datagrid column in flex

I have two datagrid components and I would like to drag one column from one component to the other. I have been trying several methods but I couldnt acomplish that.
Can anybody help me with this?
What you want to do is to disable a column on the first datagrid and enable it on the second. You have to listen to DRAG_START events, find what field is the target column, and hide it on the first datagrid when the drag succeeds. Then you use a symetrical approach for the second datagrid...
I guess you will have to create a custom drag proxy visual component if you want it to be visually coherent.
Good luck =)

Resources