Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / October 2004

Tip: Looking for answers? Try searching our database.

Adding unbound (template like column in asp.net) columns into DataGrid

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Josh Thuya - 13 Oct 2004 13:06 GMT
Hi everyone,

I am having some difficulties using datagrid control in
windows forms and I hope some of you guys can help me out
with this.

I have been working on asp.net projects for quite a while
and I am quite happy with the asp.net DataGrid control that
comes with .net framework, especially the template columns
in asp.net DataGrid control.  With template columns, we can
host almost any control (DropDownList, TextBox, Label,
DataGrid, Button, etc.) within it.  It is so easy to do
that.

Now I got a windows application project and just started
working on it.  I am finding it too hard to use windows
form datagrid. I am spending most of my time inheriting
DataGridTextBox column whenever I need to host different
controls (such as ComboBox, Button, etc.) other than
TextBox and CheckBox.  Even if I want to hilight a column
based on its value, I need to inherit and override the
paint method. How frustrating that is!

The WORST thing is you cannot add extra column without
having a mapping name, even if you add one, it wont show up
because there is no matching mapping name in the
datasource.  That's too bad!!  Sometimes, I have a need to
display my own computed column so the values of these
columns dont usually come from the datasource.  Another
thing is I am a big fan of objects and custom
collections/Lists so I dont normally use DataTable and
DataSets.  I always bind the public properties of my own
business objects with the DataGrid.  This is where my
problem is; if there is no public property in the object,
it won't show up in the DataGrid.

I am having difficulties using windowsforms DataGrid and
would like to ask some questions.

So these are my questions:

1.  How do I add unbound or template like column into
DataGrid that binds to a custom IList?

2. How can I highlight rows in different color based on the
status of a column (for example, when I display customer
list, I want to highlight all inactive customers in red,
active customers in green, etc.)

3. Is there a template column in windows form Datagrid
(like in asp.net) that can host any control inside it?

The application currently I am working on needs to use
DataGrid intensively and I couldn't concentrate on business
problems but I am spending most of my time customizing the
datagrid.  This is very time-consuming and I need
suggestion from those who have already come across this
kinda problems.

Any suggestion?

Thanks
Josh
Sijin Joseph - 14 Oct 2004 05:10 GMT
1.  How do I add unbound or template like column into
DataGrid that binds to a custom IList?

http://www.syncfusion.com/FAQ/WinForms/FAQ_c44c.asp#q787q

2. How can I highlight rows in different color based on the
status of a column (for example, when I display customer
list, I want to highlight all inactive customers in red,
active customers in green, etc.)

Check this out http://dotnet.leadit.be/extendeddatagrid/ it has a custom
control that allows you to control the formatting of cells.

3. Is there a template column in windows form Datagrid
(like in asp.net) that can host any control inside it?

No.

Sijin Joseph
http://www.indiangeek.net
http://weblogs.asp.net/sjoseph

> Hi everyone,
>
[quoted text clipped - 59 lines]
> Thanks
> Josh
Josh Thuya - 14 Oct 2004 11:01 GMT
Hi Sijin,

Thanks for your info!  The extended datagrid looks good.
I will try it out.

Thanks
Josh

>-----Original Message-----
>1.  How do I add unbound or template like column into
[quoted text clipped - 83 lines]
>> Josh
>.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.