C
Cdudej
Hello
Any help appreciated.
I need to convert this:
Protected Sub grdMaster_RowDataBound(ByVal sender As Object, _
ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) _
Handles grdMaster.RowDataBound
Dim objListItem As DataControlRowState
objListItem = e.Row.RowState
Dim intMAsterID1 As Integer
If e.Row.RowType = DataControlRowType.DataRow Then
Dim grd As GridView
If objListItem = 5 Then
grd = CType(e.Row.FindControl("grdChildGridEdit"),
GridView)
MasterTableID = Convert.ToInt32(CType(e.Row.DataItem, _
DataRowView).Row.ItemArray(0).ToString())
intMAsterID1 = MasterTableID
If grd IsNot Nothing Then
grd.DataSourceID = ""
grd.DataSource = ChildDataSource
ChildDataSource.SelectParameters(_
"MasterTableID").DefaultValue = intMAsterID1
ChildDataSource.Select()
grd.DataBind()
To C#.
DataRowState objListItem = new DataRowState();
int intMAsterID1;
if (e.Row.RowType = DataControlRowType.DataRow)
{
GridView grd = new GridView();
if (objListItem = 5)
{
grd = (GridView)
(e.Row.FindControl("grdChildGridEdit"));
//Cant get this line. I havent used vb before.
//intMAsterID1 =
int.Parse(e.Row.DataItem).Row.ItemArray(0).ToString())
if (grd != null)
{
grd.DataSourceID = "";
grd.DataSource = ChildDataSource;
}
}
}
Any help appreciated.
I need to convert this:
Protected Sub grdMaster_RowDataBound(ByVal sender As Object, _
ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) _
Handles grdMaster.RowDataBound
Dim objListItem As DataControlRowState
objListItem = e.Row.RowState
Dim intMAsterID1 As Integer
If e.Row.RowType = DataControlRowType.DataRow Then
Dim grd As GridView
If objListItem = 5 Then
grd = CType(e.Row.FindControl("grdChildGridEdit"),
GridView)
MasterTableID = Convert.ToInt32(CType(e.Row.DataItem, _
DataRowView).Row.ItemArray(0).ToString())
intMAsterID1 = MasterTableID
If grd IsNot Nothing Then
grd.DataSourceID = ""
grd.DataSource = ChildDataSource
ChildDataSource.SelectParameters(_
"MasterTableID").DefaultValue = intMAsterID1
ChildDataSource.Select()
grd.DataBind()
To C#.
DataRowState objListItem = new DataRowState();
int intMAsterID1;
if (e.Row.RowType = DataControlRowType.DataRow)
{
GridView grd = new GridView();
if (objListItem = 5)
{
grd = (GridView)
(e.Row.FindControl("grdChildGridEdit"));
//Cant get this line. I havent used vb before.
//intMAsterID1 =
int.Parse(e.Row.DataItem).Row.ItemArray(0).ToString())
if (grd != null)
{
grd.DataSourceID = "";
grd.DataSource = ChildDataSource;
}
}
}