C#Windowsアプリケーションでgridviewを使用しています。セルの1つに長い文字列があります(下記参照)が、グリッドにバインドされるとセルが切り取られ、スクロールバーdoes not get to end of the gridがフルテキストを表示します。マウスでドラッグすると、スクロールバーがスムーズにスクロールしません。C#gridviewウィンドウでテキストが切り取られる
RowSize
とColumnSizeモードでは異なる組み合わせを試しましたが、運がありません。私が集めることができるものから、
void FillGrid()
{
DataTable tasktable = new DataTable();
tasktable.Columns.Add("Logged By", typeof(string));
tasktable.Columns.Add("Date", typeof(DateTime));
tasktable.Columns.Add("Notes", typeof(string));
DataRow dr1;
//for (int i = 0; i < 100; i++)
//{
dr1 = tasktable.NewRow();
dr1[0] = "Sunit Shah";
dr1[1] = System.DateTime.Now;
dr1[2] = "Test Note";
tasktable.Rows.Add(dr1);
//}
dr1 = tasktable.NewRow();
dr1[0] = "Sunit Shah";
dr1[1] = System.DateTime.Now;
dr1[2] = "Test Note";
dr1[2] = "Paul Pogba will have a medical at Manchester United on Monday after
Juventus granted permission for him to seal a potential world record
transfer.Juventus manager Massimo Allegri refused to be drawn further
on the transfer when he was asked about it in his post-match press
conference following a friendly against West Ham at the London Stadium,
but an official at the Italian club confirmed they had authorised the
midfielder to have United doctors assess him ahead of the move.
Allegri merely said: ‘I spoke about Pogba the day before, we have
just finished a match and I don’t know much more, we will see on Monday
if he is a still Juventus player.’";
tasktable.Rows.Add(dr1);
DataTable fillNotesGrid = new DataTable();
fillNotesGrid = (from row in tasktable.AsEnumerable()
orderby row.Field<DateTime>("Date") descending
select row).CopyToDataTable();
dgvSIDetailsNotes.DataSource = fillNotesGrid;
}
グリッドの表示に使用しているコードを投稿できますか? – Interminable
私はちょうど今追加した – Hemil
私は最初にグリッドビューで上記のテキストを表示する理由を考えるだろう。別の行を選択したときに変更される独自のテキストボックスで、グリッド外に表示する方がよい場合があります。 – Takarii