We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

GridControl selection problem.

Hi,

Alhough the SelectionChanged event is fired, cells are not visually selected when GridControl.Model.ColumnCount = 2 OR GridControl.Model.RowCount = 2.

Thanks.

v8.204.0.18

7 Replies

VP Varun P Syncfusion Team June 14, 2010 11:42 AM UTC

Hi Jean,

Thanks for using Syncfusion products.

You will not be able to select the row or column header visually. Since you gave the RowCount = 2 or ColumnCount = 2, it will create only the RowHeader and ColumnHeader respectively. So by default, you can’t able to select the headers visually. In order to visually select the header you need to listen to following event. Please follow the below code snippet.

this.grid.CellClick += new Syncfusion.Windows.Controls.Grid.GridCellClickEventHandler(grid_CellClick);

if (e.ColumnIndex == 1 || e.RowIndex == 1)
{
this.grid.Model.Selections.Add(GridRangeInfo.Cell(e.RowIndex, e.ColumnIndex));
}

Please let us know if you have any queries.

Thanks,
Varun


JD Jean-Marc DUHEN July 2, 2010 01:40 PM UTC

I'm afraid you didn't understand.

When I create a grid with only one column (e.g. ColumnCount = 2) or one row (e.g. RowCount = 2), I don't get any feedback when selecting cells.

xaml:

xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:sf="http://schemas.syncfusion.com/wpf">






code behind:

public MainWindow()
{
InitializeComponent();

_grid.Model.ColumnCount = 2;
_grid.Model.RowCount = 10;
}


MN Muthulakshmi N Syncfusion Team July 15, 2010 12:16 PM UTC

Hi,

Here we prepared a sample which illustrates your request. Please download the sample video from the below location.

Link:
http://www.syncfusion.com/uploads/redirect.aspx?file=ss_6d88d4c0.zip&team=development

Code behind:

public MainPage()
{
InitializeComponent();
gridControl1.Model.RowCount = 10;
gridControl1.Model.ColumnCount = 2;
int k = 0;
for (int i = 1; i < 10; i++)
{
for (int j = 1; j <2; j++)
{
gridControl1.Model[i, j].CellValue = k;
k++;
}
}
this.gridControl1.SelectionChanged += new GridSelectionChangedEventHandler(gridControl1_SelectionChanged);
}

void gridControl1_SelectionChanged(object sender, GridSelectionChangedEventArgs e)
{
MessageBox.Show("Selection Change Property is listened");
}

Let us know if you need any details.

Regards,
Muthulakshmi


PO Puthirak OM July 19, 2010 04:34 PM UTC

Hi,

I've observed the same problem.
I think you misundertood Jean-Marc DUHEN.

What he's saying is that he didn't see the SELECTION FRAME
as VISUAL feedback.

Let's say I declared this:

Model.Options.ExcelLikeSelectionFrame = true;
Model.ColumnCount = 2;

Then I will not see the Selection Frame when I click on a cell (outside header cells).

But if I declare:

Model.Options.ExcelLikeSelectionFrame = true;
Model.ColumnCount = 3;

Then I will see the Selection Frame.

Hope you will reproduce it too.
I used GridControl 8.2.0.18 too.

Thanks,
P.OM
Reportive SA


PO Puthirak OM July 20, 2010 11:49 AM UTC

Hi,

Here's another case where the problem appears too.

Model.RowCount = 10;
Model.ColumnCount = 3;
Model.HeaderRows = 0;
Model.HeaderColumns = 0;
Model.Options.ExcelLikeSelectionFrame = true;

In this situation, the Selection Frame failed to be drawn
on the first column (in fact, only the right side of the frame is drawn).

It is drawn normally for the second and third column.

Thanks,
P.OM
Reportive SA


MN Muthulakshmi N Syncfusion Team August 2, 2010 01:26 PM UTC

Hi Puthirak,

In our Volume 3 we have done many internal fixes. So please upgrade to Volum3 for resolving your issues.

Link: http://www.syncfusion.com/support/forums/general/95581/essential-studio-2010-volume-3-final-release-v83021-available-for-download

Let us know if you need any details.

Thanks,
Mutulakshmi.N


HH Henry Harris August 16, 2011 04:53 PM UTC

I am having a similar problem. I have a grid with one row bound to a SelectedRow property in my ViewModel. If I select the single row then change the SelectedRow property to new row(), the selection frame still remains over the single row in the grid. When I view the SelectedRow property, i can see that it is actually set to a blank row. If I then try to select the single row, the SelectedRow property will not change. I think there is a problem with the row deselecting when there is no row on the grid currently selected. This is with the Volume 3 release.


Loader.
Live Chat Icon For mobile
Up arrow icon