By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
439,971 Members | 1,451 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 439,971 IT Pros & Developers. It's quick & easy.

Problem with display custom datagrid in Windows form

P: n/a
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
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.