Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is DataGrid the right Windows control? 1

Status
Not open for further replies.

RebLazer

Programmer
Jun 7, 2002
438
US
I need to have 3 columns in some sort of table/grid:
Name (label/text) Delete (buttton) Edit (button)

What's the best way to do that? Use a DataGrid? If so, how do I get two columns of buttons in a Windows Form DataGrid? (I've done it before using the "Property Builder" in a WebForms DataGrid...)

Thanks,
Lazer
 
Brian,

Thanks for your reply and links.

I spent a bunch of time looking through the links you posted. But I can't find anything as basic as what I need (as described above). All of the articles in those pages describe things like how to adapt a datagrid for a long driving drip to upstate New York. I'm looking for more of a plain-vanilla basic tutorial of how to do what I need (as described above).

Thanks,
Lazer
 
This is very frustrating because I know what I am trying to do is not complicated.

I want my DataGrid to look much like the one pictured at - but the problem is - all the DataGrid tutorials, etc. that I find are always for the Web Forms DataGrid - which is quite different than the Windows Form DataGrid that I need...

Any help would be much appreciated!
Thanks,
Lazer
 
You could use a listview to display your data. You can't put buttons in your columns but you could have a couple of buttons besides the listview that will act on the currently selected row. Also, if you have only one function that can be performed on a specific row then you could use the double click event.

Durkin
 
This may be an easy way out, but its also an expensive one (one well worth the money though).

We're currently using Infragistic's UltraWinGrid for .NET, and it is AMAZING. It kicks the @$$ off the bundles data grid that comes with .NET.

I come from an asp.net programming background, and this is the closest thing I've found in a winform .net environment that comes close to the customizability of the grids for webforms.

hth

D'Arcy
 
Have a look at the Windows Forms FAQ at They have a large section on the datagrid, including creating button columns.

I have used the technique in one of my apps and it works well.
 
Shelton, I looked at Syncfusion - specifically at - I downloaded it - it's good, but quite a bit more complicated to implement/work with than I had in mind.

Brian, I am working with a Windows forms application...

I can't believe how hard it is to do something so simple with a WinForms DataGrid! :-|

Thanks - any additional help would still be warmly welcomed!
:) Lazer
 
I totally agree. M$ has really screwed this big time. No tutrials or docs for a SIMPLE app.
 
Bigfoot, thanks for your moral support! Nice to know I'm not alone!:-}

Lazer
 
We own Infragistic's UltraWinGrid. I forgot I bought it. It's still just a datagrid with a few mods.
If I could make my grid totally read only, I would be happy.

P.S. Hey RebLazer. Did you ever get it working?
 
We're currently using Infragistic's UltraWinGrid for .NET, and it is AMAZING. It kicks the @$$ off the bundles data grid that comes with .NET.

Not from what I can tell.
 
Bigfoot, I ended up using a ListBox in the end. [blush]
Lazer
 
Its still just a datagrid with a few mods

A FEW?! Have you SEEN the object model for that thing?

We've successfully used checkboxes, buttons, and other controls within the grid. Doing grouping is pretty easy as well, and the control you have over the look and feel of it is unmatched.

The only thing I find is that unless you spend alot of time with it, you don't know how powerful it really is.

D
 
Ok jfrost10. Put your knowlege where your mouth is. ::) LOL

How about a little bit of help. I would be so greatfull.

I am working on an app with 2 grids. The top is empty, and the bottom is full. My user picks records from the bottom grid and puts them into the top grid. They can also rearange the records in the top grid meaniing move them up and down.
I think Ican do this with 2 recordset objects, but I need feedback from the grid.
The first thing I wanted to know is how to shut off editing of cells. I want it when you click on a cell to select the whole record across.

Next is how you get the index of the grid row you clicked on.
On M$'s grid, you use mygrid.CurrentRowIndex.
I was looking for this and could not find it for the Infrigistics grid. I looked under Index, currentrow and row.
No go. Any good tutorials around?

Working with .net make me fell so stupid. I have a lot of years in VB, but this animal is real different.
 
WOW!!! You were right. All I needed was a little bit of time with this grid.

I called Tech support, which I could not do with M$., and they walked me through all of my questions.

It's a bit of a hassle to get the current line index.
UltraGrid1.ActiveRow.Index

Anyway. RebLazer, if you can, then go buy this grid. It's pretty cool.

And jfrost10 gets a start, and RebLazer gets one too for starting this thread.
 
That should have read "gets a STAR", not "START"
 
Bigfoot: no, you were correct the first time: if anything I deserve a start for starting this thread!

:)
(Thanks!)
Lazer
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top