Hi Deepu,
If you want to identify the partial column is visible or not in a grid, you can use “HasPartialVisibleCols” property. Please refer the below code,
Code:
if (e.Index > this.gridControl1.ColCount-1)
{
if (gridControl1.ViewLayout.HasPartialVisibleCols)
{
int viewLayout = this.gridControl1.ViewLayout.VisibleCols + (gridControl1.ViewLayout.HasPartialVisibleCols ? -1 : 0); // visible column count
MessageBox.Show("Partial Visible Column");
}
else
{
MessageBox.Show("Visible Column");
}
}
Please let us know if I misunderstood you query.
Regards,
Muthukumar K
Hi Deepu,
Thanks for the update.
If you want to show the tooltip in a grid which is partially visible column or not, you can use “QueryCellInfo” event. Please refer the below code,
Code:
void gridControl1_QueryCellInfo(object sender, GridQueryCellInfoEventArgs e)
{
if (flag)
{
if (e.ColIndex < viewLayout && e.RowIndex > 0)
{
toolTip = this.gridControl1.ColStyles[viewLayout].CellValue.ToString();
e.Style.CellTipText = "visible";
}
else
{
e.Style.CellTipText = "Partially visible";
}
}
}
void Model_QueryColWidth(object sender, Syncfusion.Windows.Forms.Grid.GridRowColSizeEventArgs e)
{
if (e.Index > this.gridControl1.ColCount-1)
{
if (gridControl1.ViewLayout.HasPartialVisibleCols)
{
viewLayout = this.gridControl1.ViewLayout.LastVisibleCol;
}
e.Handled = true;
}
}
Please let us know if you have any concern.
Regards,
Muthukumar K
Hi Deepu,
If you want to show the tooltip text when you hover the partially hidden column, you can use the “CellMouseHoverEnter” event and “QueryCellInfo” event . By using CellMouseHoverEnter event, you can set the “HasPartialVisibleCols” property to identify the partial hidden column in a grid. Please refer the below code and attached sample.
Code:
tooltip1.InitialDelay = 100000;
this.gridControl1.QueryCellInfo += new GridQueryCellInfoEventHandler(gridControl1_QueryCellInfo);
this.gridControl1.CellMouseHoverEnter += new GridCellMouseEventHandler(gridControl1_CellMouseHoverEnter);
string cellValue;
bool flag = false;
int viewLayout;
void gridControl1_CellMouseHoverEnter(object sender, GridCellMouseEventArgs e)
{
if (gridControl1.ViewLayout.HasPartialVisibleCols)
{
viewLayout = this.gridControl1.ViewLayout.LastVisibleCol;
flag = true;
}
else
{
// MessageBox.Show("Visible Column");
}
}
void gridControl1_QueryCellInfo(object sender, GridQueryCellInfoEventArgs e)
{
if (flag)
{
if (e.ColIndex == viewLayout && e.RowIndex > 0)
{
cellValue = this.gridControl1.ColStyles[viewLayout].CellValue.ToString();
e.Style.CellTipText = "Partially visible" + tooltip1.InitialDelay;
}
else
{
e.Style.CellTipText = string.Empty;
}
}
}
Please let us know if you have any concern.
Regards,
Muthukumar K