Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
3009 | Feb 25,2003 05:20 PM UTC | Feb 26,2003 01:05 PM UTC | WinForms | 4 |
![]() |
Tags: GridControl |
Me.GridControl1.HideCols(0) = True Me.GridControl1.HideRows(0) = TrueHere are a couple of ways you can get the cell that was clicked even if the cell is part of a covered cell.
Private Sub GridControl1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles GridControl1.Click Dim row, col As Integer Dim pt As Point = Me.GridControl1.PointToClient(Control.MousePosition) Me.GridControl1.PointToRowCol(pt, row, col) Console.WriteLine(row.ToString() + " " + col.ToString()) End Sub Private Sub GridControl1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles GridControl1.MouseDown Dim row, col As Integer Dim pt As Point = New Point(e.X, e.Y) Me.GridControl1.PointToRowCol(pt, row, col) Console.WriteLine(row.ToString() + " x " + col.ToString()) End SubHere are some code snippets that show you how you can create a basestyle, and then apply to some cells.
Imports Syncfusion.Windows.Forms.Grid Imports Syncfusion.Styles ... Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 'create a basestyle Dim bStyle As GridBaseStyle = New GridBaseStyle("BoldRed", False) bStyle.StyleInfo.TextColor = Color.Red bStyle.StyleInfo.Font.Bold = True bStyle.StyleInfo.BackColor = Color.LightPink 'add it to the grid's basestyles Me.GridControl1.BaseStylesMap.AddRange(New GridBaseStyle() {bStyle}) 'apply style to 1,1,2,2 and 1, 4 Dim style As New GridStyleInfo() style.BaseStyle = "BoldRed" Me.GridControl1.ChangeCells(GridRangeInfo.Cells(1, 1, 2, 2), style, StyleModifyType.Override) Me.GridControl1(1, 4).BaseStyle = "BoldRed" End Sub
GridStyleInfo standard = this.gridControl1.BaseStylesMap["Standard"].StyleInfo;; GridStyleInfo style = this.gridControl1.BaseStylesMap["Row Header"].StyleInfo; style.Borders = standard.Borders; style.BackColor = standard.BackColor; style = this.gridControl1.BaseStylesMap["Header"].StyleInfo; style.Borders = standard.Borders; style.BackColor = standard.BackColor;
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.
This page will automatically be redirected to the sign-in page in 10 seconds.