diff --git a/LiteDB.Studio/Classes/UIExtensions.cs b/LiteDB.Studio/Classes/UIExtensions.cs index 50719e6..bae3b90 100644 --- a/LiteDB.Studio/Classes/UIExtensions.cs +++ b/LiteDB.Studio/Classes/UIExtensions.cs @@ -43,9 +43,9 @@ public static void BindBsonData(this DataGridView grd, TaskData data) grd.Columns.Add(key, key); col = grd.Columns[key]; - col.AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells; - - col.ReadOnly = key == "_id"; + //col.AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells; + col.Width = 150; + col.ReadOnly = key == "_id"; } } @@ -58,7 +58,9 @@ public static void BindBsonData(this DataGridView grd, TaskData data) var cell = row.Cells[col.Index]; cell.Style.BackColor = Color.White; - cell.Value = value.IsDocument ? value[key] : value; + var bson = value.IsDocument ? value[key] : value; + cell.Value = bson; + cell.Tag = bson; row.ReadOnly = key == "_id"; } diff --git a/LiteDB.Studio/Forms/MainForm.cs b/LiteDB.Studio/Forms/MainForm.cs index 012d0dc..6683ebb 100644 --- a/LiteDB.Studio/Forms/MainForm.cs +++ b/LiteDB.Studio/Forms/MainForm.cs @@ -815,6 +815,11 @@ private void GrdResult_CellFormatting(object sender, DataGridViewCellFormattingE e.Value = JsonSerializer.Serialize(value); break; } + + if (e.Value is string str && str.Length > 150) + { + e.Value = str.Substring(0, 150) + "..."; + } } private void LoadLastDbChecked_Changed(object sender, EventArgs e)