Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Adding Checkbox Control to Flexgrid

Posted on 2002-06-18
8
Medium Priority
?
487 Views
Last Modified: 2012-08-14
Hi Friends

I wann a solution for how can i add checkbox to a flex grid control.

I am having 6 columns on which first two column with contain text data and remaining four will be check box. So suggest me how I can add checkbox control when I am populating data in flex grid.

I tried with controll array, but my checkbox is not displaying on flexgrid, it is geting displayed on form.

And i wann it to displayed it should not hide if i leave the cell.
0
Comment
Question by:GautamMukherjee
8 Comments
 

Expert Comment

by:ajax625
ID: 7087624
I would do it slightly differently :
There always poses a problem when trying to position a checkbox upon a grid esp when the grid shows vertical scrollers.

what id like to suggest is that u set the text of the cell to look like check or uncheck in the click event of the grid

Private Sub MSFlexGrid1_Click()
With MSFlexGrid1
    .CellFontName = "wingdings"
    .CellAlignment = flexAlignCenterCenter
    .CellFontSize = 16
    If .TextMatrix(.Row, .Col) = vbNullString Then
        .TextMatrix(.Row, .Col) = "ü"
    Else
        .TextMatrix(.Row, .Col) = vbNullString
    End If
End With
End Sub

Subsequently upon save u go thru a routine that'll check the values in the grid and make sense of it

0
 

Expert Comment

by:ajax625
ID: 7087631
I would do it slightly differently :
There always poses a problem when trying to position a checkbox upon a grid esp when the grid shows vertical scrollers.

what id like to suggest is that u set the text of the cell to look like check or uncheck in the click event of the grid

Private Sub MSFlexGrid1_Click()
With MSFlexGrid1
    .CellFontName = "wingdings"
    .CellAlignment = flexAlignCenterCenter
    .CellFontSize = 16
    If .TextMatrix(.Row, .Col) = vbNullString Then
        .TextMatrix(.Row, .Col) = "ü"
    Else
        .TextMatrix(.Row, .Col) = vbNullString
    End If
End With
End Sub

Subsequently upon save u go thru a routine that'll check the values in the grid and make sense of it

0
 
LVL 43

Expert Comment

by:TimCottee
ID: 7087842
The method for using a flexgrid in combination with any editing control; textbox, combobox, checkbox etc is detailed here.

http://support.microsoft.com/default.aspx?scid=kb;en-us;Q241355
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Author Comment

by:GautamMukherjee
ID: 7092577
Sorry Tim that not solved my problem
0
 
LVL 43

Expert Comment

by:TimCottee
ID: 7092653
Now that I look at the question again it probably won't solve your problem. Unfortunately whilst the link I provided is great for certain things it doesn't really help much in respect of checkboxes. The only solutions that work with this rather than a commercial grid product which have this functionality is to simulate a checkbox using two bitmaps. If you have an image of a selected and unselected checkbox, you can then use the .CellPicture property of a specified cell to make it appear as if there is a checkbox in the cell. You then need to store a value that corresponds with the displayed image. This can work quite effectively though it is not a perfect solution.
0
 

Accepted Solution

by:
ajax625 earned 200 total points
ID: 7094730
The real problem when u use a bitmap, instead of a font/text is that  when u r ready to read the values of the grid, tryin to figure out what cell is checked and whats unchecked, u have to compare the names of the bitmap that u used. If u r using a resource (.res) to store the bitmap and loadin 'em in the grid, ur problem increases because u have nothing to compare with.

I have always used symbolic fonts to achieve this and never had a problem. If however ur sceptical about using certain fonts, u might wanna use symbols like #,@ etc.

.TextMatrix(.Row, .Col) = "#"

anyway cheers

0
 
LVL 49

Expert Comment

by:DanRollins
ID: 7911156
Hi GautamMukherjee,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:

    Accept ajax625's comment(s) as an answer.

GautamMukherjee, if you think your question was not answered at all or if you need help, just post a new comment here; Community Support will help you.  DO NOT accept this comment as an answer.

EXPERTS: If you disagree with that recommendation, please post an explanatory comment.
==========
DanRollins -- EE database cleanup volunteer
0
 

Expert Comment

by:SpideyMod
ID: 7967822
per recommendation

SpideyMod
Community Support Moderator @Experts Exchange
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

927 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question