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

How to make gridControl like excel import data

Thread ID:

Created:

Updated:

Platform:

Replies:

38971 Dec 22,2005 03:43 AM UTC Jan 6,2006 07:57 PM UTC WinForms 3
loading
Tags: GridControl
ahmad kamal bin abdul aziz
Asked On December 22, 2005 03:43 AM UTC

i plan to do a grd like excel import data, open excel, then go to Data->Import external, when we clik on the cell border it will set grid boder to "Solid" and if we click again it will set the cell boder to "Not Set", can we do a grid control like that?

importData.zip

Administrator [Syncfusion]
Replied On December 22, 2005 01:12 PM UTC

Hi akamal, you can change the Border style using BoundsIndicatorBorder property in the ResizingColumns Event. Here is the code snippet. private void gridControl1_ResizingColumns(object sender, Syncfusion.Windows.Forms.Grid.GridResizingColumnsEventArgs e) { e.BoundsIndicatorBorder = new GridBorder(GridBorderStyle.Solid,Color.Black,GridBorderWeight.Thick); e.SizeIndicatorBorder = new GridBorder(GridBorderStyle.Dashed, Color.Blue,GridBorderWeight.Thick); } Best Regards, Madhan.

ahmad kamal bin abdul aziz
Replied On January 6, 2006 02:23 AM UTC

hi madhan, thanks for the code snippet, it doesn''t work like i expected, what i expect is...after resizing or clicking the col...the border is drawn and always show...but the code snippet just show the border during the resizing or when we point the mouse over the column only... >Hi akamal, > you can change the Border style using BoundsIndicatorBorder property in the ResizingColumns Event. Here is the code snippet. > >private void gridControl1_ResizingColumns(object sender, Syncfusion.Windows.Forms.Grid.GridResizingColumnsEventArgs e) >{ >e.BoundsIndicatorBorder = new GridBorder(GridBorderStyle.Solid,Color.Black,GridBorderWeight.Thick); >e.SizeIndicatorBorder = new GridBorder(GridBorderStyle.Dashed, Color.Blue,GridBorderWeight.Thick); >} > >Best Regards, >Madhan.

stanleyj [Syncfusion]
Replied On January 6, 2006 07:57 PM UTC

Hi Akamal, This might work for you. private void gridControl1_ResizingColumns(object sender, Syncfusion.Windows.Forms.Grid.GridResizingColumnsEventArgs e) { e.SizeIndicatorBorder = new GridBorder(GridBorderStyle.Dashed, Color.LightGray, GridBorderWeight.Medium); e.BoundsIndicatorBorder = new GridBorder(GridBorderStyle.Solid, Color.Black,GridBorderWeight.Thick); if(e.Reason == GridResizeCellsReason.MouseDown) { this.gridControl1.ColStyles[e.Columns.Left].Borders.Right = new GridBorder(GridBorderStyle.Solid, Color.Black,GridBorderWeight.Thick); } } If you wish to cancel the Border drawn while double clicking then you may add this also. if(e.Reason == GridResizeCellsReason.DoubleClick) { this.gridControl1.ColStyles[e.Columns.Left].Borders.Right = new GridBorder(GridBorderStyle.Dotted, SystemColors.ControlDark); e.Cancel = true; } Best regards, Stanley

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

;