Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7503945
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T21:24:11+00:00 2026-05-29T21:24:11+00:00

I have drawn a checkbox in devexpress grid group row using the code below.

  • 0

I have drawn a checkbox in devexpress grid group row using the code below.

using DevExpress.XtraGrid.Views.Base;
using DevExpress.XtraGrid.Drawing;
using DevExpress.Utils.Drawing;
using DevExpress.XtraGrid.Views.Grid.ViewInfo;
using DevExpress.XtraEditors.Repository;
using DevExpress.XtraEditors.ViewInfo
using DevExpress.XtraEditors.Drawing;
//...
void gvWorkspaces_CustomDrawGroupRow(object sender, RowObjectCustomDrawEventArgs e) {
    GridGroupRowPainter groupRowPainter = (GridGroupRowPainter)e.Painter;
    GridGroupRowInfo info = (GridGroupRowInfo)e.Info;
    groupRowPainter.DrawGroupRowBackground(info);
    groupRowPainter.DrawObject(info);
    Rectangle checkRect = info.ButtonBounds;
    checkRect.X = e.Bounds.Right - checkRect.Width -4;
    DrawCheckBox(e.Graphics, checkRect, true);
    e.Handled = true;
}
void DrawCheckBox(Graphics graphics, Rectangle r, bool Checked) {
    RepositoryItemCheckEdit edit = new RepositoryItemCheckEdit();
    CheckEditViewInfo info = (CheckEditViewInfo)edit.CreateViewInfo();
    info.EditValue = Checked;
    info.Bounds = r;
    info.CalcViewInfo(graphics);

    CheckEditPainter painter = (CheckEditPainter)edit.CreatePainter();
    ControlGraphicsInfoArgs args = new ControlGraphicsInfoArgs(info, new GraphicsCache(graphics), r);
    painter.Draw(args);
    args.Cache.Dispose();
}

However, I am having challenges in accessing the checkbox to tick and untick.

I tried to use GridHitInfo in GridView click event (as below). But I am not getting anything that could help me to access the checkbox.

void gvWorkspaces_Click(object sender, EventArgs e) {
    GridView view = (GridView)sender;
    Point pt = view.GridControl.PointToClient(Control.MousePosition);
    GridHitInfo info = view.CalcHitInfo(pt);
}

Any help would be appreciated.

Thanks

Balan

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T21:24:12+00:00Added an answer on May 29, 2026 at 9:24 pm

    You should use the following approach:

    RepositoryItemCheckEdit edit;
    CheckEditViewInfo editInfo;
    CheckEditPainter editPainter;
    //...
        edit = new RepositoryItemCheckEdit();
        editInfo = (CheckEditViewInfo)edit.CreateViewInfo();
        editPainter = (CheckEditPainter)edit.CreatePainter();
    }
    Hashtable checkedRows = new Hashtable();
    Hashtable editorRects = new Hashtable();
    void gvWorkspaces_Click(object sender, EventArgs e) {
        GridView view = (GridView)sender;
        Point pt = view.GridControl.PointToClient(Control.MousePosition);
        GridHitInfo info = view.CalcHitInfo(pt);
        if(info.InRow) {
            Rectangle editorRect = (Rectangle)editorRects[info.RowHandle];
            if(editorRect.Contains(pt)) {
                object value = checkedRows[info.RowHandle]; 
                if(value == null)
                    checkedRows[info.RowHandle] = true;
                else checkedRows.Remove(info.RowHandle);
                view.GridControl.Invalidate(editorRect);
            }
        }
    }
    void gvWorkspaces_CustomDrawGroupRow(object sender, RowObjectCustomDrawEventArgs e) {
        e.Painter.DrawObject(e.Info);
        GridGroupRowInfo info = (GridGroupRowInfo)e.Info;
        Rectangle checkRect = info.ButtonBounds;
        checkRect.X = e.Bounds.Right - checkRect.Width - 4;
        DrawCheckEdit(e.Graphics, checkRect, checkedRows[e.RowHandle] != null);
        editorRects[e.RowHandle] = checkRect; // cache rectangle
        e.Handled = true;
    }
    void DrawCheckEdit(Graphics graphics, Rectangle r, bool cheched) {
        editInfo.EditValue = cheched;
        editInfo.Bounds = r;
        editInfo.CalcViewInfo(graphics);
        using(GraphicsCache cache = new GraphicsCache(graphics)) {
            editPainter.Draw(new ControlGraphicsInfoArgs(editInfo, cache, r));
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have drawn an image on a Composite using the following code imageCanvas =
I have drawn circle using circle = new google.maps.Circle({ map: map, radius: r, //
I have drawn up the following PHP code which processes the data from a
I have drawn a bar chart without xml.I have to add a button below
I have drawn an icon in Inkscape , but would now like to programmatically
I have drawn an object on NSView subclass. How can the object know that
I have drawn something like this: How to remove the paths and points?
I have drawn into a CGContext of a UIView. - (void)drawRect:(CGRect)rect { [self drawInContext:UIGraphicsGetCurrentContext()]
I have a MyCanvas class that extends JComponent. On this canvas I have drawn
If I have a sprite, with which I have drawn some stuff, how do

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.