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.

icon selection

Thread ID:

Created:

Updated:

Platform:

Replies:

53422 Dec 13,2006 09:26 AM Dec 15,2006 06:57 AM Windows Forms 3
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On December 13, 2006 09:26 AM

Hello,

I have a little problem: when I select one row (on the first cell, something identic like drag&drop) in a unbound grid and move this selection into another grid, I want to change the selection icon (the arrow icon) into another icon - like drag&drop.

Could you please help me in this situation ?

Regards !

Administrator [Syncfusion]
Replied On December 14, 2006 12:07 AM

Hi Venatir,

Try setting the CellType of the RowHeader cell to "Header" and handle the DrawCell event to draw the image on the cell in a Grid. Here is a code snippet to show this.

this.gridDataBoundGrid1.BaseStylesMap["Row Header"].StyleInfo.CellType = "Header";
this.gridDataBoundGrid1.DrawCell +=new GridDrawCellEventHandler(gridDataBoundGrid1_DrawCell);

private void gridDataBoundGrid1_DrawCell(object sender, GridDrawCellEventArgs e)
{
GridDataBoundGrid grid = sender as GridDataBoundGrid;
GridCurrentCell cc = grid.CurrentCell;
if( e.RowIndex == cc.RowIndex && e.ColIndex == 0 )
{
e.Renderer.Draw(e.Graphics,e.Bounds,e.RowIndex,e.ColIndex,e.Style);
e.Graphics.DrawImage(SystemIcons.Exclamation.ToBitmap(),e.Bounds);
e.Cancel = true;
}
}

Please refer to the attached sample for implementation.
GDBGRowHeaderIcon.zip

Best Regards,
Haneef

Administrator [Syncfusion]
Replied On December 14, 2006 08:25 AM

Hello Haneef,

Thanks a lot for your help but my problem is a little different. Your example works properly but I don't want to set the first row cell. When I select a row on first cell and I want to move this selection (like drag&drop case) I want the cursor change from black arrow in another icon black circle, strikethrough).

Regards !



>Hi Venatir,

Try setting the CellType of the RowHeader cell to "Header" and handle the DrawCell event to draw the image on the cell in a Grid. Here is a code snippet to show this.

this.gridDataBoundGrid1.BaseStylesMap["Row Header"].StyleInfo.CellType = "Header";
this.gridDataBoundGrid1.DrawCell +=new GridDrawCellEventHandler(gridDataBoundGrid1_DrawCell);

private void gridDataBoundGrid1_DrawCell(object sender, GridDrawCellEventArgs e)
{
GridDataBoundGrid grid = sender as GridDataBoundGrid;
GridCurrentCell cc = grid.CurrentCell;
if( e.RowIndex == cc.RowIndex && e.ColIndex == 0 )
{
e.Renderer.Draw(e.Graphics,e.Bounds,e.RowIndex,e.ColIndex,e.Style);
e.Graphics.DrawImage(SystemIcons.Exclamation.ToBitmap(),e.Bounds);
e.Cancel = true;
}
}

Please refer to the attached sample for implementation.
GDBGRowHeaderIcon.zip

Best Regards,
Haneef

Administrator [Syncfusion]
Replied On December 15, 2006 06:57 AM

Hi Venatir,

You can change the mouse cursor for the grid through three methods. They are explained with an example in the following KB article.
http://www.syncfusion.com/support/kb/grid/Default.aspx?ToDo=view&questId=69

Best Regards,
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.

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.

;