We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Combo in grid in cell

I''m trying to get a combobox typed cell in a grid-in-a-cell to display, let''s say the full name of a person when dropped down and only its number when closed. How should I do that?

7 Replies

AD Administrator Syncfusion Team June 29, 2005 07:24 PM UTC

So, in the drop list, you want to see full names, but in the textbox portion of the cell, you want to see something else? Here is what I would try first. Set you your combobox cell style to use a style.DataSource, style.DataMember and Style.ValueMember. This way your values in the grid will be style.ValueMember type objects, and the display in teh grid will show the style.DisplayMember object. Then to get the textbox portion to display teh ValueMember instead of the DisplayMember, in the DrawCellDisplayText event, set e.Text = e.Style.Text.


MC Martin Cyr June 29, 2005 07:38 PM UTC

I already did set the Display and Value Members, but I can''t find the value, only the display. Text, FormattedText and CellValue all points out to the display member...


AD Administrator Syncfusion Team June 29, 2005 07:51 PM UTC

Here is a little sample showing what I described. http://www.syncfusion.com/Support/user/uploads/GDBG_GLC_78d853d9.zip


MC Martin Cyr June 30, 2005 01:58 PM UTC

Again, I did that, the only difference is that I need it in a Grid-in-a-cell. Here''s what I did, if you can tell me why it''s not working... =\ Btw, it''s in VB.NET, so if it''s a problem, just say and I''ll try to convert to C#... GridTest_2868.zip


MC Martin Cyr June 30, 2005 02:12 PM UTC

And also, how could I add more than one "inner grid" to the cell? Or should I divide the cell? Or perhaps just merge the headers? (I need 2x2 inner grids in each cell)


AD Administrator Syncfusion Team June 30, 2005 02:13 PM UTC

When I run your sample, as soon as I click off the cell (in the inner grid), then value member is shown. I am using 3.2.1.0. If you want to see it as soon as the dropdown closes, then you can override OnCurrentCellCloseDropDown in the embedded grid class and end the edit at that point. Protected Overrides Sub OnCurrentCellCloseDropDown(ByVal e As Syncfusion.Windows.Forms.PopupClosedEventArgs) Me.CurrentCell.EndEdit() End Sub


MC Martin Cyr June 30, 2005 02:18 PM UTC

Argh, you got me on that one, sorry, I didn''t try changing cell :) Now for the 2x2 inner grids... Thanks a lot Clay

Loader.
Live Chat Icon For mobile
Up arrow icon