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.

How do I remove the grid lines in the GridDataBoundGrid Control?

Thread ID:

Created:

Updated:

Platform:

Replies:

33515 Aug 22,2005 10:21 AM Aug 22,2005 11:15 AM Windows Forms 3
loading
Tags: GridControl
Atith Pagdi
Asked On August 22, 2005 10:21 AM

I''m using the GDBD to show some data and have multi row records in there. I''ve incorporated the following in my code to enable selection of the complete row whenever the user clicks on a cell that has some data: private void dgEx_CurrentCellActivating(object sender, Syncfusion.Windows.Forms.Grid.GridCurrentCellActivatingEventArgs e) { e.ColIndex = 0; } But when the user clicks on an empty cell (some have been specified in the layout), only the single row gets selected. Is there anyway I can enable the selection of the complete row no matter which cell in the datarow record the user clicks? Thanks

Administrator [Syncfusion]
Replied On August 22, 2005 10:33 AM

Try setting grid.ListBoxSelectionMode = SelectionMode.One.

Atith Pagdi
Replied On August 22, 2005 10:37 AM

I already have done that... that''s why the whole row''s getting selected when I click on a cell that has SOME data in it. But when I click on an empty cell that has no data in it, the single row containing that cell is selected in some other colour, but not the whole datarow, the way it is in the previously stated case. Thanks >Try setting grid.ListBoxSelectionMode = SelectionMode.One.

Administrator [Syncfusion]
Replied On August 22, 2005 11:15 AM

I missed the multi-row part of your question. Try handing the grid.Model.SlectionChanged event, and there select the other row while a single row has been selected.
private void Model_SelectionChanged(object sender, GridSelectionChangedEventArgs e)
{
	if(e.Range.IsRows && e.Range.Height == 1)
	{
		int row = - 1;
		if(e.Range.Top % 2 == 0)
		{
			row = e.Range.Top + 1;
		}
		else
		{
			row = e.Range.Top - 1;
			
		}
		this.gridDataBoundGrid1.Selections.SelectRange(GridRangeInfo.Cells(row, 1, row, this.gridDataBoundGrid1.Model.ColCount), true);
	}
}

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.

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.

;