C
C#11mo ago
Mekasu0124

✅ How to "preview" text in a DataGrid

<DataGridTextColumn CanUserReorder="False" CanUserResize="False" Width="*" Header="Diary Entry" Binding="{Binding Description}" />
<DataGridTextColumn CanUserReorder="False" CanUserResize="False" Width="*" Header="Diary Entry" Binding="{Binding Description}" />
How would I go about setting the description to only show like the first 10 words and trail off with a . . . like for example
Date | Time | Title | Description
08/12/23 | 6:54 PM | My Awesome Title | Some Entry Leading and Ending With. . .
Date | Time | Title | Description
08/12/23 | 6:54 PM | My Awesome Title | Some Entry Leading and Ending With. . .
4 Replies
Buddy
Buddy11mo ago
Mekasu0124
Mekasu012411mo ago
I apprecaite it, but I have not learned how to use interfaces as of yet, so this is a bit out of my reach.
Mekasu0124
Mekasu012411mo ago
ok thank you. can I ask another question? I am creating an item through a model, and that model's date property is a DateOnly. In my code, I'm converting it to such, but I'm wondering if I'm doing it right.
private DiaryItem CreateDiaryItem()
{
var date = DateOnly.FromDateTime(DateTime.Now);
var time = TimeOnly.FromTimeSpan(...);
return new DiaryItem { Description = Description, Title = Title, Date = date, Time = time };
}
private DiaryItem CreateDiaryItem()
{
var date = DateOnly.FromDateTime(DateTime.Now);
var time = TimeOnly.FromTimeSpan(...);
return new DiaryItem { Description = Description, Title = Title, Date = date, Time = time };
}
if I'm not doing this right, then I apologize. Still learning some libraries. I need to separate the current date and time into two separate variables and I need the date to be a DateOnly and the time to be a TimeOnly. nevermind. solved it
Want results from more Discord servers?
Add your server
More Posts
✅ An API refuses my Connection from MAC but not Windows.Hello there!! Could you give me a hand with this? I'm using MAUI & Blazor. Previously, I didn't ge✅ ✅ User's required to have .NET installed when launching application???https://github.com/mekasu0124/Todo I created my own Todo application, and using Visual Studio to bu❔ Find last element in dictionnary, using a list as pathHey, I have a dictionnary: ```c# Dictionary<string, object> tree => new() { { "show", ❔ AWS DDB and Lambda integration doesn't workAs mentioned in the title, I have created a DDB - Lambda - API gateway construct according to this t❔ c# .net6 cryptograpy exampleHello. I'm searching for an example for encryption. I already looked at: https://learn.microsoft.co❔ Call base method in multiple inheritanceExample of what i have: ```CSharp public class A { public virtual void Foo() { Console.Writ❔ Change datatype during program executionI have following two properties: private ContextType ExportContext = 0; private List<T> SelectedIte❔ Is there a way to override a Variable in the .csproj by a project that is reference this project?Is there a way to override a Variable in the .csproj by a project that is reference this project?❔ C# Database Query Optimization [Dapper & ReactJS]I am currently working on a C# .NET app with React and I have a table of products in an overview pag❔ Sharpie-Curses fails to find curses lib on WindowsI'm attempting to get this library to work on windows, but despite the inclusion of precompiled PDCu