winform tablelayoutpanel_table.render

winform tablelayoutpanel_table.render*******************CreateTable******************* dtData.Rows.Clear(); //DetailTable publicstaticvoidAddColumns(refDataTabletable) { table.Columns.Add(“BusinessType”,typeof(string…

大家好,又见面了,我是你们的朋友全栈君。如果您正在找激活码,请点击查看最新教程,关注关注公众号 “全栈程序员社区” 获取激活教程,可能之前旧版本教程已经失效.最新Idea2022.1教程亲测有效,一键激活。

Jetbrains全系列IDE稳定放心使用

 ******************* Create Table *******************

dtData.Rows.Clear();

      //Detail Table

public static void AddColumns(ref DataTable table)

{

table.Columns.Add(“BusinessType”,typeof(string));

table.Columns.Add(“BusinessUnit”,typeof(string));

table.Columns.Add(“SourceCode”,typeof(string));

table.Columns.Add(“UserName”,typeof(string));

table.Columns.Add(“SONO”,typeof(string));

table.Columns.Add(“CustomerCode_Market”,typeof(string));

table.Columns.Add(“Customer_Plantid”,typeof(string));

table.Columns.Add(“InvoiceNo”,typeof(string));

table.Columns.Add(“OCNO_PLNo”,typeof(string));

table.Columns.Add(“ItemNo”,typeof(string));

table.Columns.Add(“PCS”,typeof(string));

table.Columns.Add(“CTNS”,typeof(string));

table.Columns.Add(“CBM”,typeof(string));

table.Columns.Add(“KGS”,typeof(string));

table.Columns.Add(“ClosingDate”,typeof(string));

table.Columns.Add(“JobNO”,typeof(string));

table.Columns.Add(“DestinationID”,typeof(string));

table.Columns.Add(“Status”,typeof(string));

}

public static void updColumns(ref DataTable table)

{

table.Columns.Add(“BusinessType”,typeof(string));

table.Columns.Add(“BusinessUnit”,typeof(string));

table.Columns.Add(“SourceCode”,typeof(string));

table.Columns.Add(“UserName”,typeof(string));

table.Columns.Add(“SONO”,typeof(string));

table.Columns.Add(“CustomerCode_Market”,typeof(string));

table.Columns.Add(“Customer_Plantid”,typeof(string));

table.Columns.Add(“InvoiceNo”,typeof(string));

table.Columns.Add(“OCNO_PLNo”,typeof(string));

table.Columns.Add(“ItemNo”,typeof(string));

table.Columns.Add(“PCS”,typeof(string));

table.Columns.Add(“CTNS”,typeof(string));

table.Columns.Add(“CBM”,typeof(string));

table.Columns.Add(“KGS”,typeof(string));

table.Columns.Add(“ClosingDate”,typeof(string));

table.Columns.Add(“JobNO”,typeof(string));

table.Columns.Add(“DestinationID”,typeof(string));

table.Columns.Add(“FID”,typeof(string));

table.Columns.Add(“Status”,typeof(string));

 

****************** Datagrid ItemCommand Operator **************************

 

DataRow[] drsDel = dtData.Select(string.Format(“FID in ({0})”, FID.ToString())); 

//直接在集合中删除 foreach (DataRow drDel in drsDel)

{ dtData.Rows.Remove(drDel); }

if( FID > 0)

{
 m_objSQLBLL.DeleteTADetail(FID.ToString());

txtHiddenFID.Value += FID.ToString() + “,”; }

private void dg_FCL_ItemCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e)

{
if (e.CommandName == “Delete”)
{
AddColumns(ref dtData);
int intRow=0;
foreach(DataGridItem dgi in dg_FCL.Items)
{
intRow += 1;
DataRow dr1 = dtData.NewRow();
dr1[“BusinessType”]=((DropDownList)(dgi.FindControl(“dropBusinessType”))).SelectedValue;
dr1[“BusinessUnit”]=((DropDownList)(dgi.FindControl(“dropBusinessUnit”))).SelectedValue;
dr1[“SourceCode”]=((DropDownList)(dgi.FindControl(“dropSourceCode”))).SelectedValue;
dr1[“UserName”]=((TextBox)(dgi.FindControl(“txtUserName”))).Text.ToString();
dr1[“SONO”]=((TextBox)(dgi.FindControl(“txtSONO”))).Text.ToString();
dr1[“CustomerCode_Market”]=((TextBox)(dgi.FindControl(“txtCustomerCode_Market”))).Text.ToString();
dr1[“Customer_Plantid”]=((TextBox)(dgi.FindControl(“txtCustomer_Plantid”))).Text.ToString();
dr1[“InvoiceNo”]=((TextBox)(dgi.FindControl(“txtInvoiceNo”))).Text.ToString();
dr1[“OCNO_PLNo”]=((TextBox)(dgi.FindControl(“txtOCNO_PLNo”))).Text.ToString();
dr1[“ItemNo”]=((TextBox)(dgi.FindControl(“txtItemNo”))).Text.ToString();
dr1[“PCS”]=((TextBox)(dgi.FindControl(“txtPCS”))).Text.ToString();
dr1[“CTNS”]=((TextBox)(dgi.FindControl(“txtCTNS”))).Text.ToString();
dr1[“CBM”]=((TextBox)(dgi.FindControl(“txtCBM”))).Text.ToString();
dr1[“KGS”]=((TextBox)(dgi.FindControl(“txtKGS”))).Text.ToString();
dr1[“ClosingDate”]=((TextBox)(dgi.FindControl(“txtClosingDate”))).Text.ToString();
dr1[“JobNO”]=((TextBox)(dgi.FindControl(“txtJobNO”))).Text.ToString();
dr1[“DestinationID”]=((DropDownList)(dgi.FindControl(“dropDestinationID”))).SelectedValue;
dr1[“Status”]=((Label)(dgi.FindControl(“lblHEStatus”))).Text.ToString();
dtData.Rows.Add(dr1);
}
dtData.Rows.Remove(dtData.Rows[e.Item.ItemIndex]);

this.dg_FCL.Visible = true;
this.dg_FCL.DataSource = dtData.DefaultView;
this.dg_FCL.DataBind();
}
}

 

 ****************** Datagrid ItemDataBound Operator **************************

 private void dg_FCL_ItemDataBound(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e)

{

if (e.Item.ItemType == ListItemType.AlternatingItem || e.Item.ItemType == ListItemType.Item)

{              

DropDownList listBusinessType = new DropDownList();

listBusinessType= (DropDownList)(e.Item.FindControl(“dropBusinessType”));

DataView dv = m_objSQLBLL.GetBusinessType();

if ( !( ViewState[Constants.VENDOR_CODE].ToString().Trim() == “09420” || ViewState[Constants.VENDOR_CODE].ToString().Trim() == “09421” 

|| ViewState[Constants.VENDOR_CODE].ToString().Trim() == “09422” || ViewState[Constants.VENDOR_CODE].ToString().Trim() == “09415”

|| ViewState[Constants.VENDOR_CODE].ToString().Trim() == “09407”

) )

{

dv.RowFilter = ” BusinessType in (‘DI-US’,’DI-INT’,’TRADE’)”;

}

listBusinessType.DataSource = dv;

listBusinessType.DataTextField = “BusinessName”;        

listBusinessType.DataValueField = “BusinessType”;

listBusinessType.DataBind();

listBusinessType.SelectedValue = ((string)DataBinder.Eval(e.Item.DataItem, “BusinessType”));

DropDownList listBusinessUnit = new DropDownList();

listBusinessUnit= (DropDownList)(e.Item.FindControl(“dropBusinessUnit”));

DataView dvBusinessUnit = m_objSQLBLL.GetBusinessUnit();

listBusinessUnit.DataSource = dvBusinessUnit;

listBusinessUnit.DataTextField = “BusinessUnit”;        

listBusinessUnit.DataValueField = “BusinessUnit”;

listBusinessUnit.DataBind();

listBusinessUnit.SelectedValue = ((string)DataBinder.Eval(e.Item.DataItem, “BusinessUnit”));

DropDownList listSourceCode = new DropDownList();

listSourceCode= (DropDownList)(e.Item.FindControl(“dropSourceCode”));

DataView dvSourceCode = m_objSQLBLL.GetSourceCode();

listSourceCode.DataSource = dvSourceCode;

listSourceCode.DataTextField = “SourceCode”;        

listSourceCode.DataValueField = “SourceCode”;

listSourceCode.DataBind();

listSourceCode.SelectedValue = ((string)DataBinder.Eval(e.Item.DataItem, “SourceCode”));

//20100328

DropDownList listDestinationID = new DropDownList();

listDestinationID= (DropDownList)(e.Item.FindControl(“dropDestinationID”));

DataView dvDestination = m_objSQLBLL.GetDestinationForPlant();

listDestinationID.DataSource = dvDestination;

listDestinationID.DataTextField = “DestinationAddr”;        

listDestinationID.DataValueField = “DestinationID”;

listDestinationID.DataBind();

listDestinationID.SelectedValue = ((string)DataBinder.Eval(e.Item.DataItem, “DestinationID”));

if(dg_FCL.Items.Count == 0) 

{

((ImageButton)(e.Item.FindControl(“Imagebutton1”))).Visible = false;

}

((ImageButton)(e.Item.FindControl(“Imagebutton1”))).Attributes.Add(“onclick”, “return confirm(‘Are you sure to delete the record ?’);”);

}

}

 

 

转载于:https://www.cnblogs.com/zhangchenliang/archive/2010/08/16/1800561.html

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/182495.html原文链接:https://javaforall.net

(0)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • MySQL: Hash索引优缺点

    MySQL: Hash索引优缺点优点:因为索引自身只需存储对应的哈希值,所以索引的结构十分紧凑,这也让哈希索引查找的速度非常快缺点:1、不能避免读取行哈希索引只包含哈希值和行指针,而不存储字段值,所以不能使用索引中的值来避免读取行。不过,访问内存中的行的速度很快,所以大部分情况下这一点对性能的影响并不明显。2、无法用于排序哈希索引数据并不是按照索引值顺序存储的,所以也就无法用于排序。3、无法使用部分索…

    2022年5月26日
    38
  • matplotlib 中的subplot的用法「建议收藏」

    matplotlib 中的subplot的用法「建议收藏」一个figure对象包含了多个子图,可以使用subplot()函数来绘制子图:(首先我没有想明白为啥会有这么多的内容来介绍这一个函数,后来知道了原来这个函数还真的挺多的内容)言简意赅:首先,它的

    2022年8月1日
    12
  • TextCNN文本分类(keras实现)「建议收藏」

    TextCNN文本分类(keras实现)「建议收藏」目录前言:一、论文笔记二、Keras文本预处理1、读取数据集2、将文字转换成数字特征3、将每条文本转换为数字列表4、将每条文本设置为相同长度5、将每个词编码转换为词向量6、Keras文本预处理代码实现三、基于keras的TextCNN模型的构建、训练与测试1、基础版CNN(模仿LeNet-5)2、简单版TextCNN3、使用Word2Vec词向量…

    2022年6月28日
    33
  • virsh 虚拟机迁移目录_虚拟机迁移的六个步骤

    virsh 虚拟机迁移目录_虚拟机迁移的六个步骤简介虚拟机迁移主要分为两种:静态迁移和动态迁移静态迁移是指在虚拟机关闭或暂停的情况下,将源宿主机上虚拟机的磁盘文件和配置文件拷贝到目标宿主机上。这种方式需要显式的停止虚拟机运行,对服务可用性要求高的需求不合适。动态迁移无需拷贝虚拟机配置文件和磁盘文件,但是需要迁移的主机之间有相同的目录结构放置虚拟机磁盘文件,可以通过多种方式实现,本例采用基于共享存储动态迁移,通过NFS来实现。操作环境服

    2022年8月11日
    5
  • Java 数组转list_string数组转list

    Java 数组转list_string数组转listava中数组转list使用Arrays.asList(T…a)方法。示例:publicclassApp{publicstaticvoidmain(String[]args){List<String>stringA=Arrays.asList("hello","world","A");String[]stringArray={"h…

    2022年8月23日
    7
  • PHP实现微信退款的分析与源码实现

    PHP实现微信退款的分析与源码实现

    2021年10月31日
    45

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号