private void Grid_QueryCellInfo(object sender, Syncfusion.Windows.Controls.Grid.GridQueryCellInfoEventArgs e)
        {
            GridCommentStyleInfo gridStyleInfo = new GridCommentStyleInfo();

            if (e.Style.RowIndex == 0 || e.Style.ColumnIndex == 0)
            {
                e.Style.CellType            = "DataBoundTemplate";
                e.Style.CellItemTemplateKey = "TextBlockTemplate1";
            }
            if (e.Style.RowIndex == 0)
            {
                e.Style.CellValue = dataTable.Columns[e.Style.ColumnIndex];
            }
            else
            {
                e.Style.CellValue = dataTable.Rows[e.Style.RowIndex][e.Style.ColumnIndex];
            }

            //Set customization style to specific cell
            if (e.Cell.RowIndex == 1 && e.Cell.ColumnIndex == 2)
            {
                e.Style.DataValidationTooltip            = e.Style.GridModel[1, 0].CellValue + ": \nPopulation rate in " + e.Style.ColumnIndex + " is " + e.Style.CellValue.ToString();
                e.Style.ShowDataValidationTooltip        = true;
                e.Style.DataValidationTooltipTemplateKey = "inputTextmessage1";
            }
        }
示例#2
0
 void Model_QueryCellInfo(object sender, Syncfusion.Windows.Controls.Grid.GridQueryCellInfoEventArgs e)
 {
     if (e.Cell.RowIndex > 1 && e.Cell.ColumnIndex == 2)
     {
         e.Style.CellType            = "DataTemplate";
         e.Style.CellItemTemplateKey = "editableEmployee";
         e.Style.CellValue           = employeesSource.Employees[e.Cell.RowIndex % employeesSource.Employees.Count];
         e.Style.Background          = Brushes.Linen;
     }
 }
 private void Model_QueryCellInfo(object sender, Syncfusion.Windows.Controls.Grid.GridQueryCellInfoEventArgs e)
 {
     for (int i = 0; i <= 3; i++)
     {
         if (e.Style.RowIndex > 0 && e.Style.ColumnIndex > 0)
         {
             e.Style.CellValue = " R" + e.Style.RowIndex + ", C" + e.Style.ColumnIndex;
         }
     }
 }
示例#4
0
 void Model_QueryCellInfo(object sender, Syncfusion.Windows.Controls.Grid.GridQueryCellInfoEventArgs e)
 {
     if (e.Cell.ColumnIndex == 0 && e.Cell.RowIndex == 0)
     {
         e.Style.CellValue = "";
     }
     else if (e.Cell.ColumnIndex == 0)
     {
         e.Style.CellValue = e.Cell.RowIndex;
     }
     else if (e.Cell.RowIndex == 0)
     {
         e.Style.CellValue = e.Cell.ColumnIndex;
     }
 }
 void Model_QueryCellInfo(object sender, Syncfusion.Windows.Controls.Grid.GridQueryCellInfoEventArgs e)
 {
     if (e.Cell.RowIndex == 0 && e.Cell.ColumnIndex > 0)
     {
         e.Style.Text = GridRangeInfo.GetAlphaLabel(e.Cell.ColumnIndex);
         e.Style.HorizontalAlignment = HorizontalAlignment.Center;
         e.Style.VerticalAlignment   = VerticalAlignment.Center;
     }
     else if (e.Cell.RowIndex > 0 && e.Cell.ColumnIndex == 0)
     {
         e.Style.Text = e.Cell.RowIndex.ToString();
         e.Style.HorizontalAlignment = HorizontalAlignment.Center;
         e.Style.VerticalAlignment   = VerticalAlignment.Center;
     }
 }
示例#6
0
        private void Grid_QueryCellInfo(object sender, Syncfusion.Windows.Controls.Grid.GridQueryCellInfoEventArgs e)
        {
            GridCommentStyleInfo gridStyleInfo = new GridCommentStyleInfo();

            if (e.Style.RowIndex == 0 || e.Style.ColumnIndex == 0)
            {
                e.Style.CellType            = "DataBoundTemplate";
                e.Style.CellItemTemplateKey = "TextBlockTemplate1";
            }
            if (e.Style.RowIndex == 0)
            {
                e.Style.CellValue = dataTable.Columns[e.Style.ColumnIndex];
            }
            else
            {
                e.Style.CellValue = dataTable.Rows[e.Style.RowIndex][e.Style.ColumnIndex];
            }
        }
示例#7
0
        void gridControl1_QueryCellInfo(object sender, Syncfusion.Windows.Controls.Grid.GridQueryCellInfoEventArgs e)
        {
            GridCommentStyleInfo styleinfo = new GridCommentStyleInfo();

            if (e.Style.ColumnIndex == 0 || e.Style.RowIndex == 0)
            {
                e.Style.CellType            = "DataBoundTemplate";
                e.Style.CellItemTemplateKey = "TextBlocktemplate";
            }

            if (e.Style.RowIndex == 0)
            {
                e.Style.CellValue = dataTable.Columns[e.Style.ColumnIndex];
            }
            else
            {
                e.Style.CellValue = dataTable.Rows[e.Style.RowIndex][e.Style.ColumnIndex];

                if ((e.Style.ColumnIndex == 2 || e.Style.ColumnIndex == 4 || e.Style.ColumnIndex == 6) && e.Style.RowIndex > 0)
                {
                    string comment = " " + dataTable.Rows[e.Style.RowIndex][0].ToString() + ": \n Population rate in " + dataTable.Columns[e.Style.ColumnIndex] + " is " + e.Style.CellValue.ToString();
                    if (e.Style.ColumnIndex == 2)
                    {
                        e.Style.Background                = Brushes.WhiteSmoke;
                        styleinfo.TopLeftCommentBrush     = Brushes.Black;
                        styleinfo.BottomRightCommentBrush = Brushes.Green;
                        styleinfo.TopLeftComment          = styleinfo.BottomRightComment = comment;
                        e.Style.GridCommentStyleInfo      = styleinfo;
                    }
                    else if (e.Style.ColumnIndex == 6)
                    {
                        styleinfo.BottomLeftCommentBrush = Brushes.BlueViolet;
                        styleinfo.TopRightCommentBrush   = Brushes.DarkMagenta;
                        styleinfo.BottomLeftComment      = styleinfo.TopRightComment = comment;
                        e.Style.GridCommentStyleInfo     = styleinfo;
                    }
                    else
                    {
                        e.Style.Comment = comment;
                    }
                }
            }
        }
示例#8
0
 private void SampleVirtualGrid_QueryCellInfo(object sender, Syncfusion.Windows.Controls.Grid.GridQueryCellInfoEventArgs e)
 {
     if (e.Cell.RowIndex == 0)
     {
         if (e.Cell.ColumnIndex > 0)
         {
             e.Style.CellValue = e.Cell.ColumnIndex;
         }
     }
     else if (e.Cell.RowIndex > 0)
     {
         if (e.Cell.ColumnIndex == 0)
         {
             e.Style.CellValue = e.Cell.RowIndex;
         }
         else if (e.Cell.ColumnIndex > 0)
         {
             e.Style.CellValue = String.Format("{0}/{1}", e.Cell.RowIndex, e.Cell.ColumnIndex);
         }
     }
 }
示例#9
0
 void Model_QueryCellInfo(object sender, Syncfusion.Windows.Controls.Grid.GridQueryCellInfoEventArgs e)
 {
     e.Style.ReadOnly = true;
 }