|
Hello,
I have a datagridview in my application.
I want to add an option that the user could resize the datagrid (table) as he wants (for example when the mouse is on the border of the datagrid, the cursor will change to resizing cursor and he could drag it (and so resize the datagrid).
How can i do it?
|
|
|
|
|
Most people arrange for the resize of the FORM rather than the control. If your DGV is set to dock.fill then it will be the control that expands when the form is resized.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
OK, But i want the DGV to be resized inside the form. For example if the mouse on the border of the DGV, it's cursor will be changed to resizing cursor and the user could drag it to its new size.
|
|
|
|
|
There are loads of hits for this, on Google.
One of them was Allow the User to Resize Controls at Runtime[^], have a look and see if it helps.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
|
michaelgr1 wrote: But i want the DGV to be resized inside the form
So you have loads of unused/wasted space inside your form - I'd call this lousy design, a form should be reasonably tight with no wasted space on it.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hi,
I used this tutorial : http://www.codeproject.com/KB/cs/ResizeControlsRuntime.aspx
I have below my DGV another control (DGV), but when i resize the first DGV (below the second DGV), the second DGV hides part of the resizes DGV (it's on top of it). I have a resize option to the second DGV too.
What can i do that the resized DGV will be always on top of all other controls (DGV)?
If i can't do it, what can i do so the first DGV will be always on top of other DGVs (when i resize it)?
|
|
|
|
|
While I have not looked at the article - they are articles, designed to demonstrate a particular aspect of, in this case resizing, .net. You should not take this as a "good" design for UIs, thats not what the author was trying to achieve.
If I am doing a form that is resizable then there will be 1 or more list controls (ListView/DGV etc). These are the controls I will have docked as fill, all other controls will be placed inside panels and docked to an edge. This then allows the FORM to be resized and the list control expands. If there are 2 DGV then use a splitter control and allow the user to resize the DGVs.
I have NEVER designed a form where a DGV can be resized OVER THE TOP of another DGV, I would consider this a bad design.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
But i need it to be like that.
|
|
|
|
|
Why? What are you trying to accomplish?
The European Way of War: Blow your own continent up.
The American Way of War: Go over and help them.
|
|
|
|
|
I have many data in a DGV and the user wants to be able to resize a specific DGV to see most (or more) of the data in the DGV. I have some DGVs in the same application ( i cann't split them to some tabs for example).
So when i resize the first DGV the second DGV hides part of the data.
|
|
|
|
|
Put the 2 DGVs in a split panel.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
I agree with Mycroft. Use splitter controls to force the second DGV to be downsized instead of overlapping. You could do the same thing manually in resize events, but unless you've got weird layout elements that can't be changed using splitters and proper docking/anchoring will make everything much easier to implement and less likely to have weird bugs.
The European Way of War: Blow your own continent up.
The American Way of War: Go over and help them.
|
|
|
|
|
It doesn't sound like what he's doing, but if you've got multiple resizable controls on your form having the others automatically resize themselves around the one you're adjusting manually could be useful.
The European Way of War: Blow your own continent up.
The American Way of War: Go over and help them.
|
|
|
|
|
Yah maybe, it still sound like a crappy UI design. I'd go for a splitter or split panel rather tha have one DGV on top of another, control is going to be a bitch. I do wonder why a tab control or a stack panel of DGV's is not viable. There are so many options other than overlaying one control on another which I consider lousy design.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
IF you need to look at 2 or more at once tabs/stacked panels won't work. Excepting a designer I can't see any good reason not to use splitters.
The European Way of War: Blow your own continent up.
The American Way of War: Go over and help them.
|
|
|
|
|
|
Dear all,
we are facing a unique problem with the windows service which is running on windows server 2003.
After starting the service 3 to 4 days we are getting a error.
Error: Connection request timed out
After that service is ubale to establish connection to the oracle database.
Once the service restarted it works fine and again after 4 days again the same problem.
Can any one know the solution?
|
|
|
|
|
Check whether your are properly closing the database connections after every database transactions....
it might so happen that the connections are not closed and hence the database not allowing new connections..
|
|
|
|
|
Hi Roy,
Yes, we are taking care of closing the db connections in the finally block.
|
|
|
|
|
hi everybody.
i am working on VoIP using c#.Truly i have no technical idea about VoIP.so plz can anybody help me out..
|
|
|
|
|
|
I would like to change the background color of the richtext box when it is disabled. Eventhough i am assigning the backcolor to the desired color, it is not changed. The background color always comes as gray when it is disabled.
public new bool Enabled
{
get
{
return base.Enabled;
}
set
{
if (value != base.Enabled)
{
base.Enabled = value;
base.BackColor = (value == false) ? Color.Yellow : Color.White;
base.ForeColor = (value == false) ? Color.Black : Color.Blue;
}
}
}
Can anyone suggest me how to change the background color of the Richtextbox when it is disabled?
Thanks in advance,
Mutpan
|
|
|
|
|
The disabled appearance of RTB (and most other controls) is built in, and cannot be changed without a deep understanding of WINAPI, and I'm not sure that it can be changed even then.
[Edit]
As an alternative, as you are hiding the built in Enabled Property, why not use your override to set ReadOnly to true. You will then be able to use your own colouration scheme. I know that ReadOnly is not quite the same as Disabled, but would suffice for most purposes.
[/Edit]
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
How creative of you
Regards,
Jason Pezzimenti.
|
|
|
|