Help with datagridview ...
-
Datagridview is harder than I anticipated. I would like to click on my column header and select an entire column to change it, or click on my row header and select an entire row to change it, or select multiple cells to change them or a single cell to change it. Is this possible with the datagridview object? If so, does anyone have a code example? I've been looking over the net and I'm able to get the column selection to work most of the time, but apparently that disables row selection and I would like both of them, depending on which header is clicked? Thanks for reading.
-
Datagridview is harder than I anticipated. I would like to click on my column header and select an entire column to change it, or click on my row header and select an entire row to change it, or select multiple cells to change them or a single cell to change it. Is this possible with the datagridview object? If so, does anyone have a code example? I've been looking over the net and I'm able to get the column selection to work most of the time, but apparently that disables row selection and I would like both of them, depending on which header is clicked? Thanks for reading.
-
Datagridview is harder than I anticipated. I would like to click on my column header and select an entire column to change it, or click on my row header and select an entire row to change it, or select multiple cells to change them or a single cell to change it. Is this possible with the datagridview object? If so, does anyone have a code example? I've been looking over the net and I'm able to get the column selection to work most of the time, but apparently that disables row selection and I would like both of them, depending on which header is clicked? Thanks for reading.
I think your requirements sound a little ambitious for the DGV, it sounds like you are more after spreadsheet like functionality which you will not get out of a DGV. You might have to look into some of the spreadsheet controls, none of which are free or even cheap.
Never underestimate the power of human stupidity RAH
-
Datagridview is harder than I anticipated. I would like to click on my column header and select an entire column to change it, or click on my row header and select an entire row to change it, or select multiple cells to change them or a single cell to change it. Is this possible with the datagridview object? If so, does anyone have a code example? I've been looking over the net and I'm able to get the column selection to work most of the time, but apparently that disables row selection and I would like both of them, depending on which header is clicked? Thanks for reading.
Is there any way to select a cell and then if the enter key is pressed, have an input box pop up to input a value. Then taking it further, select multiple cells, press the enter key, input box pops up and you can set that same value for all selected cells? Is this possible in the datagridview object?
-
Is there any way to select a cell and then if the enter key is pressed, have an input box pop up to input a value. Then taking it further, select multiple cells, press the enter key, input box pops up and you can set that same value for all selected cells? Is this possible in the datagridview object?
-
If you had followed my earlier suggestion and looked at the properties in the documentation, you would have spotted MultiSelect[^].
I did follow your suggestion. That doesn't mean it gives a working code example that I can insert into my form and start to figure out its intricacies. I can't even get the event handlers to work with this object, it tells me the following error for the following code? Error 4 Cannot implicitly convert type 'System.Windows.Forms.DataGridViewCellEventHandler' to 'System.EventHandler' c:\Form1.cs 51 47 this.dataGridView1.CellClick += new DataGridViewCellEventHandler(dataGridView1_CellClick); // works this.dataGridView1.DoubleClick += new DataGridViewCellEventHandler(dataGridView1_CellDoubleClick); // generates the above error
-
I did follow your suggestion. That doesn't mean it gives a working code example that I can insert into my form and start to figure out its intricacies. I can't even get the event handlers to work with this object, it tells me the following error for the following code? Error 4 Cannot implicitly convert type 'System.Windows.Forms.DataGridViewCellEventHandler' to 'System.EventHandler' c:\Form1.cs 51 47 this.dataGridView1.CellClick += new DataGridViewCellEventHandler(dataGridView1_CellClick); // works this.dataGridView1.DoubleClick += new DataGridViewCellEventHandler(dataGridView1_CellDoubleClick); // generates the above error
-
DataGridView does not have a
DoubleClick
event, it is inherited from Control. You should be usingCellDoubleClick
or use the approprite casting for double clicking of the entire form.Thank you, celldoubleclick worked. With multiselect, that appears to just be a property that you enable or disable. If enabled, how can I know which cells I've selected? Then I could input the data for the select cells with a right click command possibly?
-
Thank you, celldoubleclick worked. With multiselect, that appears to just be a property that you enable or disable. If enabled, how can I know which cells I've selected? Then I could input the data for the select cells with a right click command possibly?