PC Review


Reply
Thread Tools Rate Thread

ColumnMapping and Fill

 
 
Marcin Podle¶ny
Guest
Posts: n/a
 
      23rd Aug 2004
Hello!

I use DataGrid which displays data in several columns. Number of columns
depends on user prefferences (I mean: this is still the same query filling
datatable but I use "DataTable.Columns(i).ColumnMapping =
MappingType.Hidden" to hide columns which should be hidden). So, the code I
use every time to fill DataTable and display data in DataGrid looks like:

Private Sub xxxxx(...)
Dim firstTime as Boolean = true
if not dataset.Tables("table") is nothing
firstTime = false
dataset.Tables("table").Clear()
End If
For i = 0 to dataset.Tables("table").Columns.Count - 1
dataset.Tables("table").Columns(i).ColumnMapping = iif (condition,
MappingType.Hidden, MappingType.Element)
Next
If firstTime
dataGrid.DataSource = dataset.Tables("table").DefaultView
End If
End Sub

It works fine only at first. It sets some of columns visible and hides
others. But already in the second invocation there's no effect. Columns
which were visible are still visible and hidden ones are hidden.
Why?

Thanks for any help


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to fill fill a column with numbers, beginning at number X,counting up. Mike C Microsoft Access 1 16th Mar 2008 09:27 PM
Convert ColumnMapping in SubClass? lucius Microsoft ADO .NET 4 9th Jul 2007 07:29 AM
ColumnMapping - Explicitly exclude a column Jonathan Orgel Microsoft ADO .NET 3 12th Jun 2007 06:38 PM
Fill in form to type Item descrictions and costs and fill in funct =?Utf-8?B?Y3JhZGlubw==?= Microsoft Excel Worksheet Functions 0 16th Jul 2006 08:44 PM
ColumnMapping Difference in MappingType? xenophon Microsoft Dot NET Framework 1 25th Jan 2006 02:46 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:46 AM.