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. Image for the cookie policy date

How to make gridControl like excel import data

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

3 Replies

AD Administrator Syncfusion Team 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.


AK ahmad kamal bin abdul aziz 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.


ST stanleyj Syncfusion Team 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

Loader.
Live Chat Icon For mobile
Up arrow icon