Jiwa Grid Button Cell Witdth and Appearance.  Topic is solved

Discussions relating to plugin development, and the Jiwa API.

Jiwa Grid Button Cell Witdth and Appearance.

Postby SBarnes » Thu Sep 08, 2016 5:22 pm

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();
}
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1620
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 175

Re: Jiwa Grid Button Cell Witdth and Appearance.

Postby Scott.Pearce » Thu Sep 08, 2016 5:46 pm

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!
Scott Pearce
Senior Analyst/Programmer
Jiwa Financials
User avatar
Scott.Pearce
Senpai
Senpai
 
Posts: 743
Joined: Tue Feb 12, 2008 11:27 am
Location: New South Wales, Australia
Topics Solved: 221

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

Postby SBarnes » Thu Sep 08, 2016 6:16 pm

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;
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1620
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 175


Return to Technical and or Programming

Who is online

Users browsing this forum: ThomasC and 20 guests