Page 1 of 1

Jiwa Grid Button Cell Witdth and Appearance.

PostPosted: Thu Sep 08, 2016 5:22 pm
by SBarnes
Hi Guys


Is there a way to set the width of the button cell type, I have the code below and each column follows the width instructions given to it even the check box but the button goes to the same size regardless of the width given to it?

Also is there a way to make the button appear in every row rather than just the row that has focus, the checkbox happily does this?

private void SetupLinesGrid()
{
//System.Diagnostics.Debugger.Break();
jgRunLines.AddColumn("RecID", new JiwaFinancials.Jiwa.JiwaApplication.JiwaManageGrid.JiwaTextCellType(), "RecID", 0, false, false, false, true);
jgRunLines.AddColumn("Invoice", new JiwaFinancials.Jiwa.JiwaApplication.JiwaManageGrid.JiwaTextCellType(), "Invoice", 5, false, true, false, true);
jgRunLines.AddColumn("View", new JiwaFinancials.Jiwa.JiwaApplication.JiwaManageGrid.JiwaButtonCellType() {Text = "View"}, "View", 15, false, true, false,false);

jgRunLines.AddColumn("InvoiceDate", new JiwaFinancials.Jiwa.JiwaApplication.JiwaManageGrid.JiwaTextCellType(), "Date", 5, false, true, false, true);
jgRunLines.AddColumn("DBName", new JiwaFinancials.Jiwa.JiwaApplication.JiwaManageGrid.JiwaTextCellType(), "Customer", 15, false, true, false, true);
jgRunLines.AddColumn("DBDelAddress", new JiwaFinancials.Jiwa.JiwaApplication.JiwaManageGrid.JiwaTextCellType(), "Delivery Address", 25, false, true, false, true);
jgRunLines.AddColumn("DBFFwdAddress", new JiwaFinancials.Jiwa.JiwaApplication.JiwaManageGrid.JiwaTextCellType(), "Freight Fwd Address", 25, false, true, false, true);
jgRunLines.AddColumn("NoItems", new JiwaFinancials.Jiwa.JiwaApplication.JiwaManageGrid.JiwaQuantityCellType(), "No. Items", 5, false, true, false,false,DecimalPlaces: 0);
jgRunLines.AddColumn("Chosen", new FarPoint.Win.Spread.CellType.CheckBoxCellType(), "Select", 5, false, true, false, false);
//jgRunLines.AddColumn("Direction", new JiwaFinancials.Jiwa.JiwaApplication.JiwaManageGrid.JiwaTextCellType(), "Direction", 25, false, true, false, true);
jgRunLines.ActiveSheet.OperationMode = FarPoint.Win.Spread.OperationMode.RowMode;
jgRunLines.EditModePermanent = false;
jgRunLines.SelectionBlockOptions = FarPoint.Win.Spread.SelectionBlockOptions.Rows;

jgRunLines.SetupComplete();
}

Re: Jiwa Grid Button Cell Witdth and Appearance.

PostPosted: Thu Sep 08, 2016 5:46 pm
by Scott.Pearce
For the width, try setting it after the call to AddColum().

For the button appearance, have a look at the ButtonDrawMode property of the grid.

Note: JiwaGrid inherits from GrapeCity Spread for Windows Forms (v8.0 at the time of writing). You may find it helpful to go and download/install the trail version from here, then look at C:\Program Files (x86)\GrapeCity\Spread Studio 8\Docs\Windows Forms\FarPoint.Win.Spread.8.0.chm for a treasure-trove of information!

Re: Jiwa Grid Button Cell Witdth and Appearance.  Topic is solved

PostPosted: Thu Sep 08, 2016 6:16 pm
by SBarnes
Thanks for the help Scott,

just so the topic is complete for anyone else the two pieces of code to fix the two issues are:

jgRunLines.ActiveSheet.Columns["View"].Width = 50;

and

jgRunLines.ButtonDrawMode = FarPoint.Win.Spread.ButtonDrawModes.Always;