How to group a Radio buttons row wise ,i have 3 radio button in 4th row and 3 radio button in 8th row, now i have to make group 4th row radio buttons as group 1 and 8th row radio button as group 2
static void Main(string[] args)
{
string root = @“D:\New folder”;
System.IO.DirectoryInfo di = new DirectoryInfo(root);
if (Directory.Exists(root))
{
foreach (FileInfo file in di.GetFiles())
{
file.Delete();
}
// Directory.Delete(root);
}
Workbook excelbook = new Workbook();
// Worksheet objtempworksheet = null;
//int Row = 3;
List<Aspose.Cells.Drawing.GroupShape> grp = new List<GroupShape>();
List<Aspose.Cells.Drawing.Shape[]> sh = new List<Shape[]>();
for (int Row = 3; Row <= 8; Row++)
{
Aspose.Cells.Drawing.Shape[] shapeobjects = new Aspose.Cells.Drawing.Shape[4];
int column = 1;
//}
Aspose.Cells.Drawing.GroupBox box = excelbook.Worksheets[0].Shapes.AddGroupBox(Row, 0, column, 0, 21,150);
box.Name = "Example";
//box.HasLine.
//box.IsHidden = true;
int j = 0; ;
List<Aspose.Cells.Drawing.RadioButton> listradio = new List<Aspose.Cells.Drawing.RadioButton>();
for (int i = 1; i <= 3; i++)
{
listradio.Add(excelbook.Worksheets[0].Shapes.AddRadioButton(Row, 0, column, 0, 30,40));
column++;
}
Row++; Row++; Row++; Row++;
column++;
shapeobjects[j] = box;
j++;
foreach (Aspose.Cells.Drawing.RadioButton item in listradio)
{
shapeobjects[j] = item;
j++;
}
//sh.Add(shapeobjects);
grp.Add(excelbook.Worksheets[0].Shapes.Group(shapeobjects));
//Aspose.Cells.Drawing.GroupShape group = excelbook.Worksheets[0].Shapes.Group(shapeobjects);
}
// Aspose.ce
excelbook.Worksheets[0].IsGridlinesVisible = false;
// Restricting users to edit contents of the worksheet
excelbook.Worksheets[0].Protection.AllowEditingContent = true;
// Restricting users to edit objects of the worksheet
excelbook.Worksheets[0].Protection.AllowEditingObject = true;
// Restricting users to edit scenarios of the worksheet
excelbook.Worksheets[0].Protection.AllowEditingScenario = false;
excelbook.Worksheets[0].Protection.AllowDeletingRow = false;
excelbook.Worksheets[0].Protection.AllowDeletingColumn = false;
excelbook.Worksheets[0].Protection.AllowInsertingColumn = false;
excelbook.Worksheets[0].Protection.AllowInsertingRow = false;
excelbook.Save("D:\\New folder\\" + "book1.xls");
// The code provided will print ‘Hello World’ to the console.
// Press Ctrl+F5 (or go to Debug > Start Without Debugging) to run your app.
//string dataDir = RunExamples.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
//string root = @"D:\New folder";
// System.IO.DirectoryInfo di = new DirectoryInfo(root);
//if (Directory.Exists(root))
//{
// foreach (FileInfo file in di.GetFiles())
// {
// file.Delete();
// }
// // Directory.Delete(root);
//}
//Workbook excelbook = new Workbook();
//excelbook.Worksheets[0].IsGridlinesVisible = false;
//excelbook.Worksheets[0].Protection.AllowDeletingRow = false;
//excelbook.Worksheets[0].Protection.AllowDeletingColumn = false;
//excelbook.Worksheets[0].Protection.AllowInsertingColumn = false;
//excelbook.Worksheets[0].Protection.AllowInsertingRow = false;
//// Worksheet objtempworksheet = null;
//int row = 1;
//for (int ques = 1; ques <= 2; ques++)
//{
// //}
// Aspose.Cells.Drawing.GroupBox box = excelbook.Worksheets[0].Shapes.AddGroupBox(row, 0, 1, 0, 100, 250);
// box.Name = "Example";
// //box.HasLine.
// int j = 1;
// List<RadioButton> listradio = new List<RadioButton>();
// for (int i = 1; i <= 3; i++)
// {
// listradio.Add(excelbook.Worksheets[0].Shapes.AddRadioButton(row, 0, 1, 0, 30, 110));
// row++;
// }
// row++;row++; row++; row++;
// Aspose.Cells.Drawing.Shape[] shapeobjects = new Aspose.Cells.Drawing.Shape[4];
// shapeobjects[0] = box;
// //int i = 1;
// foreach (RadioButton item in listradio)
// {
// shapeobjects[j] = item;
// j++;
// }
// Aspose.Cells.Drawing.GroupShape group = excelbook.Worksheets[0].Shapes.Group(shapeobjects);
//}
//excelbook.Save("D:\\New folder\\" + "book1.xls");
// Go to http://aka.ms/dotnet-get-started-console to continue learning how to build a console app!
}