INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Windows forms show and showdialog working differently displaying datagridview

Windows forms show and showdialog working differently displaying datagridview

Windows forms show and showdialog working differently displaying datagridview

(OP)
I previously had a form that called another form that had a datagridview on it. I passed a DataTable to the child form and on the childform it bound it.

Parent calls child form and shows it.
TableInfoti = new TableInfo();
t1.Show();

Parent passes Datatable:
t1.ShowDataGrid(dt);

Child binds it to datagrid:
public void showDataGrid(DataTable dt, string type)
{
dgvTableColumns.DataSource = dt;
}

This works perfect.
But now I want to make this a modal form, so I change the t1.Show() to t1.ShowDialog() or t1.ShowDialog(this)

Now the grid is showing nothing on the Child form.

But if I change the code to do the ShowDialog after I call ShowGridView(), it works fine.

TableInfoti = new TableInfo();
t1.ShowDataGrid(dt);
t1.ShowDialog();

Why is the behavior different?

Thanks,

Tom


RE: Windows forms show and showdialog working differently displaying datagridview

(OP)
I thought win forms was also part of asp.net.

We have both windows forms and Web forms.

And I am not using VB.net. I am using C#.

RE: Windows forms show and showdialog working differently displaying datagridview

No, ASP.NET is a webform technology and is very different from winforms
you'd be best off posting here: forum732: C# (C sharp): Microsoft

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close