468,288 Members | 1,992 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,288 developers. It's quick & easy.

Problem with display custom datagrid in Windows form

Hello,
I followed MSDN direction to format a datagrid at run time
(http://msdn.microsoft.com/library/de...idcontrol.asp).
The problem is when displayed, it still shows data in the default
format datagrid, not the custom format I created.

Anybody please points out what I did wrong? Certain order I need to
do? Thank you in advance. Here is my code:

Dim City As New NCSOBase.City
Dim ds As New DataSet
ds = City.GetCity 'my store procedure to get data. It's ok.
'dGridCity is the name of my datagrid.
dGridCity.DataSource = ds.Tables(0)

'AddCustomDataGridStyle()
Dim dgTbStyle As New DataGridTableStyle
dgTbStyle.MappingName = "City"

Dim Desc As New DataGridTextBoxColumn
Desc.MappingName = "CityDesc"
Desc.HeaderText = "Description"
Desc.Width = 200
dgTbStyle.GridColumnStyles.Add(Desc)
dGridCity.TableStyles.Clear()
dGridCity.TableStyles.Add(dgTbStyle)

Nov 16 '05 #1
0 882

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Billy Jacobs | last post: by
3 posts views Thread by James Spibey | last post: by
1 post views Thread by Vagabond Software | last post: by
3 posts views Thread by Kris van der Mast | last post: by
7 posts views Thread by Girish | last post: by
36 posts views Thread by AussieRules | last post: by
6 posts views Thread by Ron L | last post: by
3 posts views Thread by Geraldine Hobley | last post: by
reply views Thread by Marcus Kwok | last post: by
2 posts views Thread by MrBee | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.