本文整理汇总了C#中DevExpress.GetDataRow方法的典型用法代码示例。如果您正苦于以下问题:C# DevExpress.GetDataRow方法的具体用法?C# DevExpress.GetDataRow怎么用?C# DevExpress.GetDataRow使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DevExpress
的用法示例。
在下文中一共展示了DevExpress.GetDataRow方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DeleteSelectedRows
public void DeleteSelectedRows(DevExpress.XtraGrid.Views.Grid.GridView view)
{
if (view == null || view.SelectedRowsCount == 0) return;
DataRow[] rows = new DataRow[view.SelectedRowsCount];
for (int i = 0; i < view.SelectedRowsCount; i++)
rows[i] = view.GetDataRow(view.GetSelectedRows()[i]);
view.BeginSort();
try
{
foreach (DataRow row in rows)
row.Delete();
}
finally
{
view.EndSort();
}
}
示例2: UpData
private static byte[] UpData(DevExpress.XtraGrid.Views.BandedGrid.AdvBandedGridView view)
{
string path = null;
OpenFileDialog openFile = new OpenFileDialog();
openFile.Title = "Chọn file để cập nhật tài liệu:";
DialogResult value = openFile.ShowDialog();
if (value == DialogResult.OK)
{
path = openFile.FileName;
//Kiểm tra độ lớn của file
if (!HelpFile.CheckFileSize(path, 20))
{
//Độ lớn của file lớn hơn độ lớn qui định
HelpMsgBox.ShowNotificationMessage("Bạn không được chọn file lớn hơn 20 MB.");
path = null;
UpData(view);
}
}
else if (value == DialogResult.Cancel)
{
path = null;
return null;
}
if (path != null)
{
byte[] bytes = null;
bytes = HelpFile.FileToBytes(path);
DataRow row = view.GetDataRow(view.FocusedRowHandle);
if (row == null) HelpMsgBox.ShowNotificationMessage("Bạn chưa chọn nhân sự, vui lòng vào thông tin nhân sự!");
else
{
row["TEN_TAI_LIEU"] = Path.GetFileName(path);
row["NGAY_NOP"] = DateTime.Now;
return bytes;
}
}
return null;
}
示例3: focus_new_row_created
private void focus_new_row_created(DevExpress.XtraGrid.Views.Grid.GridView ip_grv)
{
int v_row_index = 0;
decimal v_id_gd_hd_f340 = 0;
string v_da_xoa_f340 = "N";
v_id_gd_hd_f340 = find_id_hd(CIPConvert.ToDecimal(m_sle_chon_nhan_vien.EditValue));
if (ip_grv == m_grv_hs_lns)
{
US_V_F340_DAT_HS_LNS v_us = new US_V_F340_DAT_HS_LNS();
DS_V_F340_DAT_HS_LNS v_ds = new DS_V_F340_DAT_HS_LNS();
v_us.FillDataset(v_ds);
for (v_row_index = 0; v_row_index < v_ds.Tables[0].Rows.Count; v_row_index++)
{
var v_id_gd_hd = CIPConvert.ToDecimal(ip_grv.GetDataRow(v_row_index)["ID_HOP_DONG"].ToString());
var v_da_xoa = ip_grv.GetDataRow(v_row_index)["DA_XOA_LNS"].ToString();
if (v_id_gd_hd == v_id_gd_hd_f340 && v_da_xoa == v_da_xoa_f340)
{
break;
}
}
ip_grv.FocusedRowHandle = v_row_index;
}
else if (ip_grv == m_grv_lcd)
{
US_V_F340_DAT_LCD v_us = new US_V_F340_DAT_LCD();
DS_V_F340_DAT_LCD v_ds = new DS_V_F340_DAT_LCD();
v_us.FillDataset(v_ds);
for (v_row_index = 0; v_row_index < v_ds.Tables[0].Rows.Count; v_row_index++)
{
var v_id_gd_hd = CIPConvert.ToDecimal(ip_grv.GetDataRow(v_row_index)["ID_HOP_DONG"].ToString());
var v_da_xoa = ip_grv.GetDataRow(v_row_index)["DA_XOA_LCD"].ToString();
if (v_id_gd_hd == v_id_gd_hd_f340 && v_da_xoa == v_da_xoa_f340)
{
break;
}
}
ip_grv.FocusedRowHandle = v_row_index;
}
}
示例4: deleteSelectedRows
public static bool deleteSelectedRows(DevExpress.XtraGrid.Views.Grid.GridView xgv)
{
if (xgv == null)
return false;
int[] nSelectedRows = xgv.GetSelectedRows();
if (nSelectedRows.Length == 0)
return false;
try
{
DataRow drRow = null;
foreach(int nRowHandle in nSelectedRows)
{
drRow = xgv.GetDataRow(nRowHandle);
if (drRow != null)
drRow.Delete();
}
}
catch(Exception ex)
{
throw(ex);
}
return true;
}
示例5: deleteSelectedRow
public static bool deleteSelectedRow(DevExpress.XtraGrid.Views.Grid.GridView xgv, int nRowHandle)
{
if (xgv == null || nRowHandle < 0)
return false;
DataRow drDeleteRow = xgv.GetDataRow(nRowHandle);
if (drDeleteRow == null)
return false;
// delete row:
drDeleteRow.Delete();
return true;
}
示例6: DelMainBurtgel
public static bool DelMainBurtgel(DevExpress.XtraGrid.Views.Grid.GridView grd)
{
bool ReturnValue = false;
try
{
if (Services.Security.checkForm("DELETE_CARD", Variables.UserInfo))
{
if (grd.SelectedRowsCount > 0)
{
if (MessageBox.Show("Мэдээллийг устгах уу?", "Анхааруулга", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
{
DataRow Row = grd.GetDataRow(grd.FocusedRowHandle);
if (Row["BNoHistory_ID"] != null && Row["BNoHistory_ID"].ToString() != "")
{
string SQL = "Update MainBurtgel.T_BNoHistory Set Archive = 'Y' Where ID = '" + Row["BNoHistory_ID"].ToString() + "'";
if (Services.Database.ExecuteNonQueryStr(SQL))
ReturnValue = true;
else
ReturnValue = false;
}
}
}
else
{
MessageBox.Show("Мэдээлэл сонгоно уу!", "Алдаа", MessageBoxButtons.OK, MessageBoxIcon.Error);
ReturnValue = false;
}
}
else
MessageBox.Show("Уучлаарай! Та хандах эрхгүй байна.", "Анхааруулга", MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
catch (Exception Err)
{
MessageBox.Show("Дараахи алдаа гарлаа : " + Err.Message.ToString(), "Алдаа", MessageBoxButtons.OK, MessageBoxIcon.Error);
ReturnValue = false;
}
return ReturnValue;
}