当前位置: 首页>>代码示例>>C#>>正文


C# GridView.GetRowCellValue方法代码示例

本文整理汇总了C#中GridView.GetRowCellValue方法的典型用法代码示例。如果您正苦于以下问题:C# GridView.GetRowCellValue方法的具体用法?C# GridView.GetRowCellValue怎么用?C# GridView.GetRowCellValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在GridView的用法示例。


在下文中一共展示了GridView.GetRowCellValue方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ValidateInspection

        private void ValidateInspection(GridView view, string NameColumn, ValidateRowEventArgs e)
        {
            string Name = (string)view.GetRowCellValue(e.RowHandle, NameColumn);

            view.ClearColumnErrors();

            if(String.IsNullOrEmpty(Name))
            {
                view.SetColumnError(inspectorsGridColumn,
                   Program.LanguageManager.GetString(StringResources.SelectInspectorsForTestResult));
                e.Valid = false;
            }
        }
开发者ID:SalamanderSunburn,项目名称:prizm,代码行数:13,代码来源:SpoolsXtraForm.cs

示例2: ValidateCertificate

        void ValidateCertificate(GridView view, GridColumn certNameColumn, GridColumn expDateColumn, ValidateRowEventArgs e)
        {
            string certName = (string)view.GetRowCellValue(e.RowHandle, certNameColumn);
            DateTime? certExpDate = (DateTime?)view.GetRowCellValue(e.RowHandle, expDateColumn);

            view.ClearColumnErrors();

            if (string.IsNullOrWhiteSpace(certName))
            {
                view.SetColumnError(certNameColumn, Program.LanguageManager.GetString(StringResources.Settings_ValueRequired));
                e.Valid = false;
            }
        }
开发者ID:AleksMorozova,项目名称:prizm,代码行数:13,代码来源:SettingsXtraForm.cs

示例3: ValidatePersonName

        void ValidatePersonName(GridView view, GridColumn firstNameColumn, GridColumn lastNameColumn, ValidateRowEventArgs e)
        {

            string firstName = (string)view.GetRowCellValue(e.RowHandle, firstNameColumn);
            string lastName = (string)view.GetRowCellValue(e.RowHandle, lastNameColumn);

            view.ClearColumnErrors();

            if (String.IsNullOrEmpty(firstName))
            {
                view.SetColumnError(firstNameColumn,
                    Program.LanguageManager.GetString(StringResources.Settings_ValueRequired));
                e.Valid = false;
            }

            if (String.IsNullOrEmpty(lastName))
            {
                view.SetColumnError(lastNameColumn,
                   Program.LanguageManager.GetString(StringResources.Settings_ValueRequired));
                e.Valid = false;
            }
        }
开发者ID:AleksMorozova,项目名称:prizm,代码行数:22,代码来源:SettingsXtraForm.cs

示例4: getChoiceCount

        //获取当前checkbox选中行数
        private int getChoiceCount(GridView gridview)
        {
            int choiceCount = 0;
            for (int i = 0; i < gridview.RowCount; i++)
            {
                if (gridview.GetRowCellValue(i, "selected") != null)
                {
                    if ((bool)gridview.GetRowCellValue(i, "selected") == true)
                    {
                        choiceCount++;
                    }
                }

            }
            return choiceCount;
        }
开发者ID:sunpander,项目名称:VSDT,代码行数:17,代码来源:FormEPESSUBJ.cs

示例5: GetDragData

        SchedulerDragData GetDragData(GridView view)
        {
            int[] selection = view.GetSelectedRows();
            if (selection == null)
                return null;

            AppointmentBaseCollection appointments = new AppointmentBaseCollection();
            int count = selection.Length;
            for (int i = 0; i < count; i++) {
                int rowIndex = selection[i];
                Appointment apt = schedulerStorage1.CreateAppointment(AppointmentType.Normal);
                apt.Subject = "Programación de Visita Cliente " + (string)view.GetRowCellValue(rowIndex, "NombreCliente");
                apt.LabelId = (int)Entidades.Enums.Enums.VisitaEstadoVista.Pendiente; // (int)view.GetRowCellValue(rowIndex, "Severity");
                apt.StatusId = 0; // (int)view.GetRowCellValue(rowIndex, "Priority");
                apt.Duration = new TimeSpan(0, 1, 0, 0); // TimeSpan.FromHours((int)view.GetRowCellValue(rowIndex, "Duration"));
                apt.Description = "Visita Cliente " + (string)view.GetRowCellValue(rowIndex, "NombreCliente");
                IdClienteDraw = (Int64)view.GetRowCellValue(rowIndex, "Id");
                appointments.Add(apt);
            }

            return new SchedulerDragData(appointments, 0);
        }
开发者ID:TarekMulla,项目名称:cra,代码行数:22,代码来源:frmCalendario.cs

示例6: SetCellDisable

        public static void SetCellDisable(GridView view, string FieldName, string KeyField, long[] KeyValues)
        {
            view.CustomDrawCell += delegate(object sender, RowCellCustomDrawEventArgs e)
            {
                if (e.RowHandle == view.FocusedRowHandle) return;

                if (e.Column.FieldName == FieldName)
                {
                    for (int vt = 0; vt <= KeyValues.Length - 1; vt++)
                    {
                        //if (Convert.ToInt64(view.GetRowCellDisplayText(e.RowHandle, KeyField)) == KeyValues[vt])
                        //{
                        //    e.Appearance.BackColor = Color.Gray;
                        //    // view.Columns[FieldName].OptionsColumn.AllowFocus = false;
                        //}
                        if (Convert.ToInt64(view.GetRowCellValue(e.RowHandle, KeyField)) == KeyValues[vt])
                        {
                            e.Appearance.BackColor = Color.Gray;
                            // view.Columns[FieldName].OptionsColumn.AllowFocus = false;
                        }
                    }
                }
            };
            view.ShowingEditor += delegate(object sender, CancelEventArgs e)
            {
                int index = view.FocusedRowHandle;
                if (index >= 0)
                {
                    for (int vt = 0; vt <= KeyValues.Length - 1; vt++)
                    {
                        //if (Convert.ToInt64(view.GetRowCellDisplayText(index, KeyField)) == KeyValues[vt]
                        //    && view.FocusedColumn.FieldName == FieldName)
                        //{
                        //    e.Cancel = true;
                        //}
                        if (Convert.ToInt64(view.GetRowCellValue(index, KeyField)) == KeyValues[vt]
                            && view.FocusedColumn.FieldName == FieldName)
                        {
                            e.Cancel = true;
                        }
                    }
                }
            };
        }
开发者ID:khanhdtn,项目名称:my-fw-win,代码行数:44,代码来源:HelpGrid.cs

示例7: openSaveFile

 public void openSaveFile(GridHitInfo gHitInfo, GridView view, string path, byte[] bytes)
 {
     if (HelpMsgBox.ShowConfirmMessage("Bạn có muốn lưu lại tài liệu không?") == DialogResult.Yes)
     {
         SaveFileDialog saveFile = new SaveFileDialog();
         //Cấu hình các thuộc tính cho saveFile
         saveFile.InitialDirectory = FrameworkParams.TEMP_FOLDER;
         saveFile.Title = "Chọn thư mục để lưu file:";
         //Lấy kiểu file
         string[] typeFile = Path.GetFileName(view.GetRowCellValue(gHitInfo.RowHandle, gHitInfo.Column).ToString()).Split(new char[] { '.' });
         saveFile.Filter = "File type " + typeFile.GetValue(typeFile.Length - 1).ToString()
             + "(*." + typeFile.GetValue(typeFile.Length - 1).ToString() + ")" + "|*."
             + typeFile.GetValue(typeFile.Length - 1).ToString();
         saveFile.FileName = FrameworkParams.TEMP_FOLDER + @"\" + typeFile.GetValue(typeFile.Length - 2).ToString();
         if (saveFile.ShowDialog() == DialogResult.OK)
         {
             path = saveFile.FileName;
         }
         Thread.Sleep(200);
     }
     if (path != null)
     {
         if (!HelpFile.BytesToFile(bytes, path))
         {
             if (HelpFile.BytesToFile(bytes, FrameworkParams.TEMP_FOLDER + @"\" + view.GetRowCellValue(gHitInfo.RowHandle, gHitInfo.Column).ToString()))
                 HelpFile.OpenFile(FrameworkParams.TEMP_FOLDER + @"\" + view.GetRowCellValue(gHitInfo.RowHandle, gHitInfo.Column).ToString());
             HelpMsgBox.ShowNotificationMessage("Không lưu được file.");
         }
         else
             HelpFile.OpenFile(path);
     }
     else
     {
         if (HelpFile.BytesToFile(bytes, FrameworkParams.TEMP_FOLDER + @"\" + view.GetRowCellValue(gHitInfo.RowHandle, gHitInfo.Column).ToString()))
             HelpFile.OpenFile(FrameworkParams.TEMP_FOLDER + @"\" + view.GetRowCellValue(gHitInfo.RowHandle, gHitInfo.Column).ToString());
     }
 }
开发者ID:khanhdtn,项目名称:my-office-manager,代码行数:37,代码来源:DANopBai.cs

示例8: IsConnected

 private bool IsConnected (GridView view, int row)
 {
     GridColumn col = view.Columns["IsConnected"];
     return Convert.ToBoolean(view.GetRowCellValue(row, col));
 }
开发者ID:SalamanderSunburn,项目名称:prizm,代码行数:5,代码来源:ComponentNewEditXtraForm.cs

示例9: IsStockMore

 private bool IsStockMore(GridView view, int row)
 {
     try
     {
         string val = Convert.ToString(view.GetRowCellValue(row, "STOCK"));
         string val1 = Convert.ToString(view.GetRowCellValue(row, "QTY"));
         string stockid = Convert.ToString(view.GetRowCellValue(row, "STOCKID"));
         if (int.Parse(stockid.ToUpper()) > 0)
             return (int.Parse(val) < int.Parse(val1));
     }
     catch
     {
         return false;
     }
     return false;
 }
开发者ID:rehman922,项目名称:VIRETAIL,代码行数:16,代码来源:RetailSales.cs

示例10: GetRowHandleByColumnValue

        private static int GetRowHandleByColumnValue(GridView view, string ColumnFieldName, object value)
        {
            int result = GridControl.InvalidRowHandle;

            for(int i = 0; i < view.RowCount; i++)
            {
                if(view.GetRowCellValue(i, ColumnFieldName).Equals(value))

                    return i;
            }
            return result;
        }
开发者ID:assassinadal,项目名称:BKIProject-DichVuMatDat,代码行数:12,代码来源:CHRMCommon.cs

示例11: SaveSelectionViewInfo

 public void SaveSelectionViewInfo(GridView view)
 {
     SaveSelList.Clear();
     GridColumn column = view.Columns[descriptor.keyFieldName];
     RowInfo rowInfo;
     int[] selectionArray = view.GetSelectedRows();
     if (selectionArray != null)  // otherwise we have a single focused but not selected row
         for (int i = 0; i < selectionArray.Length; i++)
         {
             int dataRowHandle = selectionArray[i];
             rowInfo.level = view.GetRowLevel(dataRowHandle);
             if (dataRowHandle < 0) // group row
                 dataRowHandle = view.GetDataRowHandleByGroupRowHandle(dataRowHandle);
             rowInfo.Id = view.GetRowCellValue(dataRowHandle, column);
             SaveSelList.Add(rowInfo);
         }
     rowInfo.Id = view.GetRowCellValue(view.FocusedRowHandle, column);
     rowInfo.level = view.GetRowLevel(view.FocusedRowHandle);
     SaveSelList.Add(rowInfo);
 }
开发者ID:Solnake,项目名称:kayflow,代码行数:20,代码来源:RefreshHelperClass.cs

示例12: SaveExpansionViewInfo

 public void SaveExpansionViewInfo(GridView view)
 {
     if (view.GroupedColumns.Count == 0) return;
     SaveExpList.Clear();
     GridColumn column = view.Columns[descriptor.keyFieldName];
     for (int i = -1; i > int.MinValue; i--)
     {
         if (!view.IsValidRowHandle(i)) break;
         if (view.GetRowExpanded(i))
         {
             RowInfo rowInfo;
             int dataRowHandle = view.GetDataRowHandleByGroupRowHandle(i);
             rowInfo.Id = view.GetRowCellValue(dataRowHandle, column);
             rowInfo.level = view.GetRowLevel(i);
             SaveExpList.Add(rowInfo);
         }
     }
 }
开发者ID:Solnake,项目名称:kayflow,代码行数:18,代码来源:RefreshHelperClass.cs

示例13: SaveExpandedMasterRows

 public void SaveExpandedMasterRows(GridView view)
 {
     if (view.GridControl.Views.Count == 1) return;
     SaveMasterRowsList.Clear();
     GridColumn column = view.Columns[descriptor.keyFieldName];
     for (int i = 0; i < view.DataRowCount; i++)
         if (view.GetMasterRowExpanded(i))
         {
             object key = view.GetRowCellValue(i, column);
             SaveMasterRowsList.Add(key);
             GridView detail = view.GetVisibleDetailView(i) as GridView;
             if (detail != null)
             {
                 ViewState state = ViewState.Create(this, detail);
                 if (state != null)
                 {
                     DetailViews.Add(key, state);
                     state.SaveState(detail);
                 }
             }
         }
 }
开发者ID:Solnake,项目名称:kayflow,代码行数:22,代码来源:RefreshHelperClass.cs

示例14: recargo

        private bool recargo(GridView view, int row)
        {
            GridColumn col = view.Columns["Recargo"];

            decimal val = Convert.ToDecimal(view.GetRowCellValue(row, col));

            return val > 0;
        }
开发者ID:JC-Developers,项目名称:SoftEmpeniosCergo,代码行数:8,代码来源:FrmPagosFinanciamiento.cs

示例15: DeleteRow

 /// <summary>
 /// 删除选中行数据
 /// </summary>
 private void DeleteRow(GridView dr,string FileName)
 {
     try
     {
         for (int i = dr.RowCount - 1; i >= 0; i--)
         {
             if (Convert.ToBoolean(dr.GetRowCellValue(i, FileName)) == true)
             {
                 dr.DeleteRow(i);
             }
         }
         if (dr.DataSource != null)
         {
             ((DataView)dr.DataSource).Table.AcceptChanges();
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
开发者ID:xlgwr,项目名称:producting,代码行数:24,代码来源:frmEditOper_Info.cs


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