0
私は最近、自分のデータベースアプリケーション用のWPFでGridViewを作成しました。 それは私のウェブサイトのユーザーのためのユーザー名とパスワードを保持し、それは完全に動作します 唯一の問題は、右側に空の列を追加するが、私はなぜdieaがありません。 私は間違って何をしましたか、それをどうやって正しくしましたか? 右の列をちょうどヌルのようにクリックすることはできません。グリッドビューのWPFで空のテーブルを削除するにはどうすればよいですか?
XML
<DataGrid HeadersVisibility="Column" CanUserAddRows="False" BorderBrush="Black" Name="dgAccounts" Foreground="Black" Margin="10,103,405,10">
<DataGrid.Columns>
</DataGrid.Columns>
</DataGrid>
C#
private void RetrieveUserData()
{
string line;
using (WebClient wc = new WebClient())
{
string accs = wc.DownloadString(Clipboard.GetText());
using (StringReader sr = new StringReader(accs))
{
while ((line = sr.ReadLine()) != null)
{
newAccounts.Add(new Accounts { Username = theUsername, Password = thePassword });
}
}
}
dgAccounts.ItemsSource = newAccounts;
}
Here you can see what the problem looks like
アカウントクラスにはいくつのデータメンバーがありますか? –
アカウントとメンバーは2人のみです。 –
[余分な列のデータグリッドを削除する方法](https://stackoverflow.com/questions/20770701/how-to-remove-extra-column-datagrid)の可能な複製 – Jack