all groups > dotnet windows forms databinding > august 2006 >
You're in the

dotnet windows forms databinding

group:

DataGridView: multiple cell types in the same column...


DataGridView: multiple cell types in the same column... Ben Callister
8/27/2006 8:45:19 PM
dotnet windows forms databinding:
i have a DataGridView control that is being used to enable users to edit a
list of patient demographics. it has 2 columns and several rows, each
mapping to a different patient demographic. because each row maps to a
different patient demographic, you can think of column1 as 'PropertyName'
and column2 as 'PropertyValue' as this control essentially needs to act as a
generic name/value pair editor.

for example, the input screen would look something like:

FirstName: John
LastName: Doe
SSN: 111-22-3333
DOB: <a Date selection box>
Referring MD: <a combobox with several physician names, but i need to
be able to get at their ID as well via DataMember or something like that>
State: <a combobox of states, but again, i need this to
be based on a lookup table so i can get the StateID>
....

so... this means that while i have only 2 columns, i need MULTIPLE cell
types (e.g. the Text cell type, the ComboBox type, and a Date selector
type).

how can i create this DataGridView setup programmatically? i do not want to
use any Designers for this because the rows (each patient demographic) is
generated dynamically at runtime. also, obviously, i dont want to be
creating my own cell types and would rather use the built-in cell types that
..NET offers - i just need multiple of them in the same column (column2).

also, please comment on how to bind my lookup tables to the ComboBox cell
type. i am hoping that i can work the normal DataSource, DataMember,
DisplayMember stuff in here somewhere.

your help is greatly appreciated.

thanks,
ben callister

RE: DataGridView: multiple cell types in the same column... v-lliu NO[at]SPAM online.microsoft.com
8/28/2006 12:00:00 AM
Hi Ben,

I am sorry that I couldn't understand why you want to display multiple cell
types in the same column, and I don't think we could do this.

You mentioned that you'd like to show the data of patient demographics in a
DataGridView. Why not add 6 columns for FirstName, LastName, SSN, DOB,
Referring MD and State and display the data of a patient in one row?

As for how to bind a lookup table to a ComboBox column, we could set the
DataSource, DisplayMember and ValueMember properties of the ComboBox column.

Hope this helps.

If you have any concerns, please feel free to tell me.


Sincerely,
Linda Liu
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
RE: DataGridView: multiple cell types in the same column... v-lliu NO[at]SPAM online.microsoft.com
8/30/2006 12:47:13 PM
Hi Ben,

How about the problem now?

If you need our further assistance, please feel free to let me know.

Thank you for using our MSDN Managed Newsgroup Support Service!

Sincerely,
Linda Liu
Microsoft Online Community Support

Re: DataGridView: multiple cell types in the same column... dotnetster
9/5/2006 4:37:15 PM
Hi Ben,

I am trying to do something very similar, and can't find a solution
anywhere. I did find code that uses the old DataGrid control to
display a column comprising different control types. I have the code
in work. I'll forward it on to you.

If i find out anything more, I will let you know.

Regards,

dotnetster

[quoted text, click to view]
Re: DataGridView: multiple cell types in the same column... dotnetster
9/6/2006 5:23:57 AM

Hi Ben,

Check out the PropertyGrid. There is a cool example here:

http://www.codeproject.com/cs/miscctrl/bending_property.asp

HTH,

dotnetster...

[quoted text, click to view]
Re: DataGridView: multiple cell types in the same column... Saravanan
11/5/2006 7:36:02 PM
Hi,

I am also using DataGridView For my application
here i wanted to do column spliting and merging, how can i do it in
datagridview, ie i want to split a single column in to multiple columns, this
is to be happen at runtim

How can i?
Thanks in advance




[quoted text, click to view]
Re: DataGridView: multiple cell types in the same column... Saravanan
11/5/2006 7:39:02 PM
Hi,

My question is same like this only, what i want is that i want to split a
single column in to multiple columns. ie my question is that how to achive
split and merge concept is achieved in DataGridView? please share ur ideas

Thanks in advance



[quoted text, click to view]
AddThis Social Bookmark Button