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

Checkboxes on right?

Is there a property that will make the box appear on the righthand side of the checkbox control similar to VB.NET where I''d use: chkMyChecbox.CheckAlign = ContentAlignment.MiddleRight I can''t find one in the 1100 or so properties shown by intellisense. :) Thanks!

6 Replies

AD Administrator Syncfusion Team February 8, 2005 03:53 PM UTC

If you want the checkbox on the right instead of the middle, you can set the style.TextMargin property to handle this. this.grid.Binder.InternalColumns["chkCol"].StyleInfo.TextMargins.Left = this.grid.Model.ColWidths["chkCol"] - 20; If you have added GridBoundColumns, use grid.GridBoundColumns instead of grid.Binder.InternalColumns.


JO John February 8, 2005 08:38 PM UTC

Hi Clay, I find the object model unweildly and I don''t understand what your proposing. I am loading a grid with data at runtime in unbound mode. I get to a cell I''d like to put a checkbox in as follows: GridControl1(mRows, 2).Description = "OK" GridControl1(mRows, 2).CellType = "CheckBox" GridControl1(mRows, 2).CellValue = False How can I tell this checkbox to have the box itself on the right hand side of the description? Thanks!


AD Administrator Syncfusion Team February 8, 2005 09:32 PM UTC

Hi John, with a regular grid use these lines: GridControl1(mRows, 2).TextAlign = GridTextAlign.Right; GridControl1(mRows, 2).HorizontalAlignment = GridHorizontalAlignment.Right; // optionally - in case you want to increase space between description text and checker GridControl1(mRows, 2).TextMargis.Right = 5; Stefan >Hi Clay, > >I find the object model unweildly and I don''t understand what your proposing. I am loading a grid with data at runtime in unbound mode. I get to a cell I''d like to put a checkbox in as follows: >GridControl1(mRows, 2).Description = "OK" >GridControl1(mRows, 2).CellType = "CheckBox" >GridControl1(mRows, 2).CellValue = False >How can I tell this checkbox to have the box itself on the right hand side of the description? >Thanks!


JO John February 8, 2005 10:33 PM UTC

Hi Stephan, GridControl1(mRows, 2).TextAlign = GridTextAlign.Right or left seems to have no affect on the cell. I have Essential Grid 1.6.1.8 and the documentation does not list a checkbox as one of the cell types this property effects. The property: GridControl1(mRows, 2).HorizontalAlignment did successfully move checkbox and text to the righthand side of the cell...but I''m still searching for that property that moves the box to the right hand side of the text portion of the control. Thanks!


AD Administrator Syncfusion Team February 8, 2005 10:43 PM UTC

John, It is most likely that TextAlign support was only added after 1.6. I am attaching the code used in 2.x codebase that implements checkboxes. You could take that code and include it into a C# project of your own and with some luck and minor changes you should be able to get that working. GridCheckBoxCell_7436.zip The other option is to upgrade to 2.x or 3.x. Stefan >Hi Stephan, > >GridControl1(mRows, 2).TextAlign = GridTextAlign.Right or left >seems to have no affect on the cell. I have Essential Grid 1.6.1.8 and the documentation does not list a checkbox as one of the cell types this property effects. > >The property: >GridControl1(mRows, 2).HorizontalAlignment >did successfully move checkbox and text to the righthand side of the cell...but I''m still searching for that property that moves the box to the right hand side of the text portion of the control. >Thanks!


JO John February 9, 2005 02:21 PM UTC

Stefan, Thanks for your help. Upgrading to 2.x solved the problem. - John

Loader.
Live Chat Icon For mobile
Up arrow icon