zoukankan
html css js c++ java
DataGrid相邻行有相同内容时对指定列合并和C#可以实现DLL库的动态调用
/**/
///
<summary>
///
DataGrid相邻行有相同内容时对指定列合并
///
</summary>
///
<param name="spangrid">
格式化的DataGrid的ID
</param>
///
<param name="spancell">
要合并的列
</param>
///
<param name="spanby">
合并所依据数据的列
</param>
public
void
FormatGrid(DataGrid spangrid,
int
spancell,
int
spanby)
{
if
(spanby
<
0
||
spanby
>
spangrid.Items.Count)
return
;
int
rowspan
=
1
;
for
(
int
i
=
1
;i
<
spangrid.Items.Count;i
++
)
{
if
(spangrid.Items[i].Cells[spanby].Text
==
spangrid.Items[i
-
1
].Cells[spanby].Text)
{
rowspan
+=
1
;
spangrid.Items[i].Cells[spancell].Visible
=
false
;
spangrid.Items[i
-
rowspan
+
1
].Cells[spancell].RowSpan
=
rowspan;
}
else
{
string
str
=
spangrid.Items[i].Cells[spanby].Text;
string
str1
=
spangrid.Items[i
-
1
].Cells[spanby].Text;
rowspan
=
1
;
}
}
}
C#可以实现DLL库的动态调用
Assembly assmebly
=
Assembly.LoadFile(
@"
C:WindowsApplication2005-09-30.dll
"
);
Type t
=
assmebly.GetType(
"
WindowsApplication2005_09_30.Class1
"
);
object
obj
=
Activator.CreateInstance(t,
null
);
MethodInfo method
=
t.GetMethod(
"
Test01
"
);
int
i
=
(
int
)method.Invoke(obj,
new
object
[
1
]
{
10
}
);
namespace
WindowsApplication2005_09_30
{
public
class
Class1
{
public
int
Test01(
int
i)
{
return
i
*
10
;
}
}
}
查看全文
相关阅读:
acdream.18.KIDx's Triangle(数学推导)
upc.2219: A^X mod P(打表 && 超越快速幂(in some ways))
山东省第四届acm.Rescue The Princess(数学推导)
BC.5200.Trees(dp)
BC.36.Gunner(hash)
hdu.5195.DZY Loves Topological Sorting(topo排序 && 贪心)
数组倒置算法扩展
C# 传值和传引用 ( ref out in )
C# 输出文件夹下的所有文件
控制反转(自译)
原文地址:https://www.cnblogs.com/ghd258/p/252577.html
最新文章
Python_时间复杂度概念
Python_序列化和反序列化模块
Python_自定义模块
Python_模块介绍
Python_冒泡排序
Python_re正则表达式
通过反射调用方法会大大降低性能
使浏览器不进行缓存
Bytecode Visualizer 一个好用的class字节码查看工具
java堆分析神器MAT
热门文章
jdk内置工具使用
三款查看class文件结构的工具
安全相关思维导图
Jeecms 防xss处理原理
spring mvc 基本原理
分布式漏洞扫描系统设计与实现
zoj.3865.Superbot(bfs + 多维dp)
hdu.5203.Rikka with wood sticks(数学推导:一条长度为L的线段经分割后可以构成几种三角形)
hdu.5202.Rikka with string(贪心)
Valid Pattern Lock(dfs + 暴力)
Copyright © 2011-2022 走看看