Hi,
I''m having problems getting the selected row index for 2 different cases.
First the Continous Multiselections of rows, which i use the following codes to get the first column''s cell value, please refer to "ContinousSelections.JPG" for a better understanding of my situation:
int rowCount = dgDocument.Selections.Ranges.ActiveRange.Height;
if (rowCount > 0)
{
ArrayList arDeleteDocumentNo = new ArrayList();
foreach (GridRangeInfo r in this.dgDocument.Selections.Ranges)
{
for (int row = r.Top; row <= r.Bottom; row++)
{
string delDocumentNo = this.dgDocument[row, 1].CellValue.ToString().Trim();
arDeleteDocumentNo.Add(delDocumentNo);
}
}
Then the NonContinous Multiselections of rows, which i use the following codes to get the first column''s cell value, please refer to "NoNContinousSelections.JPG" for a better understanding of my situation:
int rowCount = dgDocument.Selections.GetSelectedRows(true, true).Count;
if (rowCount > 0)
{
ArrayList arDeleteDocumentNo = new ArrayList();
foreach (GridRangeInfo r in this.dgDocument.Selections.GetSelectedRows(true, true))
{
for (int row = r.Top; row <= r.Bottom; row++)
{
string delDocumentNo = this.dgDocument[row, 1].CellValue.ToString().Trim();
arDeleteDocumentNo.Add(delDocumentNo);
}
}
Is there any way i could get the cellvalues i want combining the 2 types of multiselections approach i''ve attached with this post?
Please message me if my question is not clear enough or if you have any doubts about my post.
Thanks in advance. :)
MultiSelectionsProblem.zip