Jump to content
Software FX Community

How to make certain Datasets unvisible?


Master Chief
 Share

Recommended Posts

 Hallo,

When i use Datagridview Datasets i can make certain of them unvisible with following Code :

 for exp :  With Me.DataGridView1   .Columns("Startdatum").DisplayIndex = 0   .Columns("Linie").DisplayIndex = 1   .Columns("ArtikelNr").DisplayIndex = 2   .Columns("Stielbruch").DisplayIndex = 3   .Columns("Krummglas").DisplayIndex = 4   .Columns("Glasfehler").DisplayIndex = 5   .Columns("ErsteWahl").DisplayIndex = 6   .Columns("Stunde").Visible = False --------------> this Line Unvisible, will not be shown in DataGrid view

 

Now i need the same code for Chart FX DataGrid , cause there are Datasets i dont want to see and be painted in Chart FX

 Plz Help, Thanks

 

MC 

Link to comment
Share on other sites

They are different approaches, in the DataGridView there is a column for each field in the DataSet. This is not the case in Chart FX. The GridView is simpler because there is a direct mapping from fileds to columns, in Chart FX a field in the dataset can be used for many things: value, x-value, label, etc.

Instead of "hiding" what you don't want, you add what you want. For example:

chart.DataSourceSettings.Fields.Clear();

chart.DataSourceSettings.Fieds.Add(new FieldMap("Sartdatum"),FieldUsage.Value);

chart.DataSourceSettings.Fieds.Add(new FieldMap("Linie"),FieldUsage.Value);

chart.DataSourceSettings.Fieds.Add(new FieldMap("ArtikelNr"),FieldUsage.Value);

chart.DataSourceSettings.Fieds.Add(new FieldMap("Stielbruch"),FieldUsage.Value);

chart.DataSourceSettings.Fieds.Add(new FieldMap("Krummglas"),FieldUsage.Value);

chart.DataSourceSettings.Fieds.Add(new FieldMap("Glasfehler"),FieldUsage.Value);

chart.DataSourceSettings.Fieds.Add(new FieldMap("ErsteWahl"),FieldUsage.Value);

chart.DataSourceSettings.Fieds.Add(new FieldMap("Stunde"),FieldUsage.Value);

 I don't know the use you want to give to each field, you must select the appropriate FieldUsage for each one.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...