How to remove tables from the Data Wizard

Hi,

I have some code that only includes some tables for the data connection. But, as soon as I go into the Data Wizard to create a new DataSource, all of the tables appear, instead of only the tables that I want the user to see.

How can I limit which tables that the user can see in the Data Wizard and the Query Builder?

Daniel Rail

Comments

  • edited 8:49PM
    Hello,

    You may use the Config.DesignerSettings.FilterConnectionTables event to filter unnecessary tables. Here is the example in the Class Reference:

    /// <summary>
    /// Occurs when getting available table names from the connection.
    /// </summary>
    /// <remarks>
    /// Use this handler to filter the list of tables returned by the connection object.
    /// </remarks>
    /// <example>
    /// This example demonstrates how to hide the table with "Table 1" name from the Data Wizard.
    /// <code>
    /// Config.DesignerSettings.FilterConnectionTables += DesignerSettings_FilterConnectionTables;
    ///
    /// private void DesignerSettings_FilterConnectionTables(object sender, FilterConnectionTablesEventArgs e)
    /// {
    /// if (e.TableName == "Table 1")
    /// e.Skip = true;
    /// }
    /// </code>
    /// </example>
  • edited 8:49PM
    AlexTZ wrote: »
    Hello,

    You may use the Config.DesignerSettings.FilterConnectionTables event to filter unnecessary tables. Here is the example in the Class Reference:

    /// Config.DesignerSettings.FilterConnectionTables += DesignerSettings_FilterConnectionTables;
    ///
    /// private void DesignerSettings_FilterConnectionTables(object sender, FilterConnectionTablesEventArgs e)
    /// {
    /// if (e.TableName == "Table 1")
    /// e.Skip = true;
    /// }

    Thanks a lot. It works. Maybe, you can add it to the Programmer's Manual, because that was the first obvious place that I look at, as a quick reference.

    Daniel
  • edited 8:49PM
    Ok, I will add the topic in the next major build.

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.