Home All Groups Group Topic Archive Search About

Imitating a Webform in a Winform

Author
11 Jul 2006 2:10 AM
Gordon
Hi;

Can you add a column of button controls to a winform datagrid ?

I have a form with three independant grids.

I would like to add buttons i.e. update, add buttons  at the end of each row.

Is this possible in a WINFORM in vb.net 2003 ?

I wish that i could use a Webform but I can't access IIS.

Thanks
--
Gordon

Author
11 Jul 2006 6:27 AM
Steven Nagy
yes you can do this. In fact you can use any control in VS as a control
in your data grid.
this is quite common, although most examples will show you how to use a
date time picker in a data grid. By default a datagrid supports textbox
and checkbox controls, but you can inherit from a specific column class
and create your own quite easily.

I just can't remember what that class is! I'm sure a good google will
find you answers... I have to go home now though


Gordon wrote:
Show quoteHide quote
> Hi;
>
> Can you add a column of button controls to a winform datagrid ?
>
> I have a form with three independant grids.
>
> I would like to add buttons i.e. update, add buttons  at the end of each row.
>
> Is this possible in a WINFORM in vb.net 2003 ?
>
> I wish that i could use a Webform but I can't access IIS.
>
> Thanks
> --
> Gordon
Author
11 Jul 2006 5:58 PM
Gordon
Are you sure about this in a Windows form, using VS 2003 ?  I know that you
can use a dataviewgrid control in the new version of VS and it has a lot more
programmable features.



I
--
Gordon


Show quoteHide quote
"Steven Nagy" wrote:

> yes you can do this. In fact you can use any control in VS as a control
> in your data grid.
> this is quite common, although most examples will show you how to use a
> date time picker in a data grid. By default a datagrid supports textbox
> and checkbox controls, but you can inherit from a specific column class
> and create your own quite easily.
>
> I just can't remember what that class is! I'm sure a good google will
> find you answers... I have to go home now though
>
>
> Gordon wrote:
> > Hi;
> >
> > Can you add a column of button controls to a winform datagrid ?
> >
> > I have a form with three independant grids.
> >
> > I would like to add buttons i.e. update, add buttons  at the end of each row.
> >
> > Is this possible in a WINFORM in vb.net 2003 ?
> >
> > I wish that i could use a Webform but I can't access IIS.
> >
> > Thanks
> > --
> > Gordon
>
>
Author
11 Jul 2006 11:13 PM
Steven Nagy
> Are you sure about this in a Windows form, using VS 2003 ?

Yes I am sure. I have not moved to VS2005 yet and have implemented more
than a few applications that use many different controls from buttons
to drop down lists and more in a datagrid.

And there are other options also besides using buttons. You could add a
context menu that offered 3 menu options (Add, Edit, Delete). You can
be much more creative in win forms. Perhaps you could have the whole
row automatically editable on a mouse over and then have the row
automatically save when the mouse leaves that particular row.

This is what a quick google for "C# datagrid column button" revealed:
http://www.xmlfox.com/CSsamples.htm#6

That has EXACTLY what you want to do.