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
;
}
}
}
查看全文
相关阅读:
Convert Datetime to String in Sql Server
[转]C# 多线程
[转]C#的内存管理:堆栈、托管堆与指针
[转]js操作select相关方法(收集)
[转]javaScript中URL编码转换,escape() encodeURI() encodeURIComponent
Compile android NDK without Eclipse
BlockingQueue and BlockingDeque
Android Notebook
java.String.format &Formatter
Install Git for Eclipse
原文地址:https://www.cnblogs.com/ghd258/p/252577.html
最新文章
关于Qt sqlite数据库的使用总结
再谈Qt数据库的使用
Qt 的sqlite数据库的学习
Qt做的简易图片浏览
CRM2011 简单的Excel导入
ubuntu Linux 安装和首次使用
SE 2014年4月8日
SE 2014年4月3日
SE 2014年4月4日
SE 2014年4月5日
热门文章
SE 2014年3月31日
SE 2014年4月1日
SE 2014年4月2日
haproxy 基于 lamp 部署 discuz,实现动静分离
haproxy 基于 hdr 实现调度
[转][Lucene.Net] 基本用法
[转]C#中使用Monitor类、Lock和Mutex类来同步多线程的执行
[转载]《博客园精华集》WCF筛选结果(共84篇)
【转】JS获取页面元素坐标
在中文版VS 08中安装MVC
Copyright © 2011-2022 走看看