Does WinForms have controls for a chat thread?

Posted by: spaceage15 on 12 July 2022, 5:47 pm EST

  • Posted 12 July 2022, 5:47 pm EST

    Hi, I’m looking to create a chat thread screen for our current desktop application to display a conversation between too people. Are there any examples of this in the Winforms samples? I couldn’t find any.

    I was thinking that I can use a C1flexgrid with two columns, remove the gridlines, and then offset the cells to make it look like a chat conversation.

    Any suggestions would be great. Thanks.

    regards,

    Ed

  • Posted 12 July 2022, 5:49 pm EST

    Its a message conversation view that I want to build.

  • Posted 13 July 2022, 3:01 am EST

    Hi Ed,

    Unfortunately, there isn’t any ready-to-use Control/Sample available in the ComponentOne WinForms for the chat functionality. You will need to implement a custom control according to your requirements, for which the most suitable control would be the C1FlexGrid as it can be customized heavily as per the requirements.

    If you face any issues in customizing the C1FlexGrid or using any feature of the C1FlexGrid, you can let us know and we will help you accordingly.

    Kind Regards,

    Kartik

  • Posted 13 July 2022, 12:48 pm EST

    Hello Kartik,

    I understand.

    So is there a way to add the bubble like images in the cell behind the text in a C1Flexgrid. I want to look like a message chat. How would I do this?

    Is it just simply adding the image to the background-image of the cell row?

    Perhaps you can provider a sample if its too complex to explain. Thanks

    Regards

  • Posted 13 July 2022, 1:14 pm EST

    And is there a way to place a timestamp on the same where the text is cell? I’m not sure how that can be down if the timestamp will have a different font style in the same cell

  • Posted 15 July 2022, 1:23 am EST

    Hi Ed,

    From the initial query, we thought you only want a Chat view to display some messages/conversations. That is why we suggested that C1FlexGrid can be used in this way. But now it seems like you are trying to create a whole message conversation control, where two or more people can chat, with proper look and feel, along with active conversations.

    While creating a sample to investigate your requirements, we observed that there are a lot of customizations and custom drawings needed in the C1FlexGrid to create this kind of customized user control to have the required view. This will increase the code complexity by many folds as well as will hit the performance for long chat threads. Also, doing this much customization will decrease the manageability and extensibility of the control eventually with an overhead of maintaining all the chat data as well.

    We discussed your requirements with the product and the development team, and they also agreed that the C1FlexGrid is not the best option for now to implement this business use case. Although, the development team has liked this idea and has added it as an enhancement to add some options for such a use case in the future.

    We apologize for all the inconvenience caused at your end

    Kind Regards,

    Kartik

  • Posted 19 July 2022, 4:28 pm EST - Updated 3 October 2022, 10:21 pm EST

    Hi Kartik,

    I understand the performance concerns. My requirement was only to have a message view control. I managed to build what we needed using the C1flexgrid to get us through the first step of the enhancement.

    The problem I’m having at the moment is that some row heights are way larger than the text uses in that cell.

    I attached a screenshot.

  • Posted 19 July 2022, 4:29 pm EST

    I’m calling AutoSizeRows() but that doesn’t seem to adjust the height on large text cells.

  • Posted 20 July 2022, 4:37 am EST

    Which version do you use? Some older versions had issues with AutoSizeRows (see https://www.grapecity.com/forums/winforms-edition/c1flexgrid-regression-in-5 - but this issue does not sound like your problem), but this was fixed with version .557.

    If upgrading to the new version does not help: could you post a small self running sample?

    Best regards

    Wolfgang

  • Posted 20 July 2022, 5:44 am EST

    Hi,

    We tried to replicate the issue by creating a sample similar to your screenshot and adding dummy messages to it, but we could not see the issue at our end (C1FlexGrid v4.5.20221.557). Please refer to the attached screenshot and sample showing the same. Could you please provide a small sample showing your implementation, so we can investigate further on this?

    Also, for your information, this auto-sizing behavior might be observed if you manually set the C1FlexGrid.Rows.DefaultSize property. If the DefaultSize property is set to a value that is greater than the AutoSized height of the Row, then the DefaultSize property will act as the minimum size for the row, resulting in the row not AutoSizing.

    Sometimes, this behavior with the Row AutoSizing is observed when there exist extra spaces/line breaks in the cell data. We suggest you confirm that this is not the case in your cells.

    MessangerTest.zip

    AutoSizeRows.zip

    PS: Thanks for the suggestion, Wolfgang!

    Kind Regards,

    Kartik

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels