BoldDeskPremium customer service software with affordable pricing: $10 for 3 agents. Try it for free.
private void gridGroupingControl1_QueryCellStyleInfo(object sender, Syncfusion.Windows.Forms.Grid.Grouping.GridTableCellStyleInfoEventArgs e)
{
if (e.TableCellIdentity.Column != null
&& e.TableCellIdentity.Column.Name == "Col2")
{
GridRecord rec = e.TableCellIdentity.DisplayElement.GetRecord() as GridRecord;
if (rec != null)
{
object val = rec.GetValue("Col1");
if (val.ToString() == "row0 col1")
{
e.Style.ImageList =this.imageList;
e.Style.ImageIndex = 0;
}
}
}
}
private void gridGroupingControl1_QueryCellStyleInfo(object sender, Syncfusion.Windows.Forms.Grid.Grouping.GridTableCellStyleInfoEventArgs e)
{
if (e.TableCellIdentity.Column != null
&& e.TableCellIdentity.Column.Name == "Col2")
{
GridRecord rec = e.TableCellIdentity.DisplayElement.GetRecord() as GridRecord;
if (rec != null)
{
object val = rec.GetValue("Col1");
if (val.ToString() == "row0 col1")
{
e.Style.ImageList =this.imageList;
e.Style.ImageIndex = 0;
}
}
}
}
private void gridGroupingControl1_TableControlCurrentCellValidating( object sender, Syncfusion.Windows.Forms.Grid.Grouping.GridTableControlCancelEventArgs e )
{
object cellVal = e.TableControl.CurrentCell.Renderer.ControlValue;
string cellText = e.TableControl.CurrentCell.Renderer.ControlText;
if ( ( cellVal == null )
&& ( ( cellText != String.Empty )
|| ( cellText != null ) ) )
{
MessageBox.Show( "error" );
e.Inner.Cancel = true;
int row = e.TableControl.CurrentCell.RowIndex;
int col = e.TableControl.CurrentCell.ColIndex;
e.TableControl.CurrentCell.MoveTo(row, col, GridSetCurrentCellOptions.SetFocus);
}
}
}