大神请进!!
vb.net吧
全部回复
仅看楼主
level 6
18720059673 楼主
1.
If dgv(e.ColumnIndex, e.RowIndex).GetType Is GetType(DataGridViewLinkCell)
2.
Dim scrlIdx As Integer = Me.CheckinFileGrid.FirstDisplayedScrollingRowIndex()
Me.UploadFileBindingSource.Clear()
For Each checkinFile As DcmParam.UploadFile In afterFileList
Me.UploadFileBindingSource.Add(checkinFile)
Next
3.
Dim colName As String = dgv.Columns(e.ColumnIndex).Name
求大神帮忙把上面的代码转换成C#的?????
2014年11月19日 07点11分 1
level 12
1、if (object.ReferenceEquals(dgv(e.ColumnIndex, e.RowIndex).GetType, typeof(DataGridViewLinkCell)))
{
}
2、int scrlIdx = this.CheckinFileGrid.FirstDisplayedScrollingRowIndex();
this.UploadFileBindingSource.Clear();
foreach (DcmParam.UploadFile checkinFile in afterFileList)
{
this.UploadFileBindingSource.Add(checkinFile);
}
3、string colName = dgv.Columns(e.ColumnIndex).Name;
这些代码不难啊。。。。再常规的定义和for的应用。
2014年11月19日 09点11分 2
你看我楼下的截图,我也是这样写的,但是报错了
2014年11月20日 01点11分
level 6
18720059673 楼主
2014年11月20日 01点11分 4
你确定用的VB.net 代码和C# 的是同一个版本?
2014年11月20日 01点11分
回复 杭州北极熊 :vb.net 的是用vs2008的 我现在是用vs2013转化成C#的
2014年11月20日 01点11分
你这里的控件是什么控件?
2014年11月20日 01点11分
回复 杭州北极熊 :dategridview
2014年11月20日 01点11分
level 6
18720059673 楼主
就是这样的一个东西
2014年11月20日 02点11分 5
level 12
UploadFileBindingSource 的报错是因为我没有放这个控件。
afterFileList的提示错误 是因为这个变量没有定义。
2014年11月20日 02点11分 6
level 12
你要去确认一下,你的VB.net 的代码里,UploadFileBindingSource 控件是那一个,然后放上去,那这个报错就解决了。
this.dataGridView1.FirstDisplayedScrollingRowIndex 的这个报错,我就不知道是不是VS2013的代码不一样了,
我用的是VS2010.
2014年11月20日 02点11分 7
我现C#的框架是WPF,而vb.net的框架应该是winform
2014年11月20日 02点11分
回复 18720059673 :这二个应该不影响。
2014年11月20日 02点11分
回复 杭州北极熊 :你的 .net framework是几
2014年11月20日 06点11分
回复 18720059673 :4.0
2014年11月20日 06点11分
level 12
就上面的这些代码而言你读到第一行有什么用?没有看出来。
2014年11月20日 07点11分 8
level 12
FirstVisibleColumn 你可以用这个
2014年11月20日 07点11分 9
我试了一下,也不行
2014年11月20日 09点11分
level 6
18720059673 楼主
if (this.DownloadFileGrid.Items.Count > scrlIdx)
{
this.DownloadFileGrid.FirstDisplayedScrollingRowIndex = scrlIdx;
}
if (this.DownloadFileGrid.Items.Count > 0)
{
this.DownloadFileGrid.FirstDisplayedScrollingRowIndex = this.DownloadFileGrid.Items.Count - 1;
}
else
{
}
2014年11月20日 07点11分 10
level 6
18720059673 楼主
还是会报错???
这里报错说:System.Windows.Controls.DataGrid 里面没有
2014年11月20日 09点11分 11
level 12
你这里为什么提示错误,我就不知道了。
2014年11月20日 09点11分 12
你这this后面的怎么还是datagridview,我的DownloadFileGrid的定义是: DataGrid DcmFileDownloadClient.DownloadFileGrid
2014年11月21日 00点11分
这个不是重点,我只是没有删除这个代码而以。
2014年11月21日 01点11分
回复 杭州北极熊 :我的DataGrid属于system.windows.controls .datagrid ,这里面没有这个属性
2014年11月21日 01点11分
回复 杭州北极熊 : 我这的目的是为了使滚动条一开始就在第一行的位置
2014年11月21日 01点11分
level 6
18720059673 楼主
这是报错的代码
2014年11月21日 05点11分 13
level 12
DcmParam是什么控件?
2014年11月21日 05点11分 14
这不是控件,是命名空间namespace dcm.DcmParam
2014年11月21日 06点11分
回复 18720059673 :你这个是第三方DLL了哦?那我就不知道了。
2014年11月21日 09点11分
1