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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

GridGroupingControl - Selected records not cleared first time

Thread ID:

Created:

Updated:

Platform:

Replies:

49609 Sep 21,2006 06:33 PM UTC Sep 26,2006 04:46 AM UTC Windows Forms 5
loading
Tags: GridControl
Badri Rajani Kanth
Asked On September 21, 2006 06:33 PM UTC

Dear Syncfusion,

We are using V 4.2.0.37.

gridgroupingControl.Table.SelectedRecords.Clear(); is not clearing the records for the first time. It is only clearing second time. I tried even using gridgroupingControl.Refresh().

What else should we do? Can you plz inform.

Rgds
Rajani kanth

Administrator [Syncfusion]
Replied On September 22, 2006 05:16 AM UTC

Hi Rajani,

I was not able to reprodue this problem here, please see the attached sample that works fine in selected record clear method in the grid.

Here is a sample.
http://www.syncfusion.com/Support/user/uploads/GGCSelecterRecord_d9ee5cb7.zip

If this did not help, please update us with a sample project showing the problem.

Thanks,
Haneef

Badri Rajani Kanth
Replied On September 25, 2006 08:39 AM UTC

Hi Haneef,

I am not able to download the zip file on your link.

Ok, my form is having a GGC. These are my grid settings

private void FormatGrid()
{
GGC.TableOptions.AllowSelection = Syncfusion.Windows.Forms.Grid.GridSelectionFlags.None;
GGC.TableOptions.ListBoxSelectionCurrentCellOptions =
Syncfusion.Windows.Forms.Grid.Grouping.GridListBoxSelectionCurrentCellOptions.None;
GGC.TableOptions.ListBoxSelectionMode = System.Windows.Forms.SelectionMode.One;
GGC.TableModel.Options.ShowCurrentCellBorderBehavior =
GridShowCurrentCellBorder.HideAlways;
GGC.TableModel.Options.SelectCellsMouseButtonsMask =
System.Windows.Forms.MouseButtons.Left | System.Windows.Forms.MouseButtons.Right;
GGC.TableControl.HScrollBehavior = GridScrollbarMode.Disabled;
GGC.TableOptions.IndentWidth = 0;
GGC.TableOptions.ShowRowHeader = false;
GGC.TableOptions.CaptionRowHeight = 0;

}

And grid displays few records. When I right click on column headers, i want to clear the record selection. Here is the code for that, which is not clearing for the first time.

private void GGC_TableControlMouseDown(object sender, Syncfusion.Windows.Forms.Grid.Grouping.GridTableControlMouseEventArgs e)
{
int rowIndex = 0;
int colIndex = 0;

bool clickedInsideGrid =
e.TableControl.PointToRowCol(new System.Drawing.Point(e.Inner.X, e.Inner.Y), out rowIndex, out colIndex);
//clicked inside grid?
if(clickedInsideGrid)
{
if(e.Inner.Button == MouseButtons.Right)
{
if(rowIndex == COLUMN_HEADER_ROW_INDEX) //COLUMN_HEADER_ROW_INDEX = 1
{
//clear record selection and contexts
GGC.Table.SelectedRecords.Clear();
return;
}

}
}
}

Rgds
Rajani kanth

Administrator [Syncfusion]
Replied On September 25, 2006 01:02 PM UTC

Hi Rajani,

To get the desired behavior, add the code below in the TableControlMouseDown event handler of the GridGroupingControl.

private void gridGroupingControl1_TableControlMouseDown(object sender, GridTableControlMouseEventArgs e)
{
Point pt = new Point(e.Inner.X, e.Inner.Y);
GridTableCellStyleInfo style = this.gridGroupingControl1.TableControl.PointToTableCellStyle(pt);
if(style.TableCellIdentity.TableCellType == GridTableCellType.ColumnHeaderCell)
{
this.gridGroupingControl1.Table.SelectedRecords.Clear();
}
}

Thanks for using Syncfusion Products.
Regards,
Rajagopal

Badri Rajani Kanth
Replied On September 25, 2006 03:51 PM UTC

Thank You Raja Gopal,

Problem is not with identifying ColumnHeaderCell.

SelectedRecords.Clear() is not clearing the very first time.

Rgds
Rajani kanth

Administrator [Syncfusion]
Replied On September 26, 2006 04:46 AM UTC

Hi Rajani,

We tried to reproduce this issue in 4.1/ 4.2.0.37 with .Net 2003+Windows XP sp2, but could not get this issue. Maybe I am not following the steps that you are doing. Attached sample working fine here. Can you post a small sample showing this problem or tell us how to see it in the Attached sample?

Sample : http://www.syncfusion.com/Support/user/uploads/ClearRecordGGC_317cca61.zip

Please let me know the version number of Studio you are testing this with and the .Net version.

Thanks,
Haneef

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;