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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

GridListControl and selected row

Thread ID:

Created:

Updated:

Platform:

Replies:

34079 Sep 1,2005 02:17 PM UTC Dec 2,2005 04:34 PM UTC WinForms 14
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On September 1, 2005 02:17 PM UTC

Hi together, when I select an item in my gridlistcontrol - the item is highlighted (background blue colored) with a dotted rectangle. How can I disable the dotted rectangle? Cheers, Markus

Administrator [Syncfusion]
Replied On September 1, 2005 03:23 PM UTC

Try subscribing to the grid''s DrawCell event and reset the borders there. this.gridListControl1.Grid.DrawCell += new GridDrawCellEventHandler(Grid_DrawCell); private void Grid_DrawCell(object sender, GridDrawCellEventArgs e) { e.Style.ResetBorders(); }

Administrator [Syncfusion]
Replied On September 2, 2005 06:32 AM UTC

Hi Clay, that works (the dotted line isn''t visible anymore). But now the text jumps (moves a little bit) when I highlight an iteam. How can I stop that?

Administrator [Syncfusion]
Replied On September 2, 2005 07:47 AM UTC

Try this.
private void Grid_DrawCell(object sender, GridDrawCellEventArgs e)
{
	GridControl grid = sender as GridControl;
	if(grid.CurrentCell.HasCurrentCellAt(e.RowIndex))
	{
		e.Style.ResetBorders();
		e.Style.BorderMargins.Top = 1;
		if(e.ColIndex == this.ListBox1.ImageColumn)
			e.Style.BorderMargins.Left = 2;
	}
}

Administrator [Syncfusion]
Replied On September 2, 2005 08:45 AM UTC

Thank''s clay - that works

Administrator [Syncfusion]
Replied On September 2, 2005 09:02 AM UTC

Sorry, I was too fast. The text is still "jumping" when you highlight an item in the gridlistcontrol and then click on another control in the application?

Administrator [Syncfusion]
Replied On September 2, 2005 11:40 AM UTC

You can check to see if the grid has focus before making the adjustment.
private void Grid_DrawCell(object sender, GridDrawCellEventArgs e)
{
	GridControl grid = sender as GridControl;
	if(grid.CurrentCell.HasCurrentCellAt(e.RowIndex))
	{
		e.Style.ResetBorders();
		if(grid.Focused)
		{
			e.Style.BorderMargins.Top = 1;
			if(e.ColIndex == this.ListBox1.ImageColumn)
				e.Style.BorderMargins.Left = 2;
		}
	}
}
 

Administrator [Syncfusion]
Replied On September 2, 2005 12:26 PM UTC

Thanks Clay - great!!! But one further question :-)) How can I get to the GridListControl object from GridControl grid = sender as GridControl; I don''t want to specify explicitly: this.ListBox1.ImageColumn cause I want to use this method for multiple gridlistcontrols. >You can check to see if the grid has focus before making the adjustment. >
>private void Grid_DrawCell(object sender, GridDrawCellEventArgs e)
>{
>	GridControl grid = sender as GridControl;
>	if(grid.CurrentCell.HasCurrentCellAt(e.RowIndex))
>	{
>		e.Style.ResetBorders();
>		if(grid.Focused)
>		{
>			e.Style.BorderMargins.Top = 1;
>			if(e.ColIndex == this.ListBox1.ImageColumn)
>				e.Style.BorderMargins.Left = 2;
>		}
>	}
>}
>
 

Administrator [Syncfusion]
Replied On September 2, 2005 03:44 PM UTC

Try casting grid.Parent to a GridListControl to see if that will do it.

Greg Patterson
Replied On December 2, 2005 02:35 PM UTC

I have this same problem with the dotted lines and gridgrouping control. I tried using a modified version of the code you suggested: private void gcEmailGrouping_TableControlDrawCell(object sender,GridTableControlDrawCellEventArgs e) { e.Inner.Style.ResetBorders(); } but the dotted lines remains. Thanks, Greg >Hi together, > >when I select an item in my gridlistcontrol - the item is highlighted (background blue colored) with a dotted rectangle. > >How can I disable the dotted rectangle? > >Cheers, >Markus

Administrator [Syncfusion]
Replied On December 2, 2005 02:55 PM UTC

What dotted lines are you trying to remove? Can you tell us how to see the problem in one of our samples, or can you upload a sample project showing the problem, or maybe a picture marked up showing the lines you want to get rid of?

Greg Patterson
Replied On December 2, 2005 03:25 PM UTC

It is a solid line in the attached screen shots, but you can see it around the "From" column of the highlighted row. I have the grid set to select the entire row but the clicked cell still gets an outline. The second screen shot shows when a covered range is clicked to highlight the row. How can I change to color of the covered range to be highlighted?

GGCScreenShot200501202.zip

Administrator [Syncfusion]
Replied On December 2, 2005 03:43 PM UTC

I think the rectangle you are showing is the currentcell border. Try setting this property to remove it: this.gridGroupingControl1.TableModel.Options.ShowCurrentCellBorderBehavior = GridShowCurrentCellBorder.HideAlways; How to control the selection backcolor depends on selection architecture you are using. But here is one set of properties that gives you access to the selection color you see. this.gridGroupingControl1.TableOptions.ListBoxSelectionMode = SelectionMode.One; this.gridGroupingControl1.TableOptions.AllowSelection = GridSelectionFlags.None; // this.gridGroupingControl1.TableOptions.ListBoxSelectionColorOptions = GridListBoxSelectionColorOptions.DrawAlphablend; this.gridGroupingControl1.TableOptions.SelectionBackColor = Color.Red;

Greg Patterson
Replied On December 2, 2005 04:15 PM UTC

Thanks Clay, the cell borders are gone, but I don''t think I asked my second question very well. How can I make the covered range (mailicon) in a row change it''s background to be highlighted when the row is selected?

Administrator [Syncfusion]
Replied On December 2, 2005 04:34 PM UTC

Is the white part of the bitmap? If the white is part of the bitmap, then you can try setting a transparent color for the bitmap. But if that does not work, the only way I would know to do it is to use alphablending instead drawing the background.

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

;