• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Controls.DataGridRow类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中System.Windows.Controls.DataGridRow的典型用法代码示例。如果您正苦于以下问题:C# DataGridRow类的具体用法?C# DataGridRow怎么用?C# DataGridRow使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



DataGridRow类属于System.Windows.Controls命名空间,在下文中一共展示了DataGridRow类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: DataGridPreparingCellForEditEventArgs

 /// <summary>
 ///     Constructs a new instance of these event arguments. 
 /// </summary>
 /// <param name="column">The column of the cell that just entered edit mode.</param>
 /// <param name="row">The row container that contains the cell container that just entered edit mode.</param>
 /// <param name="editingEventArgs">The event arguments, if any, that led to the cell being placed in edit mode.</param> 
 /// <param name="cell">The cell container that just entered edit mode.</param>
 /// <param name="editingElement">The editing element within the cell container.</param> 
 public DataGridPreparingCellForEditEventArgs(DataGridColumn column, DataGridRow row, RoutedEventArgs editingEventArgs, FrameworkElement editingElement) 
 {
     _dataGridColumn = column; 
     _dataGridRow = row;
     _editingEventArgs = editingEventArgs;
     _editingElement = editingElement;
 } 
开发者ID:sjyanxin,项目名称:WPFSource,代码行数:15,代码来源:DataGridPreparingCellForEditEventArgs.cs


示例2: DataGridCellEditEndingEventArgs

 /// <summary>
 ///     Instantiates a new instance of this class.
 /// </summary>
 /// <param name="column">The column of the cell that is about to exit edit mode.</param>
 /// <param name="row">The row container of the cell container that is about to exit edit mode.</param>
 /// <param name="editingElement">The editing element within the cell.</param>
 /// <param name="editingUnit">The editing unit that is about to leave edit mode.</param>
 public DataGridCellEditEndingEventArgs(DataGridColumn column, DataGridRow row, FrameworkElement editingElement, DataGridEditAction editAction)
 {
     _dataGridColumn = column;
     _dataGridRow = row;
     _editingElement = editingElement;
     _editAction = editAction;
 }
开发者ID:krytht,项目名称:DotNetReferenceSource,代码行数:14,代码来源:DataGridCellEditEndingEventArgs.cs


示例3: DataGridRowAutomationPeer

 /// <summary>
 /// AutomationPeer for DataGridRow
 /// </summary>
 /// <param name="owner">DataGridRow</param>
 public DataGridRowAutomationPeer(DataGridRow owner)
     : base(owner)
 {
     if (owner == null)
     {
         throw new ArgumentNullException("owner");
     }
 }
开发者ID:JianwenSun,项目名称:cc,代码行数:12,代码来源:DataGridRowAutomationPeer.cs


示例4: FormatRow

 private void FormatRow(DataGridRow row)
 {
     Product product = (Product)row.DataContext;
     if (product.UnitCost > 100)
         row.Background = highlightBrush;
     else
         row.Background = normalBrush;
 }   
开发者ID:ittray,项目名称:LocalDemo,代码行数:8,代码来源:DataGridTest.xaml.cs


示例5: DataGridBeginningEditEventArgs

 /// <summary>
 /// Initializes a new instance of the 
 /// <see cref="T:System.Windows.Controls.Data.DataGridBeginningEditEventArgs" /> class.
 /// </summary>
 /// <param name="column">
 /// The column that contains the cell to be edited.
 /// </param>
 /// <param name="row">
 /// The row that contains the cell to be edited.
 /// </param>
 /// <param name="editingEventArgs">
 /// Information about the user gesture that caused the cell to enter edit mode.
 /// </param>
 public DataGridBeginningEditEventArgs(DataGridColumn column,
                                       DataGridRow row,
                                       RoutedEventArgs editingEventArgs)
 {
     this.Column = column;
     this.Row = row;
     this.EditingEventArgs = editingEventArgs;
 }
开发者ID:expanz,项目名称:expanz-Microsoft-XAML-SDKs,代码行数:21,代码来源:DataGridBeginningEditEventArgs.cs


示例6: Update

 public void Update(DataGridRow row)
 {
     var record = (Record)row.Item;
     var content = GetContent(row);
     if (content == null)
     {
         return;
     }
     content.Text = record.Properties[_descriptor.Index].ValueAsString;
 }
开发者ID:pedershk,项目名称:dotnetprograms,代码行数:10,代码来源:CustomBoundColumn.cs


示例7: GridRowNumberConverter_Convert_WhenInputIsEmpty_ReturnsAZero

 public void GridRowNumberConverter_Convert_WhenInputIsEmpty_ReturnsAZero()
 {
     //------------Setup for test--------------------------
     var converter = new GridRowNumberConverter();
     DataGrid dataGrid = new DataGrid { AutoGenerateColumns = true };
     var itemsSource = new List<string> { "Item 1 ", "Item 2" };
     dataGrid.ItemsSource = itemsSource;
     dataGrid.SelectedItem = itemsSource[0];
     var row = new DataGridRow();
     //------------Execute Test---------------------------
     var result = converter.Convert(row, typeof(string), null, CultureInfo.CurrentCulture);
     //------------Assert Results-------------------------
     Assert.AreEqual(0, result);
 }
开发者ID:FerdinandOlivier,项目名称:Warewolf-ESB,代码行数:14,代码来源:GridRowNumberConverterTests.cs


示例8: Execute

        /// <summary>
        /// Collapse/Expands the selected DataGridRow.
        /// </summary>
        /// <param name="parameter">The DataGridRowHeader</param>
        public void Execute(object parameter)
        {
            var rowHeader = parameter as DataGridRowHeader;
            var row = DataGridHelper.FindTemplatedParent<DataGridRow>(rowHeader) as DataGridRow;
            if (_prevRow is DataGridRow
                && _prevRow != row
                && DataGridHelper.FindVisualParent<DataGrid>(_prevRow) == DataGridHelper.FindVisualParent<DataGrid>(rowHeader))
            {	//collapse the previously selected row
                _prevRow.DetailsVisibility = Visibility.Collapsed;
            }
            if (row.DetailsVisibility == Visibility.Visible)
                row.DetailsVisibility = Visibility.Collapsed;
            else
                row.DetailsVisibility = Visibility.Visible;

            _prevRow = row;
        }
开发者ID:jayhill,项目名称:FluentFilters,代码行数:21,代码来源:DataGridRowHeaderCommand.cs


示例9: SetRowLogo

        public void SetRowLogo(DataGrid DtGrid, DataGridRow row, string entityCode)
        {
            if (DtGrid.ItemsSource == null)
            {
                return;
            }

            Image logo = DtGrid.Columns[0].GetCellContent(row).FindName("entityLogo") as Image;
            if (logo == null)
            {
                return;
            }

            if (Application.Current.Resources["RowLogo" + entityCode] != null)
            {
                string strPpath = Application.Current.Resources["RowLogo" + entityCode].ToString();
                logo.Margin = new Thickness(2, 2, 0, 0);
                logo.Source = new System.Windows.Media.Imaging.BitmapImage(new Uri(strPpath, UriKind.Relative));
                return;
            }

            SMT.Saas.Tools.PermissionWS.PermissionServiceClient client = new SMT.Saas.Tools.PermissionWS.PermissionServiceClient();
            client.GetSysMenuByEntityCodeCompleted += new EventHandler<SMT.Saas.Tools.PermissionWS.GetSysMenuByEntityCodeCompletedEventArgs>(client_GetSysMenuByEntityCodeCompleted);
            client.GetSysMenuByEntityCodeAsync(entityCode);

            //if (string.IsNullOrEmpty(EntityLogo))
            //{
            //    SMT.Saas.Tools.PermissionWS.PermissionServiceClient client = new SMT.Saas.Tools.PermissionWS.PermissionServiceClient();
            //    client.GetSysMenuByEntityCodeCompleted += new EventHandler<SMT.Saas.Tools.PermissionWS.GetSysMenuByEntityCodeCompletedEventArgs>(client_GetSysMenuByEntityCodeCompleted);
            //    client.GetSysMenuByEntityCodeAsync(entityCode, logo);
            //}
            //else
            //{
            //    logo.Source = new System.Windows.Media.Imaging.BitmapImage(new Uri(EntityLogo, UriKind.Relative));
            //}
        }
开发者ID:JuRogn,项目名称:OA,代码行数:36,代码来源:BasePage.cs


示例10: GetIsReadOnly

 /// <summary>
 /// Gets the is read only flag for the row.
 /// </summary>
 /// <param name="dataGridRow">The data grid row.</param>
 /// <returns><c>true</c> if the row is read only, otherwise <c>false</c>.</returns>
 public static bool GetIsReadOnly(DataGridRow dataGridRow)
 {
     return (bool)dataGridRow.GetValue(IsReadOnlyProperty);
 }
开发者ID:ruisebastiao,项目名称:Elysium-Extra,代码行数:9,代码来源:DataGridRowAttached.cs


示例11: SetMoveDragFormat

 /// <summary>
 /// Sets the drag format when this instance is being dragged above or below another row.
 /// </summary>
 /// <param name="dataGridRow">The data grid row.</param>
 /// <param name="format">The drag format used when this instance is being dragged above or below another row.</param>
 public static void SetMoveDragFormat(DataGridRow dataGridRow, string format)
 {
     dataGridRow.SetValue(MoveDragFormatProperty, format);
 }
开发者ID:ruisebastiao,项目名称:Elysium-Extra,代码行数:9,代码来源:DataGridRowAttached.cs


示例12: GetIsDeselectionEnabled

 /// <summary>
 /// Gets the deselection enabled property. If enabled, and the row is clicked while selected, the row is deselected.
 /// </summary>
 /// <param name="dataGridRow">The data grid row.</param>
 /// <returns><c>true</c> if deselecting row when selected and clicked, otherwise <c>false</c>.</returns>
 public static bool GetIsDeselectionEnabled(DataGridRow dataGridRow)
 {
     return (bool)dataGridRow.GetValue(IsDeselectionEnabledProperty);
 }
开发者ID:ruisebastiao,项目名称:Elysium-Extra,代码行数:9,代码来源:DataGridRowAttached.cs


示例13: SetMoveBelowCommand

 /// <summary>
 /// Sets the command used to move another row below this one using drag and drop.
 /// </summary>
 /// <param name="dataGridRow">The data grid row.</param>
 /// <param name="command">The command to move a row below this instance.</param>
 public static void SetMoveBelowCommand(DataGridRow dataGridRow, ICommand command)
 {
     dataGridRow.SetValue(MoveBelowCommandProperty, command);
 }
开发者ID:ruisebastiao,项目名称:Elysium-Extra,代码行数:9,代码来源:DataGridRowAttached.cs


示例14: SetMoveDragContentTemplate

 /// <summary>
 /// Sets the content template when this instance is being dragged above or below another row.
 /// </summary>
 /// <param name="dataGridRow">The data grid row.</param>
 /// <param name="value">A data template used when this instance is being dragged above or below another row.</param>
 public static void SetMoveDragContentTemplate(DataGridRow dataGridRow, DataTemplate value)
 {
     dataGridRow.SetValue(MoveDragContentTemplateProperty, value);
 }
开发者ID:ruisebastiao,项目名称:Elysium-Extra,代码行数:9,代码来源:DataGridRowAttached.cs


示例15: GetCellContent

        /// <summary>
        ///     Retrieves the visual tree that was generated for a particular row and column.
        /// </summary>
        /// <param name="dataGridRow">The row that corresponds to the desired cell.</param>
        /// <returns>The element if found, null otherwise.</returns>
        public FrameworkElement GetCellContent(DataGridRow dataGridRow)
        {
            if (dataGridRow == null)
            {
                throw new ArgumentNullException("dataGridRow");
            }

            if (_dataGridOwner != null)
            {
                int columnIndex = _dataGridOwner.Columns.IndexOf(this);
                if (columnIndex >= 0)
                {
                    DataGridCell cell = dataGridRow.TryGetCell(columnIndex);
                    if (cell != null)
                    {
                        return cell.Content as FrameworkElement;
                    }
                }
            }

            return null;
        }
开发者ID:JianwenSun,项目名称:cc,代码行数:27,代码来源:DataGridColumn.cs


示例16: RaiseAutomationCellInvokeEvents

 // This method is called from DataGrid.OnBeginningEdit/OnCommittingEdit/OnCancelingEdit
 // Raises Invoked event when cell begin/cancel/commit edit
 internal void RaiseAutomationCellInvokeEvents(DataGridColumn column, DataGridRow row)
 {
     DataGridItemAutomationPeer dataGridItemAutomationPeer = FindOrCreateItemAutomationPeer(row.Item) as DataGridItemAutomationPeer;
     if (dataGridItemAutomationPeer != null)
     {
         DataGridCellItemAutomationPeer cellPeer = dataGridItemAutomationPeer.GetOrCreateCellItemPeer(column);
         if (cellPeer != null)
         {
             cellPeer.RaiseAutomationEvent(AutomationEvents.InvokePatternOnInvoked);
         }
     }
 }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:14,代码来源:DataGridAutomationPeer.cs


示例17: worker_DoWork


//.........这里部分代码省略.........
                            }
                        }

                        foreach (KeyValuePair<DataTable, List<DescriptiveStatistics>> tableKvp in stratifiedFrequencyTables)
                        {
                            string strataValue = tableKvp.Key.TableName;

                            double count = 0;
                            foreach (DescriptiveStatistics ds in tableKvp.Value)
                            {
                                count = count + ds.observations;
                            }

                            if (count == 0)
                            {
                                continue;
                            }
                            DataTable frequencies = tableKvp.Key;

                            if (frequencies.Rows.Count == 0)
                            {
                                continue;
                            }

                            string tableHeading = tableKvp.Key.TableName;

                            if (stratifiedFrequencyTables.Count > 1)
                            {
                                tableHeading = freqVar;
                            }

                            double lastAvg = double.NegativeInfinity;
                            double lastStdDev = double.NegativeInfinity;
                            Queue<double> frame = new Queue<double>();
                            List<SimpleDataValue> actualValues = new List<SimpleDataValue>();
                            List<SimpleDataValue> trendValues = new List<SimpleDataValue>();
                            List<SimpleDataValue> aberrationValues = new List<SimpleDataValue>();
                            List<DataGridRow> aberrationDetails = new List<DataGridRow>();
                            int rowCount = 1;
                            foreach (System.Data.DataRow row in frequencies.Rows)
                            {
                                if (!row[freqVar].Equals(DBNull.Value) || (row[freqVar].Equals(DBNull.Value) && includeMissing == true))
                                {
                                    DateTime displayValue = DateTime.Parse(row[freqVar].ToString());

                                    frame.Enqueue((double)row["freq"]);
                                    SimpleDataValue actualValue = new SimpleDataValue();
                                    actualValue.IndependentValue = displayValue;
                                    actualValue.DependentValue = (double)row["freq"];
                                    actualValues.Add(actualValue);
                                    if (frame.Count > lagTime - 1 /*6*/)
                                    {
                                        double[] frameArray = frame.ToArray();
                                        double frameAvg = frameArray.Average();
                                        frame.Dequeue();
                                        double stdDev = CalculateStdDev(frameArray);
                                        if (lastAvg != double.NegativeInfinity)
                                        {
                                            SimpleDataValue trendValue = new SimpleDataValue();
                                            trendValue.IndependentValue = displayValue;
                                            trendValue.DependentValue = lastAvg;
                                            trendValues.Add(trendValue);
                                            if ((double)row["freq"] > lastAvg + (/*2.99*/deviations * lastStdDev))
                                            {
                                                SimpleDataValue aberrationValue = new SimpleDataValue();
                                                aberrationValue.IndependentValue = displayValue;
                                                aberrationValue.DependentValue = (double)row["freq"];
                                                aberrationValues.Add(aberrationValue);
                                                DataGridRow aberrationDetail = new DataGridRow()
                                                {
                                                    Date = displayValue,
                                                    Frequency = (double)row["freq"],
                                                    RunningAverage = lastAvg,
                                                    StandardDeviation = lastStdDev
                                                };
                                                aberrationDetails.Add(aberrationDetail);
                                            }
                                        }
                                        lastAvg = frameAvg;
                                        lastStdDev = stdDev;
                                    }

                                    rowCount++;
                                }
                            }

                            this.Dispatcher.BeginInvoke(setGraph, strataValue, actualValues, trendValues, aberrationValues, aberrationDetails);
                            System.Threading.Thread.Sleep(1000);
                        }
                    }
                    this.Dispatcher.BeginInvoke(new SimpleCallback(RenderFinish));
                    this.Dispatcher.BeginInvoke(new SimpleCallback(SetGadgetToFinishedState));
                }
                catch (Exception ex)
                {
                    this.Dispatcher.BeginInvoke(new RenderFinishWithErrorDelegate(RenderFinishWithError), ex.Message);
                    this.Dispatcher.BeginInvoke(new SimpleCallback(SetGadgetToFinishedState));
                }
            }
        }
开发者ID:NALSS,项目名称:epiinfo-82474,代码行数:101,代码来源:AberrationControl.xaml.cs


示例18: GetMoveDragFormat

 /// <summary>
 /// Gets the drag format when this instance is being dragged above or below another row.
 /// </summary>
 /// <param name="dataGridRow">The data grid row.</param>
 /// <returns>The drag format used when this instance is being dragged above or below another row.</returns>
 public static string GetMoveDragFormat(DataGridRow dataGridRow)
 {
     return (string)dataGridRow.GetValue(MoveDragFormatProperty);
 }
开发者ID:ruisebastiao,项目名称:Elysium-Extra,代码行数:9,代码来源:DataGridRowAttached.cs


示例19: PickUpCard

 private void PickUpCard(object sender, MouseEventArgs e)
 {
     if (MouseButtonState.Pressed.Equals(e.LeftButton) && dragActive)
     {
         DataGridRow SearchCard = new DataGridRow();
         var row = (DataRowView)resultsGrid.SelectedItem;
         if (row == null) return;
         if (CardAdded == null) return;
         var rowid = row["id"] as string;
         if (rowid != null)
         {
             DataNew.Entities.MultiCard getCard = Game.GetCardById(Guid.Parse(rowid)).ToMultiCard();
             DataObject dragCard = new DataObject("Card", getCard);
             DragDrop.DoDragDrop(SearchCard, dragCard, DragDropEffects.Copy);
         }
     }
     dragActive = false;
 }
开发者ID:haplo63,项目名称:OCTGN,代码行数:18,代码来源:SearchControl.xaml.cs


示例20: MessageBoxEvent

 static void MessageBoxEvent(DataGridRow item)
 {
     item.Selected += delegate
     {
         MessageBox.Show("");
     };
 }
开发者ID:Roommetro,项目名称:Friendly.WPFStandardControls,代码行数:7,代码来源:WPFDataGridTest.cs.cs



注:本文中的System.Windows.Controls.DataGridRow类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Controls.DataGridRowEventArgs类代码示例发布时间:2022-05-26
下一篇:
C# Controls.DataGridColumn类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap