Interface IRows
Represents a collection of IRow objects in a table.
Inherited Members
Namespace: Syncfusion.Presentation
Assembly: Syncfusion.Presentation.Base.dll
Syntax
public interface IRows : IEnumerable<IRow>, IEnumerable
Properties
Count
Gets the number of elements in the rows collection. Read-only.
Declaration
int Count { get; }
Property Value
Type |
---|
System.Int32 |
Examples
//Create instance of PowerPoint presentation
IPresentation presentation = Presentation.Create();
//Add slide to the presentation
ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
//Add table to the slide
ITable table = slide.Shapes.AddTable(2, 2, 100, 120, 300, 200);
//Get the row collection from table
IRows rows = table.Rows;
//Retrieve a single row from the row collection, read only
IRow row = table.Rows[0];
//Add a specific row to the collection
rows.Add(row);
//Get the count of row collection, read only
int count = rows.Count;
//Save the presentation
presentation.Save("Sample.pptx");
//Close the presentation
presentation.Close();
'Create instance of PowerPoint presentation
Dim presentation__1 As IPresentation = Presentation.Create()
'Add slide to the presentation
Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
'Add table to the slide
Dim table As ITable = slide.Shapes.AddTable(2, 2, 100, 120, 300, 200)
'Get the row collection from table
Dim rows As IRows = table.Rows
'Retrieve a single row from the row collection, read only
Dim row As IRow = table.Rows(0)
'Add a specific row to the collection
rows.Add(row)
'Get the count of row collection, read only
Dim count As Integer = rows.Count
'Save the presentation
presentation__1.Save("Sample.pptx")
'Close the presentation
presentation__1.Close()
Item[Int32]
Gets a IRow instance at the specified index from the row collection. Read-only.
Declaration
IRow this[int rowIndex] { get; }
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | rowIndex | Specifies the index of the row to locate. |
Property Value
Type | Description |
---|---|
IRow | Returns an IRow instance. |
Examples
//Create instance of PowerPoint presentation
IPresentation presentation = Presentation.Create();
//Add slide to the presentation
ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
//Add table to the slide
ITable table = slide.Shapes.AddTable(2, 2, 100, 120, 300, 200);
//Get the row from row collection
IRow row = table.Rows[0];
//Set the height of the row
row.Height = 30;
//Save the presentation
presentation.Save("Sample.pptx");
//Close the presentation
presentation.Close();
'Create instance of PowerPoint presentation
Dim presentation__1 As IPresentation = Presentation.Create()
'Add slide to the presentation
Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
'Add table to the slide
Dim table As ITable = slide.Shapes.AddTable(2, 2, 100, 120, 300, 200)
'Get the row from row collection
Dim row As IRow = table.Rows(0)
'Set the height of the row
row.Height = 30
'Save the presentation
presentation__1.Save("Sample.pptx")
'Close the presentation
presentation__1.Close()
Methods
Add()
Adds a new row at the end of the row collection.
Declaration
IRow Add()
Returns
Type | Description |
---|---|
IRow | Returns the newly added IRow instance. |
Examples
//Create instance of PowerPoint presentation
IPresentation presentation = Presentation.Create();
//Add slide to the presentation
ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
//Add table to the slide
ITable table = slide.Shapes.AddTable(2, 2, 100, 120, 300, 200);
//Get the row collection from table
IRows rows = table.Rows;
//Add row to the collection
rows.Add();
//Save the presentation
presentation.Save("Sample.pptx");
//Close the presentation
presentation.Close();
'Create instance of PowerPoint presentation
Dim presentation__1 As IPresentation = Presentation.Create()
'Add slide to the presentation
Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
'Add table to the slide
Dim table As ITable = slide.Shapes.AddTable(2, 2, 100, 120, 300, 200)
'Get the row collection from table
Dim rows As IRows = table.Rows
'Add row to the collection
rows.Add()
'Save the presentation
presentation__1.Save("Sample.pptx")
'Close the presentation
presentation__1.Close()
Add(IRow)
Adds the specified row at the end of the row collection.
Declaration
int Add(IRow row)
Parameters
Type | Name | Description |
---|---|---|
IRow | row | Represents an IRow instance to be added. |
Returns
Type | Description |
---|---|
System.Int32 | Returns the zero-based index of the newly added row object in the row collection. |
Examples
//Create instance of PowerPoint presentation
IPresentation presentation = Presentation.Create();
//Add slide to the presentation
ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
//Add table to the slide
ITable table = slide.Shapes.AddTable(2, 2, 100, 120, 300, 200);
//Get the row collection from table
IRows rows = table.Rows;
//Retrieve a single row from the row collection, read only
IRow row = table.Rows[0];
//Add a specific row to the collection
rows.Add(row);
//Save the presentation
presentation.Save("Sample.pptx");
//Close the presentation
presentation.Close();
'Create instance of PowerPoint presentation
Dim presentation__1 As IPresentation = Presentation.Create()
'Add slide to the presentation
Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
'Add table to the slide
Dim table As ITable = slide.Shapes.AddTable(2, 2, 100, 120, 300, 200)
'Get the row collection from table
Dim rows As IRows = table.Rows
'Retrieve a single row from the row collection, read only
Dim row As IRow = table.Rows(0)
'Add a specific row to the collection
rows.Add(row)
'Save the presentation
presentation__1.Save("Sample.pptx")
'Close the presentation
presentation__1.Close()
Clear()
Removes all the elements from row collection.
Declaration
void Clear()
Examples
//Create instance of PowerPoint presentation
IPresentation presentation = Presentation.Create();
//Add slide to the presentation
ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
//Add table to the slide
ITable table = slide.Shapes.AddTable(2, 2, 100, 120, 300, 200);
//Get the row collection from table
IRows rows = table.Rows;
//Retrieve a single row from the row collection, read only
IRow row = table.Rows[0];
//Add a specific row to the collection
rows.Add(row);
//Clear the row collection
rows.Clear();
//Save the presentation
presentation.Save("Sample.pptx");
//Close the presentation
presentation.Close();
'Create instance of PowerPoint presentation
Dim presentation__1 As IPresentation = Presentation.Create()
'Add slide to the presentation
Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
'Add table to the slide
Dim table As ITable = slide.Shapes.AddTable(2, 2, 100, 120, 300, 200)
'Get the row collection from table
Dim rows As IRows = table.Rows
'Retrieve a single row from the row collection, read only
Dim row As IRow = table.Rows(0)
'Add a specific row to the collection
rows.Add(row)
'Clear the row collection
rows.Clear()
'Save the presentation
presentation__1.Save("Sample.pptx")
'Close the presentation
presentation__1.Close()
IndexOf(IRow)
Returns the zero-based index of the first occurrence of the IRow instance within the collection.
Declaration
int IndexOf(IRow value)
Parameters
Type | Name | Description |
---|---|---|
IRow | value | The IRow instance to locate in the collection. |
Returns
Type | Description |
---|---|
System.Int32 | Returns the zero-based index of the first occurrence of row instance within the collection, if found; otherwise, –1. |
Examples
//Create instance of PowerPoint presentation
IPresentation presentation = Presentation.Create();
//Add slide to the presentation
ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
//Add table to the slide
ITable table = slide.Shapes.AddTable(2, 2, 100, 120, 300, 200);
//Get the row collection from table
IRows rows = table.Rows;
//Retrieve a single row from the row collection, read only
IRow row = table.Rows[0];
//Add a specific row to the collection
rows.Add(row);
//Get the index of a specific row from the collection
int index = rows.IndexOf(row);
//Save the presentation
presentation.Save("Sample.pptx");
//Close the presentation
presentation.Close();
'Create instance of PowerPoint presentation
Dim presentation__1 As IPresentation = Presentation.Create()
'Add slide to the presentation
Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
'Add table to the slide
Dim table As ITable = slide.Shapes.AddTable(2, 2, 100, 120, 300, 200)
'Get the row collection from table
Dim rows As IRows = table.Rows
'Retrieve a single row from the row collection, read only
Dim row As IRow = table.Rows(0)
'Add a specific row to the collection
rows.Add(row)
'Get the index of a specific row from the collection
Dim index As Integer = rows.IndexOf(row)
'Save the presentation
presentation__1.Save("Sample.pptx")
'Close the presentation
presentation__1.Close()
Insert(Int32, IRow)
Inserts the specified row at specified index in the table.
Declaration
void Insert(int index, IRow value)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | The zero-based index at which the row should be inserted. |
IRow | value | The row instance to insert. |
Examples
//Create instance of PowerPoint presentation
IPresentation presentation = Presentation.Create();
//Add slide to the presentation
ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
//Add table to the slide
ITable table = slide.Shapes.AddTable(2, 2, 100, 120, 300, 200);
//Retrieve a single row from the row collection, read only
IRow row = table.Rows[0];
//Set fill type for the cell in a row
row.Cells[0].Fill.FillType = FillType.Solid;
//Set color of the solid fill
row.Cells[0].Fill.SolidFill.Color = ColorObject.SaddleBrown;
//Get the row collection from table
IRows rows = table.Rows;
//Insert row at index 2
rows.Insert(2, row);
//Save the presentation
presentation.Save("Sample.pptx");
//Close the presentation
presentation.Close();
'Create instance of PowerPoint presentation
Dim presentation__1 As IPresentation = Presentation.Create()
'Add slide to the presentation
Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
'Add table to the slide
Dim table As ITable = slide.Shapes.AddTable(2, 2, 100, 120, 300, 200)
'Retrieve a single row from the row collection, read only
Dim row As IRow = table.Rows(0)
'Set fill type for the cell in a row
row.Cells(0).Fill.FillType = FillType.Solid
'Set color of the solid fill
row.Cells(0).Fill.SolidFill.Color = ColorObject.SaddleBrown
'Insert row at index 2
rows.Insert(2, row)
'Save the presentation
presentation__1.Save("Sample.pptx")
'Close the presentation
presentation__1.Close()
Remove(IRow)
Removes the first occurrence of a specified row from the row collection.
Declaration
void Remove(IRow value)
Parameters
Type | Name | Description |
---|---|---|
IRow | value | The row object to be removed from the collection. |
Examples
//Create instance of PowerPoint presentation
IPresentation presentation = Presentation.Create();
//Add slide to the presentation
ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
//Add table to the slide
ITable table = slide.Shapes.AddTable(2, 2, 100, 120, 300, 200);
//Retrieve a single row from the row collection, read only
IRow row = table.Rows[0];
//Get the row collection from table
IRows rows = table.Rows;
//Remove a specific row instance
rows.Remove(row);
//Save the presentation
presentation.Save("Sample.pptx");
//Close the presentation
presentation.Close();
'Create instance of PowerPoint presentation
Dim presentation__1 As IPresentation = Presentation.Create()
'Add slide to the presentation
Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
'Add table to the slide
Dim table As ITable = slide.Shapes.AddTable(2, 2, 100, 120, 300, 200)
'Retrieve a single row from the row collection, read only
Dim row As IRow = table.Rows(0)
'Remove a specific row instance
rows.Remove(row)
'Save the presentation
presentation__1.Save("Sample.pptx")
'Close the presentation
presentation__1.Close()
RemoveAt(Int32)
Removes the row at the specified index of the row collection.
Declaration
void RemoveAt(int index)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | The zero-based index of the row to remove. |
Examples
//Create instance of PowerPoint presentation
IPresentation presentation = Presentation.Create();
//Add slide to the presentation
ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
//Add table to the slide
ITable table = slide.Shapes.AddTable(4, 2, 100, 120, 300, 200);
//Get the row collection from table
IRows rows = table.Rows;
//Remove a specific row instance
rows.RemoveAt(0);
//Save the presentation
presentation.Save("Sample.pptx");
//Close the presentation
presentation.Close();
'Create instance of PowerPoint presentation
Dim presentation__1 As IPresentation = Presentation.Create()
'Add slide to the presentation
Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
'Add table to the slide
Dim table As ITable = slide.Shapes.AddTable(4, 2, 100, 120, 300, 200)
'Remove a specific row instance
rows.RemoveAt(0)
'Save the presentation
presentation__1.Save("Sample.pptx")
'Close the presentation
presentation__1.Close()